Repository navigation
fix(talk): allow fresh consultations after cancellation - #199538
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: needs maintainer review before merge. What this changesThis PR retains generated Talk consultation inputs in model history while keeping them hidden from chat and updating reconnect expectations and documentation. Example: Cancel a native Talk consultation, then request “Start a fresh small task.” with OPENCLAW_PROMPT_CACHE_ASSERT=1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it makes a focused producer repair for a verified history-contract conflict, and source review found no actionable introduced bug; it remains a draft with validation pending. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway Talk adapter turns provider delegations into backing-agent runs, records their hidden inputs in session transcripts, and supplies model history and bounded reconnect background. flowchart LR
A[Native Talk delegation] --> B[Gateway consult runner]
B --> C[Client agent runtime]
C --> D[Session transcript]
D --> E[Model history]
E --> F[Backing agent request]
D --> G[Hidden chat projection]
D --> H[Bounded reconnect background]
Technical reviewBest possible solution: Retain dispatched input through the existing transcript owner while preserving hidden presentation, cancellation, and legacy exclusions. Do we have a high-confidence way to reproduce the issue? The exclusion reader, prefix observer, and existing post-cancel completion assertions establish the reported path, corroborated by #198523; this read-only review ran no target code. Is this the best way to solve the issue? Removing the producer's exclusion flag is the smallest repair for this prefix loss, with corresponding visibility and reconnect assertions; the broader speech-ordering work in #179237 remains distinct. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cc5efb671308. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -1, Tests +7, Docs +2. Total +8 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel 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 Reviewed November 15, 2026, 4:31 AM ET / 09:31 UTC. |
|
Merged via squash.
|
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]>
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]>
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)
What Problem This Solves
Fixes fresh native Talk consultations returning a no-answer fallback after a canceled consultation.
User Impact
A new request can complete after cancellation. Generated consult inputs remain hidden from the transcript UI, and cancellation, authority checks, and spoken-only broadcasts remain unchanged.
Why This Change Was Made
The native adapter excluded an already-dispatched consult input from subsequent model history. The next request therefore violated the append-only prefix contract before model dispatch. Retain the hidden input in model history, update the bounded reconnect expectations, and document the distinction between model history and visible speech. The prefix guard is unchanged.
Evidence
92da58f2d196f2056ab62e695369104061e916f0, 123 cases passed across seven focused consumer, runtime-scope, append-only carrier, orphan/replay, and prefix-guard files in 117.05 seconds. These inputs are unchanged at current headc26a74f7a630da77290a468945c0f12036cd51c5.checks-node-changed-compact-small-2): the complete history file passed 22/22 on Linux/Bun, zero failures/skips, 67.55 seconds. Both repaired cases and all three Linux-only cases passed.5025db61e9482d95f29956f266496f32f4f94f72..92da58f2d196f2056ab62e695369104061e916f0found no actionable correctness or security findings. The subsequent delta is the two consumer expectation updates described above, with no production change.