Repository navigation
fix(talk): voice consults fail when the chat runs on Claude CLI or a locked native harness - #199379
Conversation
Gateway Talk consults (server realtime relay and direct browser consults) called the embedded runner directly, so a chat whose model runs on a CLI runtime such as claude-cli answered typed turns but failed voice consults with "No API key found for provider anthropic", and a chat locked to a native harness refused them as "Model selection is locked". The Gateway Talk adapter now hands its admitted turn to the typed-turn command owner, which selects Claude CLI, the native harness or embedded exactly as for a typed message, with the same owner, sender, operator and tool authority. The consult borrows the Gateway's published reply runtime, leased for the session's model, as a Gateway agent turn does. A configured consult thinking level is treated as a preference and falls back to a supported level, matching chat-backed Talk; without one the chat's own level applies. Plugin and channel voice bridges are unchanged. AI-assisted (Claude Opus 5.5 via OpenClaw).
|
🦞👀 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 changesRoutes Gateway Talk consultations through the chat’s command runtime while preserving caller permissions and spoken-result ownership. Example: A child chat inherits anthropic/claude-sonnet-5-5 configured with the claude-cli runtime.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current Talk runtime-routing bug, resolves the previous inherited-model finding, and has no identified blocking patch defect. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway Talk converts spoken requests into agent consultations; the adapter binds the caller and session, dispatches the agent turn, and returns eligible terminal text to the realtime voice provider. flowchart LR
A[Spoken request] --> B[Gateway Talk admission]
B --> C[Session model and runtime]
C --> D[Agent command owner]
D --> E[CLI native or embedded backend]
E --> F[Owned terminal result]
F --> G[Realtime speech]
Technical reviewBest possible solution: Use the existing command owner for Gateway voice turns while retaining plugin-bridge contracts and session-bound speech completion. Do we have a high-confidence way to reproduce the issue? Current main directly selects embedded execution for Talk consultations, establishing the reported CLI-routing failure path; supplied live reports corroborate it, and no target code was executed during this review. Is this the best way to solve the issue? The patch repairs the dispatch boundary using established runtime and controller owners, preserves native bindings and plugin behavior, and reuses compaction’s model-inheritance resolver. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1f630fc07d9e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +410, Tests +1309, Other 0. Total +1719 across 36 files. Added test files: 3. 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. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (10 earlier review cycles; latest 8 shown)
Reviewed November 25, 2026, 6:30 AM ET / 11:30 UTC (Revision 11). |
Preserve upstream consult-history prefix retention with command-owner dispatch.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
On OpenClaw 2026.11.6 with GPT‑Live and Codex subscription OAuth, voice delegation failed with |
Co-authored-by: Marvinthebored <[email protected]>
Worked on by: - @Marvinthebored Co-authored-by: Marvinthebored <[email protected]> OpenClaw-Publication: 908b8da4-bcae-4a40-9d65-44609374fb17
Worked on by: - @Marvinthebored Co-authored-by: Marvinthebored <[email protected]> OpenClaw-Publication: a37177ad-8e13-49cd-b271-f3e569737a5f
Worked on by: - @Marvinthebored Co-authored-by: Marvinthebored <[email protected]> OpenClaw-Publication: 324703f3-e9ee-481a-b1da-25e6ee7dd711
Worked on by: - @Marvinthebored Co-authored-by: Marvinthebored <[email protected]> OpenClaw-Publication: f89f0349-d7dc-42b7-994d-2b122a643508
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Worked on by: - @Marvinthebored Co-authored-by: Marvinthebored <[email protected]> OpenClaw-Publication: e3e67d1d-ecac-4642-b5d6-8217bf556519
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Co-authored-by: jacobtomlinson <[email protected]>
Co-authored-by: jacobtomlinson <[email protected]>
Closes #199378
What Problem This Solves
Fixes: Talk voice consults fail with
No API key found for provider anthropicwhen the chat's model runs on Claude CLI, orModel selection is lockedwhen the chat uses a locked native harness, although typed messages work.User Impact
User impact: Gateway voice consults use the same chat runtime, owner, sender, and tool permissions as typed messages, including Claude CLI and locked Codex. Plugin and channel voice bridges are unchanged.
Why This Change Was Made
Key tenets for review:
agentCommandFromGatewayIngress, not the embedded provider runner. Keep exact-source acquisition, controller-input custody, operator authority, operational-instance binding, and terminal-write draining. The command inherits the Talk claim; no second input is reserved.Deliberate behavior changes: revoked callers receive the typed-turn delivery-fence rejection rather than model text. Gateway voice consults receive ordinary command-owned model and usage bookkeeping.
Existing test fixtures now mock the command-owner seam, clear workspace attestations when deleting test workspaces, inspect the exec-session pin, and wait for actual backend/finalization boundaries. The test-line allocation covers real-Gateway regressions.
Evidence
Inherited session model —
7933c796f91fAddresses the review finding on the previous head. Before leasing a runtime, Talk now uses the same Gateway session-model lookup as compaction. It reads a parent selection when the child has no model of its own; a genuinely missing selection still returns the standard no-model error.
The Gateway regression seeds a parent-only Claude CLI model and no agent default, then checks the model and child session at CLI dispatch and the text returned by the consult. CI selected the regression suite and the CI gate passed. The regression uses a stand-in for the CLI process. The same test failed with “No model is configured” when the previous dispatch code was restored.
Previous review head —
ad8d7b5c999eUpdated the CLI steering fixture to match the backend contract, removed duplicated lease-test setup without raising the test-line allowance, and changed the mailbox test to wait for actual backend entry. Formatting, syntax and whitespace checks passed for the final fixture correction. CI for this head is in progress as of the review request; the live voice probes below are historical.
November 25 CI repair —
5f7f141e070cThe published dispatch now reports the standard no-model error before acquiring a model lease. A regression checks that the dispatch lease is released and the command does not start. Talk forwards the caller’s prepared owner flag unchanged and invokes the optional source check only when supplied. The real-command Talk fixtures now configure a chat model separately from their realtime voice provider; they still exercise the command and their original assertions.
All eight changed files passed formatting, syntax, and whitespace checks. Static Auto Review reported no P0 finding on the full candidate; it did not execute the tests. CI for this exact head is the behavioral and typecheck run. No new live speech probe is claimed.
Previous November 25 refresh —
92c41288094bIntegrated
mainat08a2c5513181. Both conflicts were in tests: the upstream runner fixture already checks that closing or replacing admission prevents dispatch, so the PR keeps that fixture unchanged. The database-worker test list keeps all upstream entries and adds the four Talk tests; all four exist and are registered exactly once.The published tree matches the inspected candidate. All 30 changed TypeScript/JavaScript files parsed;
git diff --checkpassed. Auto Review compared the full candidate with08a2c5513181and reported no P0 findings (static review, not a full-priority review). CI on this head failed. Production type checks found that dispatch dereferences a possibly absent session model and calls an optional source-authority callback unconditionally. The authority check rejects the Talk adapter derivingsenderIsOwneroutside admission. Talk terminal-write tests also fail before reaching their assertions because their fixture has no configured model. These failures on the previous head prompted the CI repair above. The earlier Claude CLI and locked Codex speech probes below were not rerun on this head.Historical candidate (November 19): routing fix only; thinking unchanged from main
Exact head 17db728: Build exited 0 in 3m20.7s. Both candidate-only saved-auth Talk probes exited 0 and verified real workspace tool results of five. Claude CLI finalized “There are five: AGENTS, BOOTSTRAP, IDENTITY, SOUL, and USER.” Locked native Codex finalized “There are five Markdown files at the top level.” Both saved nonempty PCM (1,560,946 and 1,635,826 bytes). In-memory diagnostic tracing showed one command-completion callback and successful completion claim per probe (current and completed), each followed by a speakable provider append. CLI deletion/archive and native lock-preserving archival were verified; supervisors self-unloaded. This is standard relay/API and saved-audio evidence, not a new yield, rendered UI, phone, or live-compaction proof.
Yielded CLI consultations (review P1): a yielded command settlement now completes through the existing command-owned claim, so a Claude CLI consult that calls
sessions_yieldcan settle its acknowledgment and retain late-result ownership. Exact spoken acknowledgment delivery remains unverified in the live yield probe below. Abort, error, terminal-receipt and current-owner fences are unchanged. RED reproduced on 000cbff with the real Gateway command controller, then GREEN. A real-command embedded-yield regression checks one acknowledgment, one claim and one late append, so there is no double delivery.Thinking: unchanged from main. Voice consults use
talk.consultThinkingLevel, elsehigh, for every runtime, exactly as on main. The command owner only normalizes that level to what the selected runtime supports. Earlier revisions of this PR changed this default; that is reverted (no owner decision is needed).Focused suite 111/111 passed on 8a0563d (the mock-only matrix was replaced by one bridge regression); scoped type-aware lint exit 0. Exact-head build passed, exit 0 in 3m51.5s.
Fresh 8a0563d saved-auth diagnostic live probes: Claude CLI executed a real workspace count/list returning 5 (AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md); finalized provider speech: “There are five Markdown files at the top level: AGENTS, BOOTSTRAP, IDENTITY, SOUL, and USER.” Locked native Codex / gpt-6.1-sol executed a real count returning 5; finalized speech: “There are five Markdown files at the top level of my workspace.” Both exit 0; PCM 1,671,346 / 1,731,826 bytes. CLI deletion/archive receipt and native supported archival/history were verified; native runtime/model locks remained set and no active run remained.
These two probes used in-memory diagnostic harness instrumentation, not an uninstrumented binary: each recorded command completion,
claimAppendwithcurrent=true, completed=true, and a speakable provider append. No tracked source or built files were edited. Saved Settings auth was used in place; no login, credential import, downgrade, production change, or deployment. Supervisors self-unloaded. The earlier b34992b standard CLI attempt remains inconclusive, not an established dropped-result regression.Separate historical b34992b yielded-CLI probe: real
sessions_spawnandsessions_yieldreturned yielded status with stored acknowledgment “CLI yield ack”; requester-final later reported five. Exact spoken acknowledgment delivery is not proven: “I hear you” preceded the yield. Speech initially said four before requester-final arrived, then corrected: “Correction: the child agent finished with five Markdown files.” The deleted child’s underlying tool output remains unverified. This is not exact-head yielded acceptance or proof of faithful initial speech. Raw transcripts, detailed traces, and audio remain private.Historical yielded CLI consult (8a0563d, diagnostic tracing): the acknowledgment reached the provider append exactly once (
providerAppend {"channel":"speakable","text":"yield ack"}, preceded byclaimAppend {"current":true,"completed":true}), and the late result reached it exactly once: "clean yield late result: the child counted 5 top-level markdown files … The exact child tool output, fromls -1 *.md; echo "---"; ls -1 *.md | wc -l, was: AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md, then a line of three dashes, then 5." There was no duplicate append. Limits: the realtime model spoke a guessed count before the late result arrived, then spoke the delivered result; the child ran with cleanup=delete, so its tool output is shown as relayed in the late result, not read from the deleted child's history.Data-model compatibility from latest stable 2026.11.5 (auth-free): a clean 2026.11.5 install was seeded, with no model calls, with a model-locked native Codex session (
modelSelectionLocked/runtimeSelectionLockedtrue), a chat withthinkingLevel: low, and Talk settings (consultThinkingLevel: medium,silenceTimeoutMs: 1789). It was then stopped, and candidate 8a0563d started on the same state. Every seeded field (session keys, ids, lifecycle revisions, model/provider, both lock flags, thinking level, Talk settings) read back identical (equal: true). The only difference is the runtime capability descriptor the candidate reports (cloud/device placement support), which is expected and is not persisted session data. No login, credential, or production change.Retained-child yield follow-up (8a0563d): actual spawn used
cleanup=keep; supported childchat.historydirectly retained the realexeccall (ls -1 *.md) and its five-file output (AGENTS.md, BOOTSTRAP.md, IDENTITY.md, SOUL.md, USER.md). Diagnostic tracing recorded exactly oneCLI YIELD ACKprovider append afterclaimAppend current=true, completed=true, and exactly one late-result provider append reporting five. Probe exited 0; supervisors self-unloaded. This closes the deleted-child evidence gap, not faithful initial speech: realtime speech still guessed before correcting to five. Raw history/audio remain private.Historical merged candidate — 000cbff (November 19)
Previous integrated candidate — fde8d50 (historical)
Historical evidence below — not current-candidate acceptance
Historical repair: 6f7f68c
00b6ce70production code fails two focused regressions: supported CLI follow-up is refused, and the real composed relay cannot claim the successor answer. Patched source passes 44/44 scoped tests. The CLI regression uses real CLI turn admission, tool-policy binding, backend attachment, and steered-transcript custody; the permitted input reaches one native write before claiming the first answer. The relay regression composes the actual consultation runner with the production registration, rather than a boolean stand-in. The command's compaction callback and CLI subprocess are simulated; no live-compaction claim.Historical successor-only repair: 00b6ce7
pnpm build:runtimepassed, exit 0 in 80.3 seconds, with nice 15 and capped workers. Worker budgets unchanged: 203/220, 67/100. Artifact hashes and clean tracked source recorded.Immutable sanitized repair runtime and speech proof
execand catalog-locked native Codexbasheach returned 5 and produced matching finalized provider speech, with saved nonempty PCM (1,430,386 and 1,528,306 bytes). Native lock verified before/after; supported archival verified.Native Codex voice was proven on the candidate (in-place on an upgraded instance), not on a fresh stable install; the stable→candidate migration is covered by the 15 Nov proof.
Historical exact-head proof: 1614464
Immutable sanitized runtime and speech proof
pnpm build:runtimepassed, exit 0 in 133.2 seconds, with independently owned frozen dependencies, nice 15, capped native workers, and serial tsdown. Git HEAD, build metadata, and artifact hashes agree; tracked source remained unchanged. Worker budgets passed unchanged: identity 203/220, catalog 67/100. No unrelated worker-GC patch was applied. This is runtime-profile build proof, not a separate package-profile build or full CI.d2f442a25920ac3148b1567a53896995b9ab5a469527a45778a9796a77da9ced. Exit 0; voice closed and temporary session deleted.runtimeSelectionLocked=true. Its typed baseline completed; the voice consult's settled native receipt recorded successfulbash, and the provider finalized “Five Markdown files in the top level.” Saved PCM: 1,541,746 bytes, SHA256c785d9c604851b845ea6c8ff1abeaf1072737fd3c2712cd4d3032a8dc1b96f97. Exit 0; supported archival verified inactive with the lock retained.Earlier regression and upgrade evidence
366916e675fd3a846b4c36c1140a16dc3ec9c048. Before repair, the CLI completion regression failed; after repair, separate scoped runs passed 29/29 routing/custody/requester-final and 3/3 terminal-write cases. Receipt-present/absent CLI completion, abort, and replacement are covered.empty_result; no extra classifier was added.These are synthetic relay/API, saved-audio, and API/state checks, not rendered UI or phone acceptance. UI compilation completed with advisory budget warnings; no UI performance or layout acceptance is claimed.
CI note (historical): Fork Actions are disabled; existing run 43725447728 is queued with zero jobs. It was not redispatched. Skipped upstream draft jobs and accepted dispatches are not CI proof. No merge or deployment.
AI-assisted. Codex source review found no P0–P2 issues. Independent cross-family review is complete; its confirmed incomplete-settlement finding is repaired below.
Test-line allocation
This PR adds about 1,280 net test lines (allocation record: 880 in
config/test-lines-allocations/talk-consult-session-runtime.txt). Most are real-Gateway regressions for routing voice consults through the chat's own command runtime (Claude CLI and the locked native harness): typed-turn handoff authority, the published-runtime lease, command-completion adoption, yielded CLI acknowledgement plus one late result, abort and replaced-voice rejection, and foreign/stale owner fencing through the real session controller. They need a real Gateway and controller, so they cannot collapse into a smaller mocked harness.