Skip to content

fix(gateway): preserve literal Talk consult questions - #134093

Merged
steipete merged 14 commits into
openclaw:mainfrom
lsr911:fix/issue-133855-Bug-Browser-Talk-agent-cons
Aug 31, 2026
Merged

steipete merged 14 commits into
openclaw:mainfrom
lsr911:fix/issue-133855-Bug-Browser-Talk-agent-cons

Conversation

@lsr911

@lsr911 lsr911 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #133855. Browser Talk display/provenance is already handled by #133947; this PR addresses the separate interpretation of generated consult input.

What Problem This Solves

Fixes an issue where a Browser Talk consult could silently do no work—or cancel an existing task—when the voice provider generated a question consisting of /stop or stop. The tool call returned a consult run ID even though its question never reached the model.

Why This Change Was Made

The Talk bridge forwarded generated question text into normal chat command processing. It now sets the existing suppressCommandInterpretation field on that generated request, preserving the canonical trusted dispatcher, hidden transcript metadata and caller tool restrictions. This is one production line; it adds no helper, prompt prefix, configuration or protocol field.

Thanks to @lsr911 for identifying and proposing suppression of command interpretation for generated Talk input.

User Impact

Generated consult questions reach the agent as literal text and do not cancel a running task merely because they resemble a command. Actual human /stop commands retain their cancellation behavior, and the dedicated Talk cancellation owner is unchanged. Existing Browser Talk history visibility and provenance remain unchanged.

Evidence

The existing Gateway fixture exercises the actual Talk RPC handler, trusted chat dispatch, command processing, admission and SQLite recorder; only model execution is synthetic and held/released. The regression failed before the repair:

Generated "/stop": Talk returned acknowledgedRun, modelPrompts was []
Generated "stop":  Talk returned acknowledgedRun, modelPrompts was []
Generated "/stop" during a held consult:
  generated input cancelled the existing task: expected true to be false
  expected [ Array(1) ] to include '/stop'
Actual human /stop: passed

After the repair, all six Gateway cases passed: both literal stop spellings reached model input; the existing consult remained active and the generated question was dispatched after release; human Stop still aborted the active model; both owner and read-only Talk history-custody cases stayed green. The parser/user-turn and existing shared-control suites passed another 55 tests, including explicit Talk cancellation.

Commands used with Node 24.20.0 and an isolated HOME/cache:

node scripts/run-vitest.mjs src/gateway/server.talk-consult-history.test.ts
node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-request.test.ts src/gateway/server-methods/chat-send-user-turn.test.ts src/talk/agent-run-control.test.ts
node scripts/check-changed.mjs --base a226416b01a2960478176952d7a953bac9083555 -- src/gateway/talk-agent-consult.ts src/gateway/server.talk-consult-history.test.ts

Full changed-file checks passed, including production/test types, scoped lint, formatting, dead exports and architecture guards. Fresh independent P0–P2 review was clean. All test/check/review processes drained; no dependency, schema, config or operator-state changes were made.

This is command-routing proof with a synthetic model, not microphone, audio or live-provider proof. There is no visual UI change, so before/after images are inapplicable; #133947 owns the separate real-Chrome display proof.

Release note: treat generated Browser Talk agent questions as literal input, preserving active tasks and human Stop controls. Thanks @lsr911.

Production +1/-0; tests +63/-0. The single line opts the generated-input producer into the existing literal-input contract; no alternative helper or parser policy is added. The behavior predates the display repair and is present in stable v2026.8.1; exact original introduction is unknown.

Actual Gateway before/after console output

The baseline includes three intended failures and one excluded dedicated-cancel fixture failure. That extra case could not exercise registry cancellation through the shared model mock and was removed; explicit cancellation is covered by its unchanged owner suite. No product check was weakened.

BEFORE: includes three intended failures and one excluded test-fixture failure

[test] starting test/vitest/vitest.gateway.config.ts

 RUN  v4.1.11 <repo>

[vitest-workers] prepared ee563443878c in 4748ms (7252 inputs, 2696 outputs)
 ×  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "/stop" as literal model input 1124ms
   → expected { …(2) } to match object { …(2) }
 ×  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "stop" as literal model input 17ms
   → expected { …(2) } to match object { …(2) }
 ×  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > does not turn a generated stop question into cancellation of the active consult 631ms
   → generated input cancelled the existing task: expected true to be false // Object.is equality
   → expected [ Array(1) ] to include '/stop'
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > preserves an actual human stop command 128ms
 ×  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > preserves explicit Talk cancellation of its active model 100ms
   → expected { ok: false, mode: 'cancel', …(9) } to match object { ok: true, mode: 'cancel', …(2) }
(7 matching properties omitted from actual)
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk consult input custody > keeps 'owner' consult scaffolding out of live, reloaded, and exported chat 163ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk consult input custody > keeps 'read-only Talk operator' consult scaffolding out of live, reloaded, and exported chat 132ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯

 FAIL   gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "/stop" as literal model input
AssertionError: expected { …(2) } to match object { …(2) }

- Expected
+ Received

  {
    "acknowledgedRun": "talk-literal-command-4e5c9d92-9706-49f5-8478-b93dd425164f",
-   "modelPrompts": [
-     "/stop",
-   ],
+   "modelPrompts": [],
  }

 ❯ ../../src/gateway/server.talk-consult-history.test.ts:279:8
    277|       acknowledgedRun: ack.runId,
    278|       modelPrompts: runEmbeddedAgent.mock.calls.map(([run]) => run.pro…
    279|     }).toMatchObject({ acknowledgedRun: ack.runId, modelPrompts: [ques…
       |        ^
    280|   });
    281|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯

 FAIL   gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "stop" as literal model input
AssertionError: expected { …(2) } to match object { …(2) }

- Expected
+ Received

  {
    "acknowledgedRun": "talk-literal-command-a34c39f8-50b9-4ada-b6e3-77c4dac15a2c",
-   "modelPrompts": [
-     "stop",
-   ],
+   "modelPrompts": [],
  }

 ❯ ../../src/gateway/server.talk-consult-history.test.ts:279:8
    277|       acknowledgedRun: ack.runId,
    278|       modelPrompts: runEmbeddedAgent.mock.calls.map(([run]) => run.pro…
    279|     }).toMatchObject({ acknowledgedRun: ack.runId, modelPrompts: [ques…
       |        ^
    280|   });
    281|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯

 FAIL   gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > does not turn a generated stop question into cancellation of the active consult
AssertionError: generated input cancelled the existing task: expected true to be false // Object.is equality

- Expected
+ Received

- false
+ true

 ❯ ../../src/gateway/server.talk-consult-history.test.ts:288:8
    286|     expect
    287|       .soft(first.abortSignal.aborted, "generated input cancelled the …
    288|       .toBe(false);
       |        ^
    289|     releaseModel.resolve();
    290|     await waitForDispatchEnd();

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯

 FAIL   gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > does not turn a generated stop question into cancellation of the active consult
AssertionError: expected [ Array(1) ] to include '/stop'
 ❯ ../../src/gateway/server.talk-consult-history.test.ts:291:68
    289|     releaseModel.resolve();
    290|     await waitForDispatchEnd();
    291|     expect(runEmbeddedAgent.mock.calls.map(([run]) => run.prompt)).toC…
       |                                                                    ^
    292|   });
    293|

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/5]⎯

 FAIL   gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > preserves explicit Talk cancellation of its active model
AssertionError: expected { ok: false, mode: 'cancel', …(9) } to match object { ok: true, mode: 'cancel', …(2) }
(7 matching properties omitted from actual)

- Expected
+ Received

  {
-   "aborted": true,
+   "aborted": false,
    "active": true,
    "mode": "cancel",
-   "ok": true,
+   "ok": false,
  }

 ❯ ../../src/gateway/server.talk-consult-history.test.ts:328:23
    326|       actualRuns.setActiveEmbeddedRun(first.run.sessionId, handle, ses…
    327|       const stopped = await rpc("talk.client.steer", { sessionKey, tex…
    328|       expect(stopped).toMatchObject({ ok: true, mode: "cancel", active…
       |                       ^
    329|       expect(modelController.signal.aborted).toBe(true);
    330|       expect(runEmbeddedAgent).toHaveBeenCalledOnce();

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/5]⎯


 Test Files  1 failed (1)
      Tests  4 failed | 3 passed (7)
   Start at  06:25:20
   Duration  30.46s (transform 26.36s, setup 239ms, import 24.67s, tests 4.98s, environment 0ms)

[test] failed 1 Vitest shard in 34.23s
[test] FAILED (exit 1)
[vitest] FAILED (exit 1)
[test] FAILED (exit 1)


AFTER: final six-case Gateway fixture

[test] starting test/vitest/vitest.gateway.config.ts

 RUN  v4.1.11 <repo>

[vitest-workers] prepared 6ebcf2fbfec4 in 4339ms (7252 inputs, 2696 outputs)
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "/stop" as literal model input 842ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > dispatches generated "stop" as literal model input 73ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > does not turn a generated stop question into cancellation of the active consult 119ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk literal consult commands > preserves an actual human stop command 67ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk consult input custody > keeps 'owner' consult scaffolding out of live, reloaded, and exported chat 159ms
 ✓  gateway-server  ../../src/gateway/server.talk-consult-history.test.ts > Browser Talk consult input custody > keeps 'read-only Talk operator' consult scaffolding out of live, reloaded, and exported chat 130ms

 Test Files  1 passed (1)
      Tests  6 passed (6)
   Start at  06:28:14
   Duration  13.24s (transform 9.51s, setup 106ms, import 10.52s, tests 2.30s, environment 0ms)

[test] passed 1 Vitest shard in 16.33s

Review disposition for the original head: the privileged/read-only display split and duplicate helper were superseded by the canonical #133947 repair, now included in this branch's base. This PR retains the contributor's independently useful literal-input fix and real admission regressions. Raw archive retention and future model-context semantics are explicitly not changed; that broader #133855 follow-up is not closed here. Browser Markdown export uses the display projection already verified by #133947; raw HTML export is a separate contract. Original mocked-dispatch proof is replaced by real Gateway dispatch/admission/recorder coverage above.

Proof source binding: repaired tree committed as 98ea1ad7f2e8107194331b88808ed3b855f65a5b; original contributor ancestry retained at published head 712b002c60343fc323e7e508ecd6d6ca6481b10d without changing tested source bytes. Production SHA-256 d4dfae4bd36f34a0c6a432c29140ac25035f76549757f214e72a9b723c29f48d; Gateway test SHA-256 e95bdaec7b119430edce97ca38aa26a0a6792d909780e60aa21b2a0e9d19e88c.

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes openclaw#133855
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 31, 2026, 8:32 AM ET / 12:32 UTC.

ClawSweeper review

What this changes

The PR routes Browser Talk consultations through trusted internal Gateway dispatch and adds a hidden-display option intended to keep generated consultation prompts out of user chat history.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 8 items remain

The PR addresses the right Gateway boundary but still leaves the central leak on privileged Talk sessions and does not exclude the synthetic turn from later model context or session exports.

Priority: P1
Reviewed head: 351a89d02bd39227b64b3a4dd94490e04231e34c

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch has a clear target but misses both a privileged runtime branch and the durable session-state requirements.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The changed production owner is the Browser Talk-to-Gateway turn recorder path, but the supplied test replaces both dispatchers before admission and persistence; no real Browser Talk/Gateway after-fix trace shows the resulting history, export, or later-context behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The changed production owner is the Browser Talk-to-Gateway turn recorder path, but the supplied test replaces both dispatchers before admission and persistence; no real Browser Talk/Gateway after-fix trace shows the resulting history, export, or later-context behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Privileged branch remains visible: Admin and write scopes resolve without toolsAllow, so the introduced ternary selects the ordinary trusted helper; that helper does not set hideFromDisplay, while the recorder only sets display false when that option is present.
Hidden display is not context exclusion: The changed recorder writes only display: false. User messages remain meaningful conversation for compaction, and replay excludes only excludeFromContext: true.
Exports still render hidden user rows: The session export loads all transcript entries and its HTML renderer outputs every role:user message without checking display.
Findings 2 actionable findings [P1] Hide the privileged Talk consult branch
[P1] Exclude synthetic consults from export and later context
Security None None.

How this fits together

Browser Talk forwards a realtime consultation to the Gateway, which admits a chat run and persists its input as a session turn. The persisted transcript feeds the Control UI, session export, compaction, and later model context.

flowchart LR
  A[Browser Talk consult] --> B[Scope-based authority]
  B --> C[Trusted Gateway dispatch]
  C --> D[Turn recorder]
  D --> E[Chat history and exports]
  D --> F[Future model context]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The changed production owner is the Browser Talk-to-Gateway turn recorder path, but the supplied test replaces both dispatchers before admission and persistence; no real Browser Talk/Gateway after-fix trace shows the resulting history, export, or later-context behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Hide the privileged Talk consult branch (P1) - operator.admin and operator.write resolve without toolsAllow, so this introduced branch calls handleTrustedInternalChatSend, which never supplies hideFromDisplay. The recorder therefore persists the same visible user turn on the normal privileged Browser Talk path; the mocked admin test does not exercise this boundary.
  • Exclude synthetic consults from export and later context (P1) - display: false only affects display projection. The recorder still creates a durable role: "user" record; compaction and session replay exclude only excludeFromContext, while session export renders all user messages. Keep the prompt available to the active consult, but persist it with explicit non-replay and non-export semantics instead of treating it as a hidden user turn.
  • Resolve merge risk (P1) - No real Browser Talk/Gateway after-fix evidence has been supplied; the current proof is dispatcher-mocked and cannot establish persisted, exported, or replayed behavior.
  • Resolve merge risk (P1) - The bug-fix diff adds 39 net production lines while its two required persistence invariants remain incomplete.
  • Improve patch quality - Repair both scope branches through a single Talk internal-turn boundary.
  • Improve patch quality - Add an owner-boundary regression that verifies the active consult receives its prompt while history, export, compaction, and later context do not retain a user-authored synthetic turn.
  • Improve patch quality - Add a redacted real Browser Talk/Gateway after-fix trace; updating the PR body should trigger re-review, or a maintainer can request @clawsweeper re-review.

Findings

  • [P1] Hide the privileged Talk consult branch — src/gateway/talk-agent-consult.ts:170-173
  • [P1] Exclude synthetic consults from export and later context — src/gateway/server-methods/chat-user-turn-recorder.ts:47-49
Agent review details

Security

None.

PR surface

Source +39, Tests +126. Total +165 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 45 6 +39
Tests 2 126 0 +126
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 171 6 +165

Review metrics

Metric Value Why it matters
Production versus test delta production +39 net (45 added, 6 removed); tests +126 The new internal dispatch surface grows a bug fix, but its two intended persistence guarantees are not yet met.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #133855
Summary: This PR is the candidate fix for the linked Browser Talk synthetic-history bug, but it does not yet satisfy that issue's central persistence requirements.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Repair the complete internal-turn boundary (recommended)
    Make both Talk authority paths use the same hidden internal-turn semantics and add boundary coverage for display, export, and subsequent-context behavior.
  2. Pause this branch
    Do not merge while privileged sessions and durable context/export projections retain the synthetic user turn.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Repair both Talk authority branches and add persistence-boundary regression coverage; retain the current consult prompt while excluding its durable synthetic record from display, exports, compaction, and later context.

Technical review

Best possible solution:

Use one Talk-specific internal-turn contract for both authority modes that preserves the prompt for the active consult but prevents its durable record from being displayed, exported, compacted, or replayed as a user turn.

Do we have a high-confidence way to reproduce the issue?

Yes, by source: an operator.admin or operator.write Browser Talk consult takes the no-tools branch and records the synthetic prompt without display suppression. This read-only review did not execute the browser flow.

Is this the best way to solve the issue?

No. The patch fixes only the safe-read-only dispatch's display projection; it does not cover privileged callers or durable export/context semantics required by the reported behavior.

Full review comments:

  • [P1] Hide the privileged Talk consult branch — src/gateway/talk-agent-consult.ts:170-173
    operator.admin and operator.write resolve without toolsAllow, so this introduced branch calls handleTrustedInternalChatSend, which never supplies hideFromDisplay. The recorder therefore persists the same visible user turn on the normal privileged Browser Talk path; the mocked admin test does not exercise this boundary.
    Confidence: 0.99
  • [P1] Exclude synthetic consults from export and later context — src/gateway/server-methods/chat-user-turn-recorder.ts:47-49
    display: false only affects display projection. The recorder still creates a durable role: "user" record; compaction and session replay exclude only excludeFromContext, while session export renders all user messages. Keep the prompt available to the active consult, but persist it with explicit non-replay and non-export semantics instead of treating it as a hidden user turn.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a7be8e5ec6ff.

Labels

Label justifications:

  • P1: Browser Talk consultations can continue to create user-visible or model-visible synthetic session content on normal privileged sessions.
  • merge-risk: 🚨 session-state: The PR changes durable chat-turn visibility and persistence semantics, but still leaves synthetic consultation content in affected session projections.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The changed production owner is the Browser Talk-to-Gateway turn recorder path, but the supplied test replaces both dispatchers before admission and persistence; no real Browser Talk/Gateway after-fix trace shows the resulting history, export, or later-context behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/gateway/talk-agent-consult.test.ts.
  • [P1] node scripts/run-vitest.mjs src/gateway/server-methods/chat-send-request.test.ts.
  • [P1] node scripts/run-vitest.mjs src/agents/compaction-real-conversation.test.ts.
  • [P1] Capture a redacted Browser Talk/Gateway trace covering privileged and safe-read-only consultation persistence, reload/export, and a later model-context read.

What I checked:

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-31T12:19:30.536Z sha 351a89d :: needs real behavior proof before merge. :: [P1] Hide privileged Talk consult turns too
  • reviewed August 31, 2026, 8:32 AM ET / 12:32 UTC sha unknown :: needs real behavior proof before merge. :: [P1] Hide the privileged Talk consult branch | [P1] Exclude synthetic consults from export and later context

steipete and others added 3 commits August 31, 2026 05:21
## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes openclaw#134037

Co-authored-by: Ayaan Zaidi <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Aug 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 31, 2026
steipete and others added 9 commits August 31, 2026 05:38
…4033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions
…penclaw#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture
…hanges (openclaw#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model
…tory (openclaw#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes openclaw#133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>
…33912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture
…penclaw#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
…#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of openclaw#89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>
@steipete
steipete requested a review from a team as a code owner August 31, 2026 13:45
@steipete steipete self-assigned this Aug 31, 2026
@steipete steipete changed the title fix(gateway): keep Talk agent consult input out of user chat history fix(gateway): preserve literal Talk consult questions Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The display/provenance owner repair has landed in #133947. This PR now preserves the contributor's independent literal-input fix with three failure-first Gateway reproductions, human Stop and custody controls, 61 passing tests, full changed checks and an inspectable before/after trace in the body. The original contributor head remains an ancestor; no raw archive or later-context exclusion is claimed.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete
steipete merged commit 62de64b into openclaw:main Aug 31, 2026
263 of 265 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
* fix(gateway): keep Talk agent consult input out of user chat history

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes openclaw#133855

* ci: resolve OpenGrep base before fetching history (openclaw#134054)

* test(scripts): batch distribution import fixtures (openclaw#134039)

* fix(update): retain pnpm owner across launcher respawn

## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes openclaw#134037

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(parallel): check version header at request boundary (openclaw#133891)

* fix(matrix): drain monitor tasks before retiring clients (openclaw#134033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions

* fix(channels): isolate unavailable accounts from gateway diagnostics (openclaw#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture

* fix(config): preserve owners across legacy roster imports and store changes (openclaw#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model

* fix(talk): keep Browser Talk agent-consult turns out of user chat history (openclaw#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes openclaw#133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>

* fix: preserve policy owners across reviews and compaction (openclaw#133912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture

* fix(doctor): prune stale path install records shadowed by load paths (openclaw#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(secrets): collect persona-level TTS provider SecretRefs (openclaw#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of openclaw#89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>

* fix(gateway): preserve literal Talk consult questions

Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: Wynne668 <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: lsr911 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants