This commit is contained in:
@@ -140,6 +140,7 @@ History search (`q`) notes:
|
||||
|
||||
### `GET /v1/chats`
|
||||
- Response: `{ "chats": ChatSummary[] }`
|
||||
- Optional `limit` (1–100) and opaque `cursor` return `{ "chats": ChatSummary[], "nextCursor": string | null }` in `updatedAt` descending order. Follow `nextCursor` until `null` to list all ordinary chats; paged results omit chat system-prompt/tool settings.
|
||||
|
||||
### `POST /v1/chats`
|
||||
- Body:
|
||||
@@ -233,6 +234,11 @@ Behavior notes:
|
||||
### `GET /v1/chats/:chatId`
|
||||
- Response: `{ "chat": ChatDetail }`
|
||||
|
||||
### `GET /v1/chats/:chatId/messages`
|
||||
- Requires the same authenticated owner/admin credential as other chat routes. Responses use `Cache-Control: no-store`.
|
||||
- Optional `limit` (1–100, default 50) and opaque `cursor` return `{ "chatId": string, "messages": VisibleChatMessage[], "nextCursor": string | null }`. Follow `nextCursor` until `null`; pages use ascending `(createdAt, id)` order and advance across hidden rows.
|
||||
- `VisibleChatMessage` includes only user/assistant `id`, `createdAt`, `role`, `content`, optional `name`, full supported `attachments`, and `agentAside: true` when the backend marked that row as an Agent aside. System messages, tool messages/call logs, and unrelated message metadata are excluded. Image data and full text attachment content are retained.
|
||||
|
||||
### `POST /v1/chats/:chatId/messages`
|
||||
- Body:
|
||||
```json
|
||||
@@ -275,10 +281,12 @@ Notes:
|
||||
```json
|
||||
{
|
||||
"chatId": "optional-chat-id",
|
||||
"clientRequestId": "optional-client-generated-id",
|
||||
"provider": "openai|anthropic|xai|gemini|hermes-agent",
|
||||
"model": "string",
|
||||
"messages": [
|
||||
{
|
||||
"id": "optional-existing-message-id",
|
||||
"role": "system|user|assistant|tool",
|
||||
"content": "string",
|
||||
"name": "optional",
|
||||
@@ -323,6 +331,12 @@ Notes:
|
||||
|
||||
Behavior notes:
|
||||
- If `chatId` is present, server validates chat existence.
|
||||
- `clientRequestId` is an optional stable identifier for retries of a persisted inline Agent completion.
|
||||
- For a persisted ordinary chat, a literal case-insensitive `@sybil` token in the latest user message invokes the existing persistent Sybil Agent instead of the selected provider for that turn. Email addresses, code spans/fences, indented code, and Markdown quote lines do not trigger it. The message and Agent reply remain visible in the chat; both are marked as Agent asides and are excluded by the backend from later selected-provider conversation history. The Agent root request is not projected into the visible Agent transcript.
|
||||
- The completion response identifies an inline Agent reply with `provider: "hermes-agent"`, `model: "sybil-agent"`, and `message.name: "Sybil Agent"`, `message.agentAside: true`.
|
||||
- Agent asides are identified by backend-stored `metadata.agentAside`, not client-supplied metadata. The ordinary-chat list/history APIs above support Agent tools reading the complete visible thread, including prior asides and attachment data, with cursor pagination.
|
||||
- Before the Agent is invoked, the backend paginates and supplies the complete safe visible-thread projection as required initial context; the Agent does not have to choose `read_chat_history` for the current thread. User/assistant asides and full supported attachment representations are included, while system/tool rows and unrelated metadata are excluded. Historical content remains untrusted context, not new authority.
|
||||
- The initial context transfer is limited to 30 MiB. A stored text attachment marked truncated, incomplete history, or a transfer/provider context-limit failure returns an explicit error and no answer from partial history; providers may reject a complete thread that exceeds their model context window.
|
||||
- For `chatId` calls, server stores only *new* non-assistant messages from provided history to avoid duplicates.
|
||||
- `additionalSystemPrompt`, when present directly or loaded from stored chat settings, is prepended to the provider request as a `system` message and is not inserted into the persisted chat transcript by this endpoint.
|
||||
- `enabledTools` limits Sybil-managed tools for this request. When omitted for a saved chat, the stored chat setting is used; otherwise all available tools are enabled by default. An empty array disables Sybil-managed tools.
|
||||
|
||||
Reference in New Issue
Block a user