Skip to content

fix(talk): honor CLI model routing in browser calls - #164229

Open
ZengWen-DT wants to merge 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/browser-talk-cli-routing-161885-20261003
Open

ZengWen-DT wants to merge 1 commit into
openclaw:mainfrom
ZengWen-DT:fix/browser-talk-cli-routing-161885-20261003

Conversation

@ZengWen-DT

@ZengWen-DT ZengWen-DT commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Related: #161885

What Problem This Solves

Browser Talk consults routed through claude-cli request a direct Anthropic API key and fail before trying the configured fallback.

User Impact

Browser/native GPT-Live consultations use the selected model's runtime and configured fallback chain while retaining the caller's existing authority, cancellation, session continuity and terminal ownership. No configuration or public SDK changes are required. Meeting, voice-call and FaceTime consultation paths are unchanged.

Why This Change Was Made

Refreshed against main at dab3fcdf8edd36df38144a961f8330fcbede872e to resolve the stale branch's conflicts. Talk now uses the existing admitted turn and CLI-candidate owners, with one admission and transcript recorder across candidates. Hook-resolved routes are applied before runtime selection. Steering uses the admitted session operation; a live CLI without injection support uses the provider's existing joined replacement flow.

The refresh preserves main's exact source/Gateway binding and terminal-write draining. It removes the browser's direct embedded-only dispatch and the redundant Talk-side steering projection. Existing consumer fixtures move to the dispatcher boundary, preserving their permission, source, final-effect and lifecycle assertions.

Evidence

Published head: e08988c594b.

  • Real baseline: an isolated Chromium call through the genuine native Talk service on main 9bf3e79c823 reached a delegated consultation, then recorded missing-provider-auth for Anthropic despite the configured claude-cli runtime; fallback was not attempted. Audio input was synthetic; the browser, Gateway and service were real.
  • Focused checks: 88 tests across six routing, steering, admission, source-scope, prompt-prefix and provider-controller files passed in 219.61 seconds. After fixing the review's hook-routing finding, the routing file passed all 16 tests in 74.10 seconds, including compilation; both new hook regressions fail on the preceding candidate.
  • Static checks: core and plugin production types and Gateway test types passed. Formatting, conflict-marker, line-cap and mock-export guards passed. Plugin typed lint also passed. A further seven consumer files had 90 passing and four failing tests in 278.51 seconds; the four cancel-then-new-request failures reproduce with the same assertion and no speakable answer on unmodified main dab3fcdf (all four fail in the baseline run, 92.52 seconds). Running those scenarios through the actual Talk adapter produces the same four failures; they are not counted as passing. Exact-head hosted CI and its CI seconds are pending.
  • Independent review: fresh Codex autoreview of the production adapter and then-current consumer fixtures against dab3fcdf, through P2: scoped-clean, no accepted/actionable findings. Production source is unchanged since that review; the subsequent native real-runner fixture now invokes the Talk adapter. The earlier hook-routing finding was fixed and covered by the red/green tests above. The model-lock suggestion was declined against the existing Talk owner's explicit rejection contract and tests in src/talk/agent-consult-runtime.ts:99 and src/talk/agent-consult-runtime.test.ts:334.
  • Size: production +549/-43 (net +506); tests/support +671/-53 (net +618); other +2/-5. Production growth supplies the previously missing browser-to-CLI adapter using existing runtime, auth, continuity and settlement owners; it adds no fallback loop or configuration. The test-line allocation covers distinct routing/preflight and steering-lifetime boundaries.

Remaining validation and follow-ups

Inherited validation failure: native cancellation followed by a fresh delegated consultation returns the no-answer fallback in four existing tests. This reproduces on unmodified main as well as this candidate; underlying product-versus-fixture cause remains unconfirmed. It is recorded as follow-up, without weakening the assertions.

A successful authenticated Claude CLI after-run remains unverified because the local Claude CLI is logged out. No live CLI allowed-read/forbidden-write result is claimed. The ClawSweeper rank-up request for those final effects remains outstanding; retained-callback rejection has focused controller-boundary coverage, not a live Claude tool-call claim. Ready is a review state, not a claim that these proof gaps or required CI are cleared.

The shared CLI catalog concerns B/C remain named follow-up work: this refresh forwards the logical modelProvider (A), but does not include the separate shared capability/intersection-policy patch or claim those catalog cases fixed.

Earlier proof artifacts remain historical evidence for their recorded revisions; they do not validate this refreshed head. The refreshed full build and remaining platform/live checks are pending exact-head CI or follow-up validation.

AI-assisted: yes. Changes and recorded observations were reviewed directly.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling extensions: openai size: XL labels Oct 3, 2026
@ZengWen-DT
ZengWen-DT marked this pull request as ready for review October 3, 2026 09:58
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Browser Talk consultations reuse normal agent runtime selection and model fallbacks while preserving consultation lifecycle ownership.

Example: Talk uses anthropic/claude-sonnet-4 configured with agentRuntime.id=claude-cli and no Anthropic API key.

  • Before: The consultation requests direct API credentials and fails without trying its fallback.
  • After: The consultation launches claude-cli and can advance to the configured fallback.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful routing repair with the prior lifecycle finding resolved and passing exact-head CI, but material authority enforcement still needs final-effect evidence.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Browser Talk fails agent requests in CLI-only configurations instead of using the configured runtime or fallback.
Reason: The patch restores an existing model-routing contract with independently reported user impact and preserves the browser-specific scope stated in its body.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR: it addresses a current Talk routing bug, and the earlier terminal-event defect is fixed; GitHub still reports a merge conflict.

Priority: P1
Reviewed head: e7cfae3f6cb0aabe4633e82bac09c967ce8ec284

Before merge

  • Add real behavior proof - Authority-chain proof required: inspected Gateway artifacts exercise actual consultation owners with synthetic CLI and HTTP peers, including fallback recovery and cancellation, on matching production blobs; restricted launch arguments and claim acceptance do not establish forbidden-tool rejection or stale provider-append rejection at final I/O. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - No concrete authorization bypass was found, but final-effect enforcement remains unproven for the newly reachable CLI path.
  • Resolve merge risk - Before merge, establish that the new Talk-to-CLI authority path rejects a read-only caller's forbidden tool effect and prevents retained revoked or replaced authority from producing later tool or provider effects.
  • Complete next step - Resolve GitHub's reported merge conflict, preserving current-main Talk authority and worker-session changes, then validate the affected integration.

Findings

None.

Tests

  • Missing end-to-end proof: The production-path evidence still needs allowed and forbidden tool effects plus retained-authority rejection before final I/O; redact credentials, IPs and non-public endpoints.
Agent review details

How this fits together

Browser Talk delegates requests to a Gateway consultation runner, which admits agent work and returns a speakable result to the realtime provider.

flowchart LR
  A[Browser Talk] --> B[Gateway consultation]
  B --> C[Admitted turn owner]
  C --> D[Candidate runtime selection]
  D --> E[CLI backend]
  D --> F[Embedded runtime]
  E --> G[Owned terminal result]
  F --> G
Loading

Technical review

Best possible solution:

Keep browser consultations on the canonical admitted candidate owner while preserving current-main authority, cancellation and transcript contracts.

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

Current-main browser dispatch and independent affected-release traces establish the CLI-routing and missing-fallback failure; no target code was executed during this review.

Is this the best way to solve the issue?

Reusing the admitted turn and per-candidate runtime owners addresses the cause without another configuration option or competing fallback loop.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a9033d5d662c.

Merge-risk options

Maintainer options:

  1. Prove authorization at the final effect (recommended)
    Extend the production-path evidence with an allowed tool operation, a forbidden write from operator.read plus operator.talk, and retained callbacks or grants after cancellation or replacement; record rejection before filesystem, tool or provider I/O.

Provenance checked

  • Browser embedded dispatch changes intended behavior with a stated reason (e3ce08c: The thin-client Talk implementation admitted backing-agent work through embedded execution; this PR explains why CLI configurations need the normal candidate owner.)
  • Completion and steering authority keeps the original intent (5aaf440: Delegation ownership binds steering and completion to the exact run, admission and lifecycle; stale authority remains a hard failure while an exact non-steerable runtime becomes replaceable.)
  • Requester-final custody keeps the original intent (0151e02: Yielded results must return only through current presentation authority; the replacement path revokes requester-final ownership before cancellation.)
  • Native registration fixture changes intended behavior with a stated reason (058e664: The earlier fixture bounded registration after preparation; this revision explains that cold runtime preparation follows claim creation and instead uses test-lifetime cancellation with cleanup coverage.)
  • Mock export baseline keeps the original intent (07e2877: The baseline prevents new incomplete first-party mocks; the patch only removes four entries whose mocked module paths were retired.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete authorization bypass was found, but final-effect enforcement remains unproven for the newly reachable CLI path.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e3ce08c adds extensions/openai/realtime-quicksilver-delegation-controller.ts:190 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e3ce08cd5ec1; files: extensions/openai/realtime-quicksilver-delegation-controller.ts)
  • Vincent Koc: Raw commit 5aaf440 adds extensions/openai/realtime-quicksilver-delegation-controller.ts:318 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5aaf44006b30; files: extensions/openai/realtime-quicksilver-delegation-controller.ts)

PR surface

Source +401, Tests +538, Other -4. Total +935 across 18 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 5 513 112 +401
Tests 12 615 77 +538
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 4 -4
Total 18 1128 193 +935

Labels

Label changes:

  • add merge-risk: 🚨 security-boundary: The adapter transfers Talk admission into CLI/MCP execution, while supplied restricted-caller evidence verifies launch policy rather than forbidden-effect rejection.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: Supported CLI-backed configurations repeatedly fail delegated Talk requests despite working ordinary agent turns.
  • merge-risk: 🚨 security-boundary: The adapter transfers Talk admission into CLI/MCP execution, while supplied restricted-caller evidence verifies launch policy rather than forbidden-effect rejection.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof for a read-only Talk caller's forbidden write and for retained authority after cancellation or replacement.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-03T10:05:30.051Z sha d907184 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T10:27:14.274Z sha 734a675 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T11:48:57.835Z sha f030ba8 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T12:14:39.868Z sha 2ca3895 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T12:23:47.615Z sha 2ca3895 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T05:26:42.996Z sha 2ca3895 :: blocked before merge. :: [P2] [P2] Install terminal ownership before asynchronous preflight
  • reviewed 2026-10-05T02:41:56.320Z sha e7cfae3 :: needs maintainer review before merge. :: none

Reviewed October 16, 2026, 11:08 PM ET / October 17, 2026, 03:08 UTC (Revision 8).

@ZengWen-DT
ZengWen-DT force-pushed the fix/browser-talk-cli-routing-161885-20261003 branch 3 times, most recently from f030ba8 to 2ca3895 Compare October 3, 2026 12:05
@roboclaw-bot

roboclaw-bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Landing review for the requested squash merge found one additional lifecycle defect in the submitted head 2ca389561ecc915c57df89f670a4000e56c99b55: the new asynchronous session-read/model-lock preflight runs before its terminal backstop and try/catch. If it rejects after the consult has registered its run, lifecycle listeners receive no terminal event.

The local correction moves preflight under the existing terminal owner; it adds no production lines and no alternate error-handling path. Extended the existing routing test rather than adding a parallel harness.

  • Reproduction: node scripts/run-vitest.mjs src/gateway/talk/client-agent-consult.routing.test.ts — submitted production code: 12 passed, 2 failed, both new cases observing zero terminal events.
  • Same command after the correction: 14 passed, including session-read failure, model-lock rejection, CLI primary/fallback, cancellation, completion claims, and non-steerable CLI behavior.
  • The independent reviewer also raised stale CLI continuity between fallback candidates. Direct inspection disproves that concern: withAdmittedCliCandidate rereads the canonical session after placement admission whenever sessionTarget is supplied (src/agents/embedded-agent-runner/run-entry-cli.ts:46); the initial-entry callback is not used on this Talk path.
  • Final full-product autoreview is now scoped-clean at P0–P2. Native full validation remains incomplete; see the landing status below. Existing source-matched Gateway proof is isolated real-Gateway + synthetic CLI/HTTP, not live microphone/commercial-provider proof.

Correction LOC: production +21/-21 (net 0); tests +26/-10 (net +16). Original PR: production +515/-112 (net +403); tests/support +531/-77 (net +454). The adapter reuses admitted routing/settlement owners while retaining Talk transcript, permission, and cancellation custody.

Landing review and correction work session

Provenance

PR by Wynne668 (@ZengWen-DT), account created 2026-06-05; OpenClaw last-12-month activity: 206 PRs, 1 issue, 109 commits. Public contribution graph: 121 commits, 207 PRs, 1 issue, 0 reviews. Report by Rollo (@scarabone), account created 2016-12-13. The original direct browser dispatch was introduced by code author and PR author/merger @steipete in #134003, commit e3ce08cd5ec11fa53e6d578770112ea26fcb0d80 (2026-09-04 UTC); later path movement is not the origin.

Landing status

The correction is committed locally, not pushed or merged. The full canonical build passed. An exact upstream-only budget repair from 5f52ff0f863c544519ec80bbd7eeea4248bbf4d3 cleared the stale 476-versus-475 environment-budget check without changing production behavior.

The native correction publication gate is now blocked by repository-wide max-lines lint failures in files this PR does not change:

  • extensions/voice-call/src/runtime.test.ts
  • extensions/crabbox/src/crabbox-worker-provider.ts
  • src/state/openclaw-state-read.worker.ts
  • src/plugins/doctor-contract-registry.ts
  • src/gateway/server-methods/chat-send-admission.ts (already fixed on newer main)

The first four failures independently reproduce with the normal repository oxlint configuration on current main db01f6d520b844c62f146a789f3da2c11075529c; the last does not. The full test stage was not reached. No lint suppression, weakened assertion, gate override, or passing stamp was added.

Testbox never allocated a runner; its stopped wrapper also reported proxy authentication failure during cleanup. Both task-owned leases were stopped. Local native validation was used instead; its retained operation lock has been recovered after process completion. Finishing publication requires resolving the unrelated lint failures or a supported maintainer decision on that broader scope; the original PR remains open at its existing head.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@ZengWen-DT
ZengWen-DT force-pushed the fix/browser-talk-cli-routing-161885-20261003 branch from 2ca3895 to e7cfae3 Compare October 5, 2026 02:31
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 5, 2026
@alfredjbclaw

Copy link
Copy Markdown
Contributor

Independent verification of this PR composed with #164771 (both backported onto v2026.9.8), in case it helps the landing review.

Setup. Isolated gateway from a release package with this PR + #164771 applied. Real claude-cli subscription backend and real Codex app-server harness; the browser Talk consult runner is driven in-process. Every question requires a file read (the answer word exists only in a workspace file). Config shape matches the issue: default anthropic/claude-opus-5-5 with model-scoped agentRuntime: claude-cli and no Anthropic API key; openai/gpt-6.1-sol with agentRuntime: codex.

Session Stock 2026.9.8 With both PRs
chat pinned to openai/gpt-6.1-sol (runtime codex) FailoverError "No API key found for provider anthropic", ~0.1 s answered on gpt-6.1-sol via the Codex harness, file read; 14.9 / 13.6 / 15.3 s
unpinned (default Opus via claude-cli) same FailoverError, ~0.1 s cli exec: provider=claude-cli model=claude-opus-5-5, file read; 8.3 / 4.5 / 3.2 s
Opus as an API-only route (no key), fallback openai/gpt-6.1-sol FailoverError in 0.39 s; lifecycle shows only error, no fallback attempt lifecycle fallback_step → model openai/gpt-6.1-sol → end, file read; 15.0 s

The third row is an execution trace for the issue's open fallback question. On stock, Talk calls the single-candidate runEmbeddedAgent, which raises the FailoverError for an outer fallback owner (runEmbeddedAgentEntry / runWithModelFallback). Chat, cron and memory turns have that owner; Talk did not. With this PR it does.

Two small deltas needed when both PRs are in one tree

  1. As the PR body says, requestedRouteResolution from fix(talk): honor chat model and runtime selection in browser calls #164771's selection has to reach the selection passed to runEmbeddedAgentEntry. Without it, a stored resolved pin whose model id is also an alias of another configured model gets re-parsed onto the alias target.
  2. harness.resolveRuntimeOverride returns params.agentHarnessRuntimeOverride for every candidate. fix(talk): honor chat model and runtime selection in browser calls #164771 computes that value from the session for the requested provider only. In a combined tree, a session runtime of codex is therefore also applied to an anthropic fallback candidate, which then goes to the embedded runner with runtime codex instead of the claude-cli backend. Chat turns resolve the runtime per candidate. What I used:
selection: { /* … */ requestedRouteResolution: params.requestedRouteResolution, /* … */ },
// …
resolveRuntimeOverride: (provider) =>
  resolveSessionRuntimeOverrideForProvider({ provider, entry: sessionEntry, cfg: params.config }) ??
  (provider === selection.provider ? params.agentHarnessRuntimeOverride : undefined),

Regression cases on the combined tree (each composition case fails without its line):

  • a pinned OpenAI chat runs on its own runtime;
  • an unpinned chat runs on the CLI default;
  • a pinned CLI model goes to the CLI;
  • a prepared route is not re-parsed as an alias;
  • the session runtime is not applied to a fallback provider;
  • a locked chat is refused before any runtime starts.

One more backport note: #164771's new storage tests mock runEmbeddedAgent. In a combined tree they need to mock this PR's runTalkAgentTurn seam instead.

Not covered: microphone/WebRTC audio, GPT-Live's own delegation decision, and steering or interruption against a live CLI turn.

Copy link
Copy Markdown

Correction to my immediately preceding production-client comment: I now have a correlated Gateway trace for that exact Oct 16 Android call.

For this particular Play-app failure, #164229's runtime-routing path is not reached. Talk selected device session agent:main:node-658dba94672b, which had already been archived on Oct 12. The consultation fails at admission with:

Session "agent:main:node-658dba94672b" is archived. Restore it before starting new work.

The installed/current-main Talk consultation code checks session work-start/archive state before it generates the consult run ID or invokes runEmbeddedAgent.

I filed the complete correlated trace as #175027 and updated #131768. Please do not treat my earlier 2026.10.30 observation as evidence that #164229 fixes this specific captured failure.

#164229 still appears to address the separate established Talk runtime/fallback-routing defect; this trace simply establishes that the Oct 16 production failure occurs one layer earlier.

@Digital-Pulse-Home

Copy link
Copy Markdown

Hi @ZengWen-DT, thanks for this PR. We were working on the same symptom (#161885) from the shared consult-runtime side. We've decided not to open a competing PR, because this one is the better owner for browser Talk. While building ours, repeated independent review kept finding the same class of problem on the CLI route. We're passing it on in case it helps when you take this out of draft, or helps landing review.

The risk class. When a consult that would have run on the embedded runner goes to a CLI backend instead, the CLI runner re-derives tool policy from the params it receives. Forwarding a field doesn't preserve what it means. In several cases the CLI side read the same input more permissively than the embedded runner does, so the final CLI tool catalog included a tool the embedded run would not have built. None of these executed a tool. They are catalog and availability differences, compared on real catalogs, not on forwarded fields.

Counterexamples we reproduced (against our own handover design, on a newer main than this PR's base). We closed these in our design. From reading your diff, most of them look structurally avoided, because you spread the full run params and pass modelProvider, sessionEntry and runtimePolicySessionKey:

  1. toolOverrides.webSearch: false not carried over, so web_search was available.
  2. tools.byProvider.<logical provider>.deny evaluated against the CLI execution provider id, so web_fetch was available.
  3. messageProvider: "voice" / "discord-voice" dropped by gateway channel normalization, so tts was available. Browser Talk uses "webchat", so this probably doesn't reach your path.
  4. Senderless non-owner: a wildcard toolsBySender["*"].deny didn't apply under the CLI side's sender mode, so web_fetch was available.
  5. Persisted delegated session: the named or default cap became "*" during CLI preparation, and exec was projected.

These three were still open when we stopped. Each was reproduced through the real CLI runtime-policy owner, MCP grant builder and loopback catalog, and compared with the real embedded tool construction and final allow filter:

  • A. tools.exec.applyPatch.allowModels qualified with the CLI execution provider (["<cli-backend>/<model>"], cap ["read", "apply_patch"]). The embedded run checks allowModels against the logical model provider, so apply_patch is absent. CLI preparation uses modelProvider ?? provider; without modelProvider it matched, so apply_patch was present. Your CLI branch passes modelProvider: provider, which looks like it closes this. A regression test would pin it.
  • B. Whitespace in clientCaps ([" ui-commands "], cap ["read", "screen"]). The embedded filterToolsByClientCaps uses exact Set membership, so screen is absent. buildCliMcpGrantContext trims capability strings, so screen was present. Your CLI branch forwards clientCaps unchanged through the params spread, so the mechanism looks reachable if any ingress can deliver an untrimmed capability string. We did not confirm that a browser client can.
  • C. Restrictions attached via attachToolAllowlistIntersection (["read", "web_fetch"] with an attached [["read"]]). The embedded final filter honours the attached restriction, so web_fetch is absent. On the CLI side, resolveCliRuntimeToolPolicy copies the list into plain arrays ([...params.toolsAllow] plus expandToolGroups), which drops the symbol-keyed restriction, so web_fetch was present. We found no bundled consult producer that emits this shape today. It is a supported policy representation that the embedded runner honours.

Suggested invariant. For every CLI-routed Talk turn:

finalCliTools ⊆ embeddedTools(same params) ∩ routeCap

Compare the real final catalogs on both sides, not forwarded fields and not the initial selection. The new routing test asserts forwarded fields (modelProvider, toolsAllow, senderIsOwner). That's useful, but every counterexample above would have passed a field-level check. A, B and C make good first rows for a subset test: each needs a positive control (read present on both sides) and a final assertion that the CLI-minus-embedded difference is [].

We're happy to write A–C as Vitest cases against runTalkAgentTurn's CLI branch on your branch, if that would help. B and C are mechanisms in the shared CLI runner rather than in your diff, so they may deserve their own issue regardless of which Talk fix lands.

Copy link
Copy Markdown
Contributor Author

@Digital-Pulse-Home Thanks for sharing the concrete counterexamples and for coordinating the overlapping work. A test-only patch or branch for A–C would be welcome; please include the exact base SHA and the final embedded/CLI catalogs, with read as a positive control and the CLI-minus-embedded difference asserted empty.

I am checking those cases against current main while refreshing this draft. Please keep catalog comparison, execution availability, and ingress reachability distinct, and include any session-recorded capability state that affects B. I will not treat results from your handover branch as proof for this PR.

The refresh also needs the existing final-effect checks: an allowed read, a forbidden write for operator.read plus operator.talk, and retained authority rejected after cancellation or replacement before tool/provider I/O. The current head still conflicts with main, so I am keeping it draft until the integration and required validation are complete. I am handling the integration and owner-side investigation; sharing the regression cases separately will help avoid overlapping production edits.

@Digital-Pulse-Home

Copy link
Copy Markdown

Thanks @ZengWen-DT. Here's the test-only patch for A–C: one new file, src/agents/cli-runner/prepare.talk-catalog-parity.test.ts, no production changes.

Base: main @ e9fcf00afa31d173f22cccbc06982a086694cdd0. Run: OPENCLAW_VITEST_RUNTIME=node node scripts/test-projects.mts src/agents/cli-runner/prepare.talk-catalog-parity.test.ts. Result: 8 tests, 5 pass, 3 fail (B1, B3, C). The failures reproduce the gaps on unmodified main.

Owners exercised. The embedded side runs buildEmbeddedAttemptToolRunContext → createOpenClawCodingToolsInternalAsync (includes filterToolsByClientCaps and the apply_patch allowModels check on the logical provider) → applyEmbeddedAttemptToolsAllow. The CLI side runs prepareCliRunContext (bundled claude-cli backend) → resolveCliRuntimeToolPolicy → buildCliMcpGrantContext → minted grant → resolveMcpLoopbackScopedTools. Same params on both sides: owner, webchat, logical provider anthropic. Only callGatewayTool and the grant transport seams are mocked.

Layers. (i) catalog is the final listed names. (ii) execution is listed tools whose execute doesn't return a gate refusal, probed with empty args that fail validation before any I/O. (iii) ingress is not tested at runtime; static notes are below.

Row Embedded listed / exec CLI listed / exec CLI − embedded
A (modelProvider forwarded) [read] / [read] [read] / [read] []
A-control (no modelProvider) [read] / [read] [apply_patch, read] / same [apply_patch], asserted to prove the row discriminates
B-positive (["ui-commands"]) [read, screen] / same [read, screen] / same []
B1 ([" ui-commands "], nothing recorded) [read] / [read] [read, screen] / same [screen] / [screen]
B2 (recorded [" ui-commands "]) [read] / [read] [read] / [read] []
B3 (recorded ["ui-commands"], run [" ui-commands "]) [read, screen] / [read] [read, screen] / [read, screen] listed [] / exec [screen]
C-positive [read, web_fetch] / same [read, web_fetch] / same []
C ([read, web_fetch] + attached [[read]]) [read] / [read] [read, web_fetch] / same [web_fetch] / [web_fetch]

read is present on both sides in every row. Each test prints both final catalogs as [talk-catalog-parity] <row> {...}.

Session-recorded state (B). Listing caps come from the session entry's clientCapabilities when present, and the loopback reads the same entry, so recorded caps govern listing on both sides (B2, B3). Recorded caps are deduped and sorted, not trimmed. The turn's execution gate still uses run clientCaps: exact on the embedded side, trimmed by buildCliMcpGrantContext on the CLI side. That's why B3 has identical catalogs but screen is executable only on the CLI side.

C. The grant's toolsAllow is ["web_fetch","read"]. The attached restriction is already gone after resolveCliRuntimeToolPolicy copies the list.

Ingress (static, unverified). connect.caps only requires minLength: 1, so an untrimmed cap passes the schema. Chat-backed Talk forwards connect.caps into chat.send, which records session caps untrimmed. On main, the realtime consult doesn't set clientCaps on its run. We didn't confirm that any shipped client sends whitespace.

Limits. runTalkAgentTurn isn't on main, so the rows target the shared CLI owners your CLI branch reaches via runCliAgent, not your Talk entry point. The embedded side is real construction plus the final filter, not a full attempt (no admission, bundle MCP or tool search). The execution probe is tool-level, not the HTTP tools/call dispatcher. We ran oxlint but not a full typecheck. B and C sit in the shared CLI runner, so they may deserve their own issue whichever Talk fix lands. Happy to adapt the rows to your refreshed branch.

Patch (git format-patch, applies to main @ e9fcf00)
From c050022c8fd5ee9c138663c81cff756b65803a38 Mon Sep 17 00:00:00 2001
From: Digital-Pulse-Home <[email protected]>
Date: Wed, 11 Nov 2026 15:19:50 +0800
Subject: [PATCH] test(cli-runner): CLI-routed consult catalog parity rows A-C
 (#161885)

---
 .../prepare.talk-catalog-parity.test.ts       | 318 ++++++++++++++++++
 1 file changed, 318 insertions(+)
 create mode 100644 src/agents/cli-runner/prepare.talk-catalog-parity.test.ts

diff --git a/src/agents/cli-runner/prepare.talk-catalog-parity.test.ts b/src/agents/cli-runner/prepare.talk-catalog-parity.test.ts
new file mode 100644
index 00000000000..a7854e8a189
--- /dev/null
+++ b/src/agents/cli-runner/prepare.talk-catalog-parity.test.ts
@@ -0,0 +1,318 @@
+// Regression rows for #161885 / #164229: a consult that would have run on the embedded
+// runner and is routed to a CLI backend must not expose a tool the embedded run would not
+// have built. Each row compares the real final catalogs on both sides for the same params:
+//   embedded: buildEmbeddedAttemptToolRunContext -> createOpenClawCodingToolsInternalAsync
+//             (filterToolsByClientCaps, apply_patch allowModels) -> applyEmbeddedAttemptToolsAllow
+//   CLI:      prepareCliRunContext (resolveCliRuntimeToolPolicy, buildCliMcpGrantContext)
+//             -> minted loopback grant -> resolveMcpLoopbackScopedTools (tools/list + tools/call)
+import { expectDefined } from "@openclaw/normalization-core";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import {
+  clearRuntimeConfigSnapshot,
+  setRuntimeConfigSnapshot,
+} from "../../config/runtime-snapshot.js";
+import { replaceSessionEntrySync } from "../../config/sessions/session-accessor.js";
+import type { OpenClawConfig } from "../../config/types.openclaw.js";
+import {
+  resolveMcpLoopbackPolicyTools,
+  resolveMcpLoopbackScopedTools,
+} from "../../gateway/mcp-http.runtime.js";
+import type { CliBackendPlugin } from "../../plugins/cli-backend.types.js";
+import { loadBundledPluginFacade } from "../../test-utils/bundled-plugin-public-surface.js";
+import { isAgentToolExecutionAvailable } from "../agent-tool-availability.js";
+import { createOpenClawCodingToolsInternalAsync } from "../agent-tools.async.js";
+import { testing as cliBackendsTesting } from "../cli-backends.test-support.js";
+import { createCliRunnerPrepareFixture } from "../cli-runner.test-helpers.js";
+import {
+  applyEmbeddedAttemptToolsAllow,
+  resolveEmbeddedAttemptToolConstructionPlan,
+} from "../embedded-agent-runner/run/attempt-tool-construction-plan.js";
+import { buildEmbeddedAttemptToolRunContext } from "../embedded-agent-runner/run/attempt-tool-run-context.js";
+import { attachToolAllowlistIntersection } from "../tool-policy.js";
+import { mockCliMcpPreparation } from "./prepare-mcp.test-support.js";
+import { prepareCliRunContext } from "./prepare.js";
+import { resetCliRunnerPrepareTestDeps } from "./prepare.test-support.js";
+import type { RunCliAgentParams } from "./types.js";
+
+const { buildAnthropicCliBackend } = await loadBundledPluginFacade<{
+  buildAnthropicCliBackend: () => CliBackendPlugin;
+}>({ pluginId: "anthropic", artifactBasename: "api.js" });
+
+// mock-isolation: Tool construction must not reach a live Gateway for node or computer status.
+vi.mock("../tools/gateway.js", () => ({
+  callGatewayTool: async (method: string) => {
+    if (method === "node.list") {
+      return { nodes: [] };
+    }
+    if (method === "computer.status") {
+      return { configured: false, available: false };
+    }
+    throw new Error(`Unexpected Gateway I/O: ${method}`);
+  },
+}));
+
+const CLI_PROVIDER = "claude-cli";
+const LOGICAL_PROVIDER = "anthropic";
+const MODEL = "fixture-model";
+
+type Catalog = { listed: string[]; executable: string[] };
+type Row = {
+  config?: OpenClawConfig["tools"];
+  toolsAllow: () => string[];
+  clientCaps?: string[];
+  sessionClientCapabilities?: string[];
+  /** Omit to model a caller that forwards only the CLI execution provider. */
+  modelProvider?: string;
+};
+
+type ProbeTool = {
+  name: string;
+  execute: (id: string, args: unknown, signal?: AbortSignal) => unknown;
+};
+
+/**
+ * Execution availability is separate from listing: a listed tool can still be gated for this
+ * turn. Probe with empty args, which every probed tool rejects during argument validation
+ * before any I/O; only a gate refusal counts as unavailable.
+ */
+async function isGated(tool: ProbeTool): Promise<boolean> {
+  if (!isAgentToolExecutionAvailable(tool)) {
+    return true;
+  }
+  try {
+    const result = (await tool.execute("parity-probe", {}, new AbortController().signal)) as {
+      details?: { gated?: unknown };
+    };
+    return result?.details?.gated === true;
+  } catch {
+    return false;
+  }
+}
+
+async function catalogOf(tools: readonly ProbeTool[]): Promise<Catalog> {
+  const listed = tools.map((tool) => tool.name).toSorted();
+  const executable: string[] = [];
+  for (const tool of tools) {
+    if (!(await isGated(tool))) {
+      executable.push(tool.name);
+    }
+  }
+  return { listed, executable: executable.toSorted() };
+}
+
+let fixture: ReturnType<typeof createCliRunnerPrepareFixture>;
+let mintGrant: ReturnType<typeof mockCliMcpPreparation>["mint"];
+
+beforeEach(() => {
+  vi.clearAllMocks();
+  cliBackendsTesting.setDepsForTest({
+    resolvePluginSetupCliBackend: () => undefined,
+    resolveRuntimeCliBackends: () => [{ ...buildAnthropicCliBackend(), pluginId: "anthropic" }],
+  });
+  ({ mint: mintGrant } = mockCliMcpPreparation({
+    resolveMcpLoopbackPolicyTools,
+    resolveMcpLoopbackScopedTools,
+  }));
+  fixture = createCliRunnerPrepareFixture((params) =>
+    prepareCliRunContext({ skillsSnapshot: { prompt: "", skills: [] }, ...params }),
+  );
+});
+afterEach(async () => {
+  clearRuntimeConfigSnapshot();
+  resetCliRunnerPrepareTestDeps();
+  cliBackendsTesting.resetDepsForTest();
+  await fixture.cleanup();
+});
+
+function rowConfig(row: Row): OpenClawConfig {
+  return { plugins: { enabled: false }, tools: { ...row.config } };
+}
+
+/** Real embedded construction and final allow filter, with the logical model provider. */
+async function embeddedCatalog(row: Row): Promise<Catalog> {
+  const { dir, sessionTarget } = fixture.session;
+  const config = rowConfig(row);
+  const toolRunContext = buildEmbeddedAttemptToolRunContext({
+    clientCaps: row.clientCaps,
+    senderIsOwner: true,
+    toolsAllow: row.toolsAllow(),
+    model: { provider: LOGICAL_PROVIDER, id: MODEL },
+    sessionId: sessionTarget.sessionId,
+    sessionKey: sessionTarget.sessionKey,
+  });
+  const plan = resolveEmbeddedAttemptToolConstructionPlan({
+    toolsAllow: toolRunContext.runtimeToolAllowlist,
+  });
+  const tools = await createOpenClawCodingToolsInternalAsync({
+    ...toolRunContext,
+    config,
+    agentId: sessionTarget.agentId,
+    sessionKey: sessionTarget.sessionKey,
+    runSessionKey: sessionTarget.sessionKey,
+    sessionId: sessionTarget.sessionId,
+    runId: "run-embedded",
+    messageProvider: "webchat",
+    messageChannel: "webchat",
+    modelProvider: LOGICAL_PROVIDER,
+    modelId: MODEL,
+    workspaceDir: dir,
+    cwd: dir,
+    toolConstructionPlan: plan.codingToolConstructionPlan,
+  });
+  return await catalogOf(applyEmbeddedAttemptToolsAllow(tools, plan.runtimeToolAllowlist));
+}
+
+/** Real CLI preparation, minted grant and loopback catalog for the same params. */
+async function cliCatalog(row: Row): Promise<Catalog & { grantToolsAllow?: string[] }> {
+  const config = rowConfig(row);
+  const { sessionTarget } = fixture.session;
+  const params: Partial<RunCliAgentParams> = {
+    provider: CLI_PROVIDER,
+    ...(row.modelProvider ? { modelProvider: row.modelProvider } : {}),
+    model: MODEL,
+    config,
+    senderIsOwner: true,
+    sessionKey: sessionTarget.sessionKey,
+    agentId: sessionTarget.agentId,
+    messageProvider: "webchat",
+    messageChannel: "webchat",
+    toolsAllow: row.toolsAllow(),
+    ...(row.clientCaps ? { clientCaps: row.clientCaps } : {}),
+  };
+  const { preparedBackend } = await fixture.prepare(params);
+  try {
+    const grant = expectDefined(mintGrant.mock.calls.at(-1)?.[0]?.context, "loopback grant");
+    const { tools } = await resolveMcpLoopbackScopedTools({
+      cfg: config,
+      context: grant,
+      isGrantCurrent: () => true,
+    });
+    return { ...(await catalogOf(tools)), grantToolsAllow: grant.toolsAllow };
+  } finally {
+    await preparedBackend.cleanup?.();
+  }
+}
+
+async function compare(label: string, row: Row) {
+  // Both sides read the same live runtime config, as a Gateway-hosted consult does.
+  setRuntimeConfigSnapshot(rowConfig(row));
+  if (row.sessionClientCapabilities) {
+    const { sessionTarget } = fixture.session;
+    replaceSessionEntrySync(sessionTarget, {
+      sessionId: sessionTarget.sessionId,
+      updatedAt: 0,
+      clientCapabilities: row.sessionClientCapabilities,
+    });
+  }
+  const embedded = await embeddedCatalog(row);
+  const cli = await cliCatalog(row);
+  const listedDiff = cli.listed.filter((name) => !embedded.listed.includes(name));
+  const executableDiff = cli.executable.filter((name) => !embedded.executable.includes(name));
+  // Printed so a reviewer can read the final catalogs, not only the verdict.
+  console.log(
+    `[talk-catalog-parity] ${label} ${JSON.stringify({
+      embedded,
+      cli,
+      cliMinusEmbedded: { listed: listedDiff, executable: executableDiff },
+    })}`,
+  );
+  return { embedded, cli, listedDiff, executableDiff };
+}
+
+describe("CLI-routed consult catalog stays within the embedded catalog (#161885)", () => {
+  // A: apply_patch.allowModels names the CLI execution provider; the embedded run checks the
+  // logical model provider, so apply_patch must stay absent when the caller forwards it.
+  const rowA: Row = {
+    config: {
+      exec: { applyPatch: { enabled: true, allowModels: [`${CLI_PROVIDER}/${MODEL}`] } },
+    },
+    toolsAllow: () => ["read", "apply_patch"],
+    modelProvider: LOGICAL_PROVIDER,
+  };
+
+  it("A: allowModels qualified with the CLI provider does not add apply_patch", async () => {
+    const result = await compare("A", rowA);
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    expect(result.embedded.listed).not.toContain("apply_patch");
+    expect(result.listedDiff).toEqual([]);
+    expect(result.executableDiff).toEqual([]);
+  });
+
+  it("A control: the comparison detects apply_patch when modelProvider is not forwarded", async () => {
+    const result = await compare("A-control", { ...rowA, modelProvider: undefined });
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    // Pins the mechanism the row guards: without modelProvider the CLI side matches.
+    expect(result.listedDiff).toEqual(["apply_patch"]);
+  });
+
+  // B: whitespace in clientCaps. The embedded listing filter uses exact Set membership; the
+  // CLI grant builder trims. Session-recorded clientCapabilities take precedence on both sides.
+  const rowB: Row = {
+    toolsAllow: () => ["read", "screen"],
+    clientCaps: [" ui-commands "],
+    modelProvider: LOGICAL_PROVIDER,
+  };
+
+  it("B positive control: screen is listed on both sides for an exact ui-commands cap", async () => {
+    const result = await compare("B-positive", { ...rowB, clientCaps: ["ui-commands"] });
+    expect(result.embedded.listed).toEqual(expect.arrayContaining(["read", "screen"]));
+    expect(result.cli.listed).toEqual(expect.arrayContaining(["read", "screen"]));
+    expect(result.listedDiff).toEqual([]);
+  });
+
+  it("B1: untrimmed run clientCaps with no session-recorded capabilities", async () => {
+    const result = await compare("B1", rowB);
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    expect(result.embedded.listed).not.toContain("screen");
+    expect(result.listedDiff).toEqual([]);
+    expect(result.executableDiff).toEqual([]);
+  });
+
+  it("B2: session-recorded untrimmed capabilities govern listing on both sides", async () => {
+    const result = await compare("B2", {
+      ...rowB,
+      sessionClientCapabilities: [" ui-commands "],
+    });
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    expect(result.listedDiff).toEqual([]);
+    expect(result.executableDiff).toEqual([]);
+  });
+
+  it("B3: session-recorded exact capability with untrimmed run caps", async () => {
+    const result = await compare("B3", {
+      ...rowB,
+      sessionClientCapabilities: ["ui-commands"],
+    });
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    expect(result.listedDiff).toEqual([]);
+    expect(result.executableDiff).toEqual([]);
+  });
+
+  // C: an attached allowlist intersection is honoured by the embedded final filter.
+  it("C positive control: web_fetch is listed on both sides without an attached restriction", async () => {
+    const result = await compare("C-positive", {
+      toolsAllow: () => ["read", "web_fetch"],
+      modelProvider: LOGICAL_PROVIDER,
+    });
+    expect(result.embedded.listed).toEqual(expect.arrayContaining(["read", "web_fetch"]));
+    expect(result.cli.listed).toEqual(expect.arrayContaining(["read", "web_fetch"]));
+    expect(result.listedDiff).toEqual([]);
+  });
+
+  it("C: an attached [[read]] restriction keeps web_fetch out of the CLI catalog", async () => {
+    const result = await compare("C", {
+      toolsAllow: () => attachToolAllowlistIntersection(["read", "web_fetch"], [["read"]]),
+      modelProvider: LOGICAL_PROVIDER,
+    });
+    expect(result.embedded.listed).toContain("read");
+    expect(result.cli.listed).toContain("read");
+    expect(result.embedded.listed).not.toContain("web_fetch");
+    expect(result.listedDiff).toEqual([]);
+    expect(result.executableDiff).toEqual([]);
+  });
+});
-- 
2.56.0

@Digital-Pulse-Home

Copy link
Copy Markdown

Quick status from our side, in case it's useful for prioritising: we're still affected on 2026.11.3 (browser/iOS Talk consults routed through claude-cli fail as in #161885). In the meantime we've worked around it by pointing talk.agentId at an agent on an embedded/Codex model, which confirms the failure is specific to the CLI route.

The A–C regression rows above still apply to current main. Happy to re-run them against your refreshed branch whenever it's pushed. No rush intended, just keeping the thread current.

@ZengWen-DT
ZengWen-DT marked this pull request as ready for review November 14, 2026 23:13
Use the admitted turn and CLI candidate owners for browser Talk, applying
hook-resolved routes before runtime selection and retaining source authority,
continuity, cancellation and terminal settlement across model fallback.

Preserve canonical steering and joined replacement for non-steerable CLIs.
Related: openclaw#161885
@ZengWen-DT
ZengWen-DT force-pushed the fix/browser-talk-cli-routing-161885-20261003 branch from e7cfae3 to e08988c Compare November 14, 2026 23:46
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@Digital-Pulse-Home Thanks for the follow-up and the A–C cases. The branch is now refreshed on current main at e08988c594b, with the merge conflicts resolved, and the PR is ready for review.

The refresh keeps logical modelProvider forwarding and uses the current admitted runtime/fallback owners. The shared CLI catalog/intersection cases B/C remain follow-up work; this revision does not claim them fixed. I updated the Evidence section with the real baseline failure, focused regression results, independent review, and explicit live/final-effect gaps.

Four existing native cancel-then-new-request tests also fail on unmodified main with the same no-answer result; those failures are recorded separately, with their assertions retained. Successful authenticated Claude CLI after-proof and exact-head CI are still pending.

@hannnnn-l

hannnnn-l commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for picking this up. The CLI routing gap in #161885 is real, and this fixes it for Talk.

A question on direction: this moves Talk off the shared consultRealtimeVoiceAgent (src/talk/agent-consult-runtime.ts) onto a Talk-only runner (runTalkAgentTurn). Voice-call, meeting-bot and FaceTime keep calling the shared helper, which still goes straight to runEmbeddedAgent, so claude-cli-routed agents would still fail there (#188440 for voice-call), and there would be two consult execution paths to keep in sync.

Most of runTalkAgentTurn looks surface-independent (CLI candidate admission, resolveRunEntryCliRuntime, the fallback chain, lifecycle handling); the Talk-specific part seems to be the Gateway caller/run authority binding. Would you be open to moving the routing and fallback part into the shared consult runtime, with each surface passing in its own caller authority, so every realtime surface honors agentRuntime and fallbacks the same way? I'm aware of the CLI tool-catalog parity concerns raised above; a shared path would need to keep per-surface tool policies such as voice-call's safe-read-only from widening on the CLI route.

If you agree with that direction, would you mind if we contributed a patch against this branch for it (base SHA, run commands and results included)? Happy to keep it scoped however suits you, or to wait until this lands and follow up separately.

@hannnnn-l

Copy link
Copy Markdown
Contributor

Follow-up to my earlier comment: I opened #202209 for the plugin side. It adds an opt-in runner: "agent-turn" to the shared consultRealtimeVoiceAgent and switches only Voice Call, meeting-bot and FaceTime to it, so those consults run through runCommandFromIngress like Discord voice. Talk keeps the embedded runner there, so it does not touch this PR's Talk path (or #199379's). If either Talk change lands first I'm happy to rebase onto it.

@Digital-Pulse-Home

Copy link
Copy Markdown

Thanks @hannnnn-l, and for splitting it out. Keeping the shared-runtime work in #202209 and leaving this PR's Talk path alone seems like the right shape to us: Talk can land now, and Voice Call / meeting-bot / FaceTime get the agentRuntime/fallback fix without a second review cycle here. +1 on keeping per-surface tool policies (e.g. voice-call's safe-read-only) from widening on the CLI route.

From the user side: we run Talk on a claude-cli-routed agent and are currently working around this by pointing talk.agentId at a non-CLI agent. We'd love to see this PR merge as-is. Happy to rerun the A–C checks we posted earlier on whatever head ends up being merged, and to test #202209 on voice-call once it's ready.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. extensions: openai gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants