Skip to content

Request: public API to send messages to the base Cuppy agent chat (SSE + tool events) #3629

Description

@78design

Feature request: expose a public API to send messages to the base Cuppy agent chat

Background

We built a Teable-powered web app (B2B lead/sourcing directory) and want to embed the real Cuppy agent (the one users chat with inside the Teable base UI — with its DB querying, web access and skills) directly in our app, instead of reimplementing a simplified agent on the app side.

Current state (verified)

These /base/{baseId}/chat/* endpoints work:

  • POST /base/{baseId}/chat/create → creates a session (201, returns chatId)
  • GET /base/{baseId}/chat/{chatId}/messages → reads messages
  • GET /base/{baseId}/chat/history → chat history

Missing / blocked:

  1. There is no endpoint to send a message. Tried POST /base/{baseId}/chat/{chatId}/messages, /generation, /stream, /completions, /ask, /message, /messages/stream, etc. — all return route-level 404 (Express Cannot POST ...), i.e. the route is not registered on the server.
  2. POST /base/{baseId}/chat/{chatId}/warmup and GET /base/{baseId}/chat/{chatId}/generation/status return "You are not allowed to edit/access this chat" for the app token.
  3. The feature is closed-source (not present in this repo's features/chat — that controller is only the chart-completions endpoint), and the public API catalog (587 routes) has no message-send route.
  4. No embeddable Cuppy chat UI exists either (app.teable.cn sends x-frame-options: deny; Claw bots only support Feishu IM with no web channel).

Proposal

Expose a documented, streamable endpoint for third-party apps, consistent with the existing /base/{baseId}/chat/* style:

POST /base/{baseId}/chat/{chatId}/messages
Authorization: Bearer <app token or user session token>
{ "content": "user message text" }
→ SSE stream (text/event-stream):
   - content_block_delta (text_delta) for incremental text
   - tool-use / progress events so clients can render the agent's task timeline

Would appreciate clarity/availability on:

  1. A message-send endpoint with streaming, keeping conversation context across turns (same chatId).
  2. Tool/skill transparency: expose the agent's tool execution (DB queries, web fetch, installed skills) as SSE events.
  3. Permission model: allow both app tokens and logged-in user session tokens to send (and open warmup/generation/status to the chat creator).
  4. Fallback if a full agent endpoint is not feasible soon: an endpoint like POST /api/{baseId}/ai/generate-stream but with base context + tools.

Why it matters

  • Lets third-party Teable apps reuse the real Cuppy (skills + tools) instead of reimplementing agents per app.
  • Matches the in-UI Cuppy experience (thinking process, task timeline, skill calls).
  • Happy to participate in testing once available.

We can reproduce the missing-route behavior instantly on request for debugging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions