From adfdde5cb326e1da9842c0b7d3cd5f4ca76f0728 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 4 Apr 2026 21:53:25 +0100 Subject: [PATCH] docs: refresh chat history sanitization mirrors --- docs/concepts/delegate-architecture.md | 7 ++++--- docs/gateway/protocol.md | 6 ++++-- docs/platforms/android.md | 8 ++++---- docs/platforms/mac/webchat.md | 5 +++-- docs/web/webchat.md | 7 ++++++- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/concepts/delegate-architecture.md b/docs/concepts/delegate-architecture.md index 7d1563e3d5a..14fd006c82c 100644 --- a/docs/concepts/delegate-architecture.md +++ b/docs/concepts/delegate-architecture.md @@ -285,10 +285,11 @@ The delegate's `AGENTS.md` defines its autonomous authority — what it may do w If you grant `sessions_history`, remember it is a bounded, safety-filtered recall view. OpenClaw redacts credential/token-like text, truncates long content, strips thinking tags / `` scaffolding / plain-text -tool-call XML payloads / downgraded tool-call scaffolding / leaked model +tool-call XML payloads (including `` and truncated tool-call +blocks) / downgraded tool-call scaffolding / leaked ASCII/full-width model control tokens / malformed MiniMax tool-call XML from assistant recall, and -can replace oversized rows with `[sessions_history omitted: message too large]` -instead of returning a raw transcript dump. +can replace oversized rows with `[sessions_history omitted: message too +large]` instead of returning a raw transcript dump. ## Scaling pattern diff --git a/docs/gateway/protocol.md b/docs/gateway/protocol.md index 204570c9480..8bb98dd989a 100644 --- a/docs/gateway/protocol.md +++ b/docs/gateway/protocol.md @@ -348,8 +348,10 @@ implemented in `src/gateway/server-methods/*.ts`. - 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, plain-text tool-call XML payloads (including + `` and truncated tool-call blocks) and leaked ASCII/full-width + model control tokens are stripped, 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 4b5cf996eb3..84ebbef9971 100644 --- a/docs/platforms/android.md +++ b/docs/platforms/android.md @@ -138,10 +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, plain-text tool-call XML payloads and leaked - ASCII/full-width model control tokens are stripped, pure `NO_REPLY` - assistant rows are omitted, and oversized rows can be replaced with - placeholders) + stripped from visible text, plain-text tool-call XML payloads (including + `` and truncated tool-call blocks) and leaked ASCII/full-width + model control tokens are stripped, pure `NO_REPLY` assistant rows are + omitted, and 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 03fb2c33232..ffb8dcc0a74 100644 --- a/docs/platforms/mac/webchat.md +++ b/docs/platforms/mac/webchat.md @@ -31,8 +31,9 @@ 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, plain-text tool-call XML payloads and - leaked ASCII/full-width model control tokens are stripped, pure `NO_REPLY` + tags are stripped from visible text, plain-text tool-call XML payloads + (including `` and truncated tool-call blocks) and leaked + ASCII/full-width model control tokens are stripped, pure `NO_REPLY` assistant rows are omitted, and oversized rows can be replaced with placeholders. - Session: defaults to the primary session (`main`, or `global` when scope is diff --git a/docs/web/webchat.md b/docs/web/webchat.md index 899dab5368a..15c2c831f12 100644 --- a/docs/web/webchat.md +++ b/docs/web/webchat.md @@ -26,7 +26,12 @@ 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]]`, plain-text tool-call XML payloads (including `` and truncated tool-call blocks), and leaked ASCII/full-width model control tokens 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]]`, plain-text tool-call XML + payloads (including `` and truncated tool-call blocks), and + leaked ASCII/full-width model control tokens are stripped from visible 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.