From fd222d3f079ba381a584a811dd6d95220ef18e8e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 4 Apr 2026 19:23:55 +0100 Subject: [PATCH] docs: refresh chat history scaffolding refs --- docs/gateway/protocol.md | 6 ++++-- docs/platforms/android.md | 6 ++++-- docs/platforms/mac/webchat.md | 7 +++++-- docs/web/control-ui.md | 7 ++++++- docs/web/webchat.md | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/gateway/protocol.md b/docs/gateway/protocol.md index b2db787e77..fb51f772fc 100644 --- a/docs/gateway/protocol.md +++ b/docs/gateway/protocol.md @@ -317,8 +317,10 @@ Gateway exposes today. - chat execution still uses `chat.history`, `chat.send`, `chat.abort`, and `chat.inject`. - `chat.history` is display-normalized for UI clients: inline directive tags are - stripped from visible text, pure `NO_REPLY` assistant rows are omitted, and - oversized rows can be replaced with placeholders. + stripped from visible text, leaked reasoning / relevant-memories scaffolding, + leaked XML tool-call blocks, and leaked provider control tokens are also + stripped from visible assistant text, pure `NO_REPLY` assistant rows are + omitted, and oversized rows can be replaced with placeholders. #### Device pairing and device tokens diff --git a/docs/platforms/android.md b/docs/platforms/android.md index 519c39354a..e8a26a2299 100644 --- a/docs/platforms/android.md +++ b/docs/platforms/android.md @@ -138,8 +138,10 @@ Pairing details: [Pairing](/channels/pairing). The Android Chat tab supports session selection (default `main`, plus other existing sessions): - History: `chat.history` (display-normalized; inline directive tags are - stripped from visible text, pure `NO_REPLY` assistant rows are omitted, and - oversized rows can be replaced with placeholders) + stripped from visible text; leaked reasoning / relevant-memories + scaffolding, leaked XML tool-call blocks, and leaked provider control tokens + are also stripped from visible assistant text; pure `NO_REPLY` assistant rows + are omitted; oversized rows can be replaced with placeholders) - Send: `chat.send` - Push updates (best-effort): `chat.subscribe` → `event:"chat"` diff --git a/docs/platforms/mac/webchat.md b/docs/platforms/mac/webchat.md index 468fd887dd..8aed072a0e 100644 --- a/docs/platforms/mac/webchat.md +++ b/docs/platforms/mac/webchat.md @@ -31,8 +31,11 @@ agent (with a session switcher for other sessions). - Data plane: Gateway WS methods `chat.history`, `chat.send`, `chat.abort`, `chat.inject` and events `chat`, `agent`, `presence`, `tick`, `health`. - `chat.history` returns display-normalized transcript rows: inline directive - tags are stripped from visible text, pure `NO_REPLY` assistant rows are - omitted, and oversized rows can be replaced with placeholders. + tags are stripped from visible text; leaked reasoning / + relevant-memories scaffolding, leaked XML tool-call blocks, and leaked + provider control tokens are also stripped from visible assistant text; pure + `NO_REPLY` assistant rows are omitted; oversized rows can be replaced with + placeholders. - Session: defaults to the primary session (`main`, or `global` when scope is global). The UI can switch between sessions. - Onboarding uses a dedicated session to keep first‑run setup separate. diff --git a/docs/web/control-ui.md b/docs/web/control-ui.md index 0cfa7ce61f..5a4f847007 100644 --- a/docs/web/control-ui.md +++ b/docs/web/control-ui.md @@ -116,7 +116,12 @@ Cron jobs panel notes: - `chat.send` is **non-blocking**: it acks immediately with `{ runId, status: "started" }` and the response streams via `chat` events. - Re-sending with the same `idempotencyKey` returns `{ status: "in_flight" }` while running, and `{ status: "ok" }` after completion. - `chat.history` responses are size-bounded for UI safety. When transcript entries are too large, Gateway may truncate long text fields, omit heavy metadata blocks, and replace oversized messages with a placeholder (`[chat.history omitted: message too large]`). -- `chat.history` also strips display-only inline directive tags from visible assistant text (for example `[[reply_to_*]]` and `[[audio_as_voice]]`) and omits assistant entries whose whole visible text is only `NO_REPLY`. +- `chat.history` also strips visible-text scaffolding from assistant output before rendering: + - inline directive tags such as `[[reply_to_*]]` and `[[audio_as_voice]]` + - leaked reasoning / relevant-memories blocks + - leaked XML tool-call scaffolding such as `` / `` + - leaked provider control tokens such as `<|assistant|>` and similar `<|...|>` / `<|...|>` markers + - assistant entries whose whole visible text is only `NO_REPLY` are omitted - `chat.inject` appends an assistant note to the session transcript and broadcasts a `chat` event for UI-only updates (no agent run, no channel delivery). - The chat header model and thinking pickers patch the active session immediately through `sessions.patch`; they are persistent session overrides, not one-turn-only send options. - Stop: diff --git a/docs/web/webchat.md b/docs/web/webchat.md index af0be1347a..0e86a94167 100644 --- a/docs/web/webchat.md +++ b/docs/web/webchat.md @@ -26,7 +26,7 @@ Status: the macOS/iOS SwiftUI chat UI talks directly to the Gateway WebSocket. - The UI connects to the Gateway WebSocket and uses `chat.history`, `chat.send`, and `chat.inject`. - `chat.history` is bounded for stability: Gateway may truncate long text fields, omit heavy metadata, and replace oversized entries with `[chat.history omitted: message too large]`. -- `chat.history` is also display-normalized: inline delivery directive tags such as `[[reply_to_*]]` and `[[audio_as_voice]]` are stripped from visible text, and assistant entries whose whole visible text is only `NO_REPLY` are omitted. +- `chat.history` is also display-normalized: inline delivery directive tags such as `[[reply_to_*]]` and `[[audio_as_voice]]`, leaked reasoning / relevant-memories scaffolding, leaked XML tool-call blocks, and leaked provider control tokens such as `<|assistant|>` are stripped from visible assistant text, and assistant entries whose whole visible text is only `NO_REPLY` are omitted. - `chat.inject` appends an assistant note directly to the transcript and broadcasts it to the UI (no agent run). - Aborted runs can keep partial assistant output visible in the UI. - Gateway persists aborted partial assistant text into transcript history when buffered output exists, and marks those entries with abort metadata.