Repository navigation
fix(talk): retain chat-backed consult prompts in model history - #179237
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR retains hidden Talk consult inputs in model history and preserves spoken clarifications without shifting previously submitted conversation prefixes. Example: During a calendar consult, the user adds “Also tomorrow; the phrase is violet compass.”
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it addresses a current Talk prompt-prefix failure, but reversing the approved consult-retention contract requires an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherTalk producers record generated consult inputs and genuine speech through the session owners; the embedded runner projects those records into model requests, while Gateway previews supply background for voice connections. flowchart LR
A[Talk clients] --> B[Consult producers]
B --> C[Session transcript owner]
C --> D[Embedded replay boundary]
D --> E[Model provider]
C --> F[Gateway history previews]
F --> A
Technical reviewBest possible solution: Approve scoped retention of newly tagged consult inputs while preserving hidden presentation, genuine speech, legacy exclusions, and current authorization gates. Do we have a high-confidence way to reproduce the issue? Current-main producer and projection code establish the missing-prefix mechanism, supported by the contributor’s inspected failure-first receipts; this read-only review did not execute target code. Is this the best way to solve the issue? The implementation repairs both consult producers through existing transcript and replay owners, and each production hunk serves retention, ordering, or hidden presentation; its suitability depends on approving the changed retention policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7a1d72c44102. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +100, Tests +393, Docs +2. Total +495 across 13 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 23, 2026, 6:13 AM ET / 10:13 UTC (Revision 4). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Added redacted runtime evidence and updated the PR description for The report covers:
The deployment was a compiled-code port onto an existing patched 2026.10.10-beta.2 image, not a full source build of this head or latest-stable upgrade. The manual reconnect missed the pre-first-response window and is explicitly inconclusive. No exact provider-wire prefix or exact upstream-base failing run is claimed. Pending reconnect/producer proof, pre-upgrade latest-stable compatibility, and the maintainer retention decision remain open. The report separates these gaps from the positive results. Evidence is archived on a separate fork branch; the PR head remains |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Retire only the reused session's diagnostic baseline after test-state work and cleanup settle. Keep transport cleanup with its existing owners. Wait for the post-cancel delegation result before asserting its content so failure replies expose the unchanged success assertion without hanging. The named file still has four post-cancel history failures overlapping #179237; all five original cross-fixture readiness failures are gone. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
Retire only the reused session's diagnostic baseline after test-state work and cleanup settle. Keep transport cleanup with its existing owners. Wait for the post-cancel delegation result before asserting its content so failure replies expose the unchanged success assertion without hanging. The named file still has four post-cancel history failures overlapping openclaw#179237; all five original cross-fixture readiness failures are gone. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
|
Hi @steipete, a short update in case it helps with the decision. Since #198100 turned on the prompt-cache assertion in tests (13 Nov), the four cancellation variants in This PR removes that exclusion, so it should turn those tests green. It still merges cleanly with |
openclaw#199538 stopped excluding the generated consult input on native Talk consultations so later requests keep the already-dispatched prefix. The chat-backed route (client tool-call consults, used by browser providers such as Google Live and by app relay sessions) still records the same hidden prompt with excludeFromContext, so every later consult in that session rewrites history at the earlier prompt and misses the prompt cache. Apply the same contract there: hide from chat, keep in model history. Update the openclaw#133855 regression test and the docs to match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bbb9caa to
d7bb663
Compare
|
Thanks @vincentkoc for #199538, which settled the retention question for native consults. I've rebuilt this PR on current |
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
@vincentkoc follow-up to #199538: this is the same contract on the remaining chat-backed route ( |
|
Gateway proof on the exact head Setup: Gateway built from source ( Controls, run in the same containers:
Gateway-relay route ( Review note: the local review found no problems with the change and asked who owns the retention decision. #199538 already made that decision for these same generated records ("hide from chat, keep in model history"). This PR applies it to the last route that still drops them. Stored rows are not rewritten. |
|
Merged in 4c45bb4. Thanks @khensthoth for the fix and the live measurements. Chat-backed Talk consultations (browser providers and app relay) now keep their hidden consult prompt in model history, the same rule native Talk follows since #199538, so later voice questions and typed turns extend the cached prefix instead of rewriting history at the earlier consult. The prompts stay hidden in chat, and raw archives and existing records are unchanged. |
Root cause: src/gateway/talk/handlers/client.ts:475 (origin/main b402f04, unchanged since merge base 2c4413a) records the generated consult prompt of talk.client.toolCall with transcript { display: false, excludeFromContext: true }. The prompt is sent to the model in its own turn, then dropped from every later request, so each later consult/typed turn rewrites history at that prompt and the provider cache misses from there. #199538 (81ca4f4) already removed the same flag for native consults (client-agent-runtime.ts); the PR drops it on the chat-backed route and keeps display:false. Closes #179236 ## What Problem This Solves #199538 made native Talk consultations retain their hidden generated consult input in model history, so later requests keep the already-dispatched prefix. The chat-backed consult route (`talk.client.toolCall` in `src/gateway/talk/handlers/client.ts`, used by browser providers such as Google Live and by app relay sessions) still records the same hidden prompt with `excludeFromContext: true`. Every later consult in that session therefore rewrites history at the earlier prompt and misses the prompt cache from that point on. ## User Impact Later voice questions on browser/relay Talk keep the cached conversation prefix, the same as native Talk after #199538. The generated prompt stays hidden from chat, exactly as before. ## Why This Change Was Made This applies the contract #199538 already adopted for native consults to the remaining route: hide from chat, retain in model history. - `client.ts`: drop `excludeFromContext` from the chat-backed consult transcript options. - `index.test.ts`: expect the new transcript options. - `server.talk-consult-history.test.ts` (the #133855 regression test): the generated input stays out of chat history and Markdown, carries no exclusion flag, and appears exactly once in reopened model context, mirroring the assertion #199538 added for the direct-call case. - Docs: one sentence now covers both native and chat-backed consults. Existing stored records are not rewritten. ## History This PR was originally a larger change (retention plus speech ordering and preview filtering) waiting on the retention decision. #199538 settled that decision for native consults, so the branch is now rebuilt on current `main` with only the remaining route. The earlier version is kept on `khensthoth:fix/talk-consult-prompt-cache-v1-backup`. Live observations from the original version (22 Oct) showed 96–98% cached input on follow-up Gemini Talk consults with this route fixed. ## Evidence Upstream CI on this head is waiting for workflow approval. Run on `d7bb6636` in a clean `node:24-bookworm` container (Linux, Node 24.22, `CI=true`, prompt-cache assertion on): - `oxfmt --check` and `oxlint` on the changed files: clean. - `index.test.ts`, `client-native-actions.test.ts`, `client-native-control.test.ts`: 113/113 passed. - `relay-consult-adoption.regression.test.ts`: 9/9 passed. - `server.talk-consult-history.test.ts`: 20/22. The two failures (`keeps host-authenticated node approval cancellation`, public callback false/true) fail identically on unmodified `main` at `2c4413a6` in the same container (`SYSTEM_RUN_DENIED: approval cannot safely bind this interpreter/runtime command`), so they come from that environment, not this change. In one earlier full-file run `isolates registered Talk replay across authenticated callers` hit its 10 s `agent.wait` timeout; it passed on rerun, alone and in the full file, with the assertion on and off. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Keith <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4c45bb4) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…law#179237) Root cause: src/gateway/talk/handlers/client.ts:475 (origin/main 01b8aea, unchanged since merge base 5409be4) records the generated consult prompt of talk.client.toolCall with transcript { display: false, excludeFromContext: true }. The prompt is sent to the model in its own turn, then dropped from every later request, so each later consult/typed turn rewrites history at that prompt and the provider cache misses from there. openclaw#199538 (2768b27) already removed the same flag for native consults (client-agent-runtime.ts); the PR drops it on the chat-backed route and keeps display:false. Closes openclaw#179236 ## What Problem This Solves openclaw#199538 made native Talk consultations retain their hidden generated consult input in model history, so later requests keep the already-dispatched prefix. The chat-backed consult route (`talk.client.toolCall` in `src/gateway/talk/handlers/client.ts`, used by browser providers such as Google Live and by app relay sessions) still records the same hidden prompt with `excludeFromContext: true`. Every later consult in that session therefore rewrites history at the earlier prompt and misses the prompt cache from that point on. ## User Impact Later voice questions on browser/relay Talk keep the cached conversation prefix, the same as native Talk after openclaw#199538. The generated prompt stays hidden from chat, exactly as before. ## Why This Change Was Made This applies the contract openclaw#199538 already adopted for native consults to the remaining route: hide from chat, retain in model history. - `client.ts`: drop `excludeFromContext` from the chat-backed consult transcript options. - `index.test.ts`: expect the new transcript options. - `server.talk-consult-history.test.ts` (the openclaw#133855 regression test): the generated input stays out of chat history and Markdown, carries no exclusion flag, and appears exactly once in reopened model context, mirroring the assertion openclaw#199538 added for the direct-call case. - Docs: one sentence now covers both native and chat-backed consults. Existing stored records are not rewritten. ## History This PR was originally a larger change (retention plus speech ordering and preview filtering) waiting on the retention decision. openclaw#199538 settled that decision for native consults, so the branch is now rebuilt on current `main` with only the remaining route. The earlier version is kept on `khensthoth:fix/talk-consult-prompt-cache-v1-backup`. Live observations from the original version (22 Oct) showed 96–98% cached input on follow-up Gemini Talk consults with this route fixed. ## Evidence Upstream CI on this head is waiting for workflow approval. Run on `d7bb6636` in a clean `node:24-bookworm` container (Linux, Node 24.22, `CI=true`, prompt-cache assertion on): - `oxfmt --check` and `oxlint` on the changed files: clean. - `index.test.ts`, `client-native-actions.test.ts`, `client-native-control.test.ts`: 113/113 passed. - `relay-consult-adoption.regression.test.ts`: 9/9 passed. - `server.talk-consult-history.test.ts`: 20/22. The two failures (`keeps host-authenticated node approval cancellation`, public callback false/true) fail identically on unmodified `main` at `5409be48` in the same container (`SYSTEM_RUN_DENIED: approval cannot safely bind this interpreter/runtime command`), so they come from that environment, not this change. In one earlier full-file run `isolates registered Talk replay across authenticated callers` hit its 10 s `agent.wait` timeout; it passed on rerun, alone and in the full file, with the assertion on and off. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Keith <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for the thorough proof and the merge, and @vincentkoc for #199538. Much appreciated! |
Root cause: src/gateway/talk/handlers/client.ts:475 (origin/main b402f04, unchanged since merge base 2c4413a) records the generated consult prompt of talk.client.toolCall with transcript { display: false, excludeFromContext: true }. The prompt is sent to the model in its own turn, then dropped from every later request, so each later consult/typed turn rewrites history at that prompt and the provider cache misses from there. #199538 (81ca4f4) already removed the same flag for native consults (client-agent-runtime.ts); the PR drops it on the chat-backed route and keeps display:false. Closes #179236 ## What Problem This Solves #199538 made native Talk consultations retain their hidden generated consult input in model history, so later requests keep the already-dispatched prefix. The chat-backed consult route (`talk.client.toolCall` in `src/gateway/talk/handlers/client.ts`, used by browser providers such as Google Live and by app relay sessions) still records the same hidden prompt with `excludeFromContext: true`. Every later consult in that session therefore rewrites history at the earlier prompt and misses the prompt cache from that point on. ## User Impact Later voice questions on browser/relay Talk keep the cached conversation prefix, the same as native Talk after #199538. The generated prompt stays hidden from chat, exactly as before. ## Why This Change Was Made This applies the contract #199538 already adopted for native consults to the remaining route: hide from chat, retain in model history. - `client.ts`: drop `excludeFromContext` from the chat-backed consult transcript options. - `index.test.ts`: expect the new transcript options. - `server.talk-consult-history.test.ts` (the #133855 regression test): the generated input stays out of chat history and Markdown, carries no exclusion flag, and appears exactly once in reopened model context, mirroring the assertion #199538 added for the direct-call case. - Docs: one sentence now covers both native and chat-backed consults. Existing stored records are not rewritten. ## History This PR was originally a larger change (retention plus speech ordering and preview filtering) waiting on the retention decision. #199538 settled that decision for native consults, so the branch is now rebuilt on current `main` with only the remaining route. The earlier version is kept on `khensthoth:fix/talk-consult-prompt-cache-v1-backup`. Live observations from the original version (22 Oct) showed 96–98% cached input on follow-up Gemini Talk consults with this route fixed. ## Evidence Upstream CI on this head is waiting for workflow approval. Run on `d7bb6636` in a clean `node:24-bookworm` container (Linux, Node 24.22, `CI=true`, prompt-cache assertion on): - `oxfmt --check` and `oxlint` on the changed files: clean. - `index.test.ts`, `client-native-actions.test.ts`, `client-native-control.test.ts`: 113/113 passed. - `relay-consult-adoption.regression.test.ts`: 9/9 passed. - `server.talk-consult-history.test.ts`: 20/22. The two failures (`keeps host-authenticated node approval cancellation`, public callback false/true) fail identically on unmodified `main` at `2c4413a6` in the same container (`SYSTEM_RUN_DENIED: approval cannot safely bind this interpreter/runtime command`), so they come from that environment, not this change. In one earlier full-file run `isolates registered Talk replay across authenticated callers` hit its 10 s `agent.wait` timeout; it passed on rerun, alone and in the full file, with the assertion on and off. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Keith <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4c45bb4)
Root cause: src/gateway/talk/handlers/client.ts:475 (origin/main b402f04, unchanged since merge base 2c4413a) records the generated consult prompt of talk.client.toolCall with transcript { display: false, excludeFromContext: true }. The prompt is sent to the model in its own turn, then dropped from every later request, so each later consult/typed turn rewrites history at that prompt and the provider cache misses from there. #199538 (81ca4f4) already removed the same flag for native consults (client-agent-runtime.ts); the PR drops it on the chat-backed route and keeps display:false.
Closes #179236
What Problem This Solves
#199538 made native Talk consultations retain their hidden generated consult input in model history, so later requests keep the already-dispatched prefix. The chat-backed consult route (
talk.client.toolCallinsrc/gateway/talk/handlers/client.ts, used by browser providers such as Google Live and by app relay sessions) still records the same hidden prompt withexcludeFromContext: true. Every later consult in that session therefore rewrites history at the earlier prompt and misses the prompt cache from that point on.User Impact
Later voice questions on browser/relay Talk keep the cached conversation prefix, the same as native Talk after #199538. The generated prompt stays hidden from chat, exactly as before.
Why This Change Was Made
This applies the contract #199538 already adopted for native consults to the remaining route: hide from chat, retain in model history.
client.ts: dropexcludeFromContextfrom the chat-backed consult transcript options.index.test.ts: expect the new transcript options.server.talk-consult-history.test.ts(the [Bug]: Browser Talk agent-consult persists internal prompt as a user chat turn #133855 regression test): the generated input stays out of chat history and Markdown, carries no exclusion flag, and appears exactly once in reopened model context, mirroring the assertion fix(talk): allow fresh consultations after cancellation #199538 added for the direct-call case.Existing stored records are not rewritten.
History
This PR was originally a larger change (retention plus speech ordering and preview filtering) waiting on the retention decision. #199538 settled that decision for native consults, so the branch is now rebuilt on current
mainwith only the remaining route. The earlier version is kept onkhensthoth:fix/talk-consult-prompt-cache-v1-backup. Live observations from the original version (22 Oct) showed 96–98% cached input on follow-up Gemini Talk consults with this route fixed.Evidence
Upstream CI on this head is waiting for workflow approval. Run on
d7bb6636in a cleannode:24-bookwormcontainer (Linux, Node 24.22,CI=true, prompt-cache assertion on):oxfmt --checkandoxlinton the changed files: clean.index.test.ts,client-native-actions.test.ts,client-native-control.test.ts: 113/113 passed.relay-consult-adoption.regression.test.ts: 9/9 passed.server.talk-consult-history.test.ts: 20/22. The two failures (keeps host-authenticated node approval cancellation, public callback false/true) fail identically on unmodifiedmainat2c4413a6in the same container (SYSTEM_RUN_DENIED: approval cannot safely bind this interpreter/runtime command), so they come from that environment, not this change. In one earlier full-file runisolates registered Talk replay across authenticated callershit its 10 sagent.waittimeout; it passed on rerun, alone and in the full file, with the assertion on and off.🤖 Generated with Claude Code