Skip to content

fix(voice): answer phone, meeting and FaceTime consults on Claude CLI agents - #202209

Merged
omarshahine merged 11 commits into
openclaw:mainfrom
hannnnn-l:fix/voice-consult-ingress
Nov 28, 2026
Merged

omarshahine merged 11 commits into
openclaw:mainfrom
hannnnn-l:fix/voice-consult-ingress

Conversation

@hannnnn-l

@hannnnn-l hannnnn-l commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #202208

Related: #188440, #161885, #164229, #199379, #199378; supersedes closed #191683.

What Problem This Solves

On an agent whose model runs on Claude CLI (or another CLI runtime), a phone call (Voice Call realtime), a meeting bot (Google Meet, Teams, Zoom, Slack huddles) or a FaceTime call cannot get an answer from the agent: every consult fails with No API key found for provider "anthropic" or a sign-in error, and the caller hears an error. Typed messages and Discord voice to the same agent work.

User Impact

User impact: phone, meeting and FaceTime voice consults run on the agent's own runtime, including Claude CLI and its configured fallbacks, like a typed message. Embedded-runtime agents keep working. Tool policy is unchanged: callers and meeting participants are guests, FaceTime owners stay owners, and a phone consult's voice_call can still only end the current call.

Why This Change Was Made

The shared helper consultRealtimeVoiceAgent always ended in runEmbeddedAgent with an explicit provider/model, which calls the provider API directly and never selects the agent's runtime. Discord voice works because it runs a normal agent turn through runCommandFromIngress.

  • consultRealtimeVoiceAgent gains runner: "agent-turn": after the helper prepares the consult session (fork from the requester, lineage, delivery fields, lifecycle admission), the consult runs as a turn of that session through runCommandFromIngress with deliver: false. Prompt building, timeout, cancellation, onRunStarted, speakable-text extraction and yield acknowledgements are unchanged. The default stays embedded, so Talk (which adapts embedded tool context and is being reworked in fix(talk): honor CLI model routing in browser calls #164229 / fix(talk): voice consults fail when the chat runs on Claude CLI or a locked native harness #199379) and third-party SDK callers are untouched.
  • Voice Call, meeting-bot and FaceTime opt in. Voice Call passes a model override only when responseModel is configured and a thinking override only when realtime.consultThinkingLevel is set; otherwise the session's own selection applies. Meeting consults no longer force thinking high; they use the session default. A level a bridge does pass (FaceTime always asks for off, Voice Call passes realtime.consultThinkingLevel) is a one-run choice: a model without that level runs at its closest one, as on the embedded runner (8711c7b5a, below).
  • Plugin ingress (runCommandFromIngress wrapper): a plugin may omit messageChannel for a turn on its own surface. Owner authority still needs a bundled or trusted official plugin, and a named channel must still be the plugin's own. toolBindings are accepted only for tools the plugin declares in contracts.tools. This widens the plugin ingress capability (previously only channel plugins could admit turns); it stays narrower than runEmbeddedAgent, which any plugin can already call with an owner bit. Flagging for SDK/security owner review.
  • The Claude CLI path carries toolBindings from the command attempt into the MCP loopback grant, as the embedded runner already does, so voice_call stays bound to the live call.
  • Voice Call runs the consult in its service context so Gateway-dispatched tools such as sessions_send work from webhook handlers.

Not changed: the Voice Call classic (non-realtime) responder (#188440), Talk's Gateway consult path (#164229 / #199379), Discord voice.

Review fixes (ClawSweeper review of 1fd6919)

Rebased onto main d7d546f29 (first commit now 1698a745c, unchanged content). Second commit 503beb2ae, one focused test per finding, each red on the first commit and green after:

  • [P1] Sender policy at the MCP boundary. A Gateway-launched CLI run's loopback grant now resolves requester policy like its embedded twin (senderPolicyMode: "always", owner WebChat still exempt), also when a capped tool list drops node exec, which is what switched it to when-sender-id before (src/gateway/tool-resolution.ts, tool-resolution-authority.ts; keyed on the grant's existing nodeExecAllowed, which only Gateway-launched CLI grants carry). HTTP /tools/invoke keeps when-sender-id. Voice Call also passes the remote party's number (from inbound, to outbound, the identity inbound admission checks) as the consult's senderId, so toolsBySender entries apply to the caller. Tests: src/gateway/mcp-http.voice-consult-grant.test.ts (real MCP loopback, grant built by buildCliMcpGrantContext: tools/list without sessions_send, tools/call sessions_send refused, control case with an identified caller), tool-resolution.exclude.test.ts, Voice Call runtime.test.ts.
  • [P2] Verbose not saved. New verboseOnce command option (like thinkingOnce): it sets the run's verbose level and is never written to SessionEntry.verboseLevel. Consults use it instead of verbose: "off". Test: session-preparation.test.ts (one-shot runs at off and the row keeps full; the persistent override still saves).
  • [P2] Workspace. The agent turn gets the consult's already-resolved workspaceDir (restored spawnedWorkspaceDir).
  • [P2] Account and reply target. The turn's run context carries the resolved account, destination (currentChannelId) and thread (currentThreadTs), with deliver: false unchanged. Tests for both: agent-consult-runtime.test.ts.
  • [P2] Voice policy surface. The CLI MCP grant keeps a provider that carries a tool policy (voice, discord-voice, node) when it is not a delivery channel, so the voice filter still drops tts. The same surface also hides ask_user (no question input on a phone line), as on the embedded route. Other non-channel providers stay unset as before. Test: mcp-grant-context.test.ts.
  • Tests. The mock-echo binding case in attempt-execution.cli-mcp.test.ts is removed; the loopback test above covers the grant at the MCP boundary.

Follow-up fix found by the meeting/FaceTime e2e (8711c7b5a)

The first FaceTime e2e (a stand-in plugin with FaceTime's consult parameters, evidence-e2e-surfaces-red-503beb2ae.log) failed on 503beb2ae: FaceTime passes thinkLevel: "off", and on the agent-turn route the command's model selection rejects an explicit level the model lacks, so every FaceTime consult on anthropic/claude-opus-5-5 failed with Thinking level "off" is not supported for anthropic/claude-opus-5-5. Use one of: low, medium, high, xhigh, max, ultra. The embedded runner clamps such a level to the closest supported one, so this was a regression for any FaceTime agent on such a model, embedded or CLI. New command option thinkingOnceClosest lets a one-run level fall through to the attempt's existing clamp, as subagent spawns already do; consults set it. A persistent /think override and other callers still get the error. Test: a new row in model-selection.configured.test.ts ("prefers observed max support"), red with 503beb2ae's model-selection.ts, green after; the helper and Voice Call tests assert the flag. After the fix the FaceTime consult runs at --effort low and the Gateway logs Thinking level clamped to low for anthropic/claude-opus-5-5 (requested off; preference retained).

Follow-up fix found while tracing a Google Meet e2e failure (7f72cb5c7)

Plugin runEmbeddedAgent runs its turn as a detached work continuation ("plugin turns can outlive both the triggering request root and its async work scope"); plugin runCommandFromIngress, which this PR's agent-turn route uses, did not. A meeting's realtime bridge is opened inside the googlemeet.join request, so a consult that reaches the command queue after the request that started it has ended lost its admission with Gateway is temporarily unavailable. Please try again shortly., where the embedded route kept going. runCommandFromIngress now runs its turn as a detached continuation, the same way (src/plugins/runtime/runtime-agent.ts, one wrap). Test: src/plugins/runtime/runtime-agent.ingress-continuation.test.ts (an ingress turn that starts after its parent root and async scope ended), red on 8711c7b5a with GatewayDrainingError at enqueueCommandInLane ← runtime-agent.ts, green after (evidence-unit-ingress-continuation-7f72cb5c7.md); the PR's test-lines allocation goes from 13 to 69 for it. A consult whose tool call itself arrives after that request ended still fails one step earlier, at beginSessionEffect, on main too; see "Pre-existing" under Evidence.

Evidence

Proof status: meeting callback path is blocked by a known bug on main

On this PR alone, as on main, a meeting consult that arrives through the normal provider callback cannot complete, because of a known bug on main that this PR does not touch: a realtime voice consult issued from a callback runs under the already-released root of the request that opened the call (googlemeet.join / googlemeet.create), and consultRealtimeVoiceAgent → beginSessionEffect refuses it with GatewayDrainingError ("Gateway is temporarily unavailable" / "Gateway is draining") before any runner is chosen. It fails the same way on the embedded route on main.

The proof below is sufficient for the change this PR makes: real Claude CLI answers on the phone route with sender-policy refusal; bundled Google Meet and FaceTime plugins running their own code into the agent-turn route with real Claude CLI answers; a live FaceTime call on the exact head by the FaceTime plugin author; and an upgrade from the latest stable release with existing sessions and saved preferences intact. The meeting callback entry is shown too, with the separate fix applied temporarily; without that fix it stays blocked by the bug above, not by this change.

Real model (Claude CLI 2.1.325, operator's own login, 8711c7b5a)

Same isolated QA Gateway as the stub runs (private state, own log file, env -i), with the real claude binary behind a small logging wrapper that gives only the CLI process the operator's HOME so its login works, and logs argv, the CLI's system/init tool list, tool_use names and the final result (no credentials). Twilio and the realtime peer stay simulated; the fixture's consult question is replaced. The anthropic provider base URL points at an unreachable local port, so any embedded fallback could not reach the API. Files: evidence-e2e-real-answer-8711c7b5a.log, evidence-e2e-real-policy-8711c7b5a.log (same runs on 503beb2ae: *-503beb2ae.log).

safe-read-only, caller asks "what is 17 times 23?":

[+21.5s] gateway up; mode=answer; toolPolicy=safe-read-only; claude=REAL CLI via logging wrapper
[+25.8s] consult answered in 3606 ms
FINAL TOOL RESULT: {"text":"17 times 23 is 391."}
real claude system/init: {"claude_code_version":"2.1.325","model":"claude-opus-5-5","apiKeySource":"none",
  "tools":["ToolSearch","mcp__openclaw__memory_get","mcp__openclaw__memory_search","mcp__openclaw__read","mcp__openclaw__voice_call","mcp__openclaw__web_fetch"],
  "mcp_servers":[{"name":"openclaw","status":"connected","source":"dynamic"}]}
real claude result: {"subtype":"success","is_error":false,"num_turns":1,"result":"17 times 23 is 391."}
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-opus-5-5 activeSessions=1
[agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=1643 outBytes=19
"No API key" occurrences: 0
mock-openai requests: 0

owner policy, tools.toolsBySender["*"].deny: ["sessions_send"], tts allowed; the caller asks the agent to relay a message with sessions_send. The requester's own chat turn (first CLI process) has sessions_send, tts and ask_user; the phone consult (last CLI process) has none of them, the model says so, and a direct call on the consult's own loopback grant is refused:

[+35.3s] consult answered in 10437 ms
FINAL TOOL RESULT: {"text":"No, the message wasn't sent, because a tools-by-sender policy blocks the sessions_send tool for this phone session."}
requester chat turn  system/init: 44 tools, sessions_send: true,  tts: true,  ask_user: true
phone consult        system/init: 39 tools, sessions_send: false, tts: false, ask_user: false
phone consult tool_use: ToolSearch "select:mcp__openclaw__sessions", ToolSearch "sessions_send send message to session", mcp__openclaw__session_status
probe on the consult's grant: tools/list 38 tools, sessions_send: false
  tools/call sessions_send -> "Tool not available: sessions_send"
  tools/call gateway       -> "gateway needs the owner's authority, and this turn was not started by the owner. Do not retry gateway."
"No API key" occurrences: 0

(session_status inside the consult shows Runtime: Claude CLI and Auth: api-key (qa-mock-anthropic ...): the QA harness seeds a placeholder Anthropic profile; the CLI itself reports apiKeySource: "none", i.e. its own login.)

Meeting and FaceTime through the bundled plugins (Claude CLI 2.1.325, operator's own login, 7f72cb5c7)

Same isolated QA Gateway and Claude CLI wrapper as the phone run, on a dist built from 095c1ce7e (the same tree as 7f72cb5c7, whose commit message was reworded afterwards). Only the claude process gets the operator's HOME, and the anthropic API base URL is a dead local path (0 requests reached it). This time the bundled plugins run their own code; a test plugin (.artifacts/vci-e2e/surface-real-plugin) stands in only for what has no local equivalent. Three real consults in total (meeting ×2, FaceTime ×1; the meeting log is the second run, which also lists the consult's session row; the first gave the same answer). Files: evidence-e2e-real-meeting-7f72cb5c7.log, evidence-e2e-real-facetime-7f72cb5c7.log, commands in commands-e2e-real-surfaces-7f72cb5c7.md.

Google Meet. googlemeet.join {transport: "chrome", mode: "bidi"} on the bundled google-meet plugin: its Chrome transport, realtime engine and createMeetingRealtimeEngineBindings(...).handleToolCall → consultMeetingAgent → consultRealtimeVoiceAgent (runner: "agent-turn") → google-meet's own api.runtime.agent.runCommandFromIngress (no messageChannel, guest). Faked: browser.request (the Chrome tab, in call with mic on and audio routed), pactl/parec/pacat on PATH (the meeting audio device), and the realtime voice peer, which emits openclaw_agent_consult and records the tool results.

PLUGIN: {"id":"google-meet","origin":"bundled","enabled":true}
googlemeet.join -> {"session":{"id":"meet_...","transport":"chrome","mode":"bidi","agentId":"qa","state":"active",
  "realtime":{"enabled":true,"strategy":"bidi","provider":"vci-realtime","toolPolicy":"safe-read-only"}, ...}}
[plugins] [google-meet] realtime voice bridge starting: strategy=bidi provider=vci-realtime model=provider-default audioFormat=pcm16-24khz
peer: bridge.create tools ["openclaw_agent_consult"]; tool.call {"question":"A participant asks: what is 19 times 21? Answer in one short sentence."}
peer: tool.result {"status":"working",...} {"willContinue":true}
[+24.1s] consult answered in 3513 ms
FINAL TOOL RESULT: {"text":"19 times 21 is 399."}
CONSULT SESSION: {"key":"agent:qa:subagent:google-meet:meet_6d222e4e-...","spawnedBy":"agent:qa:main",
  "agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}
claude argv: --mcp-config $TMP/.../mcp.json --effort medium ... --model claude-opus-5-5 ...
real claude system/init: {"claude_code_version":"2.1.325","model":"claude-opus-5-5","apiKeySource":"none",
  "tools":["ToolSearch","mcp__openclaw__memory_get","mcp__openclaw__memory_search","mcp__openclaw__read","mcp__openclaw__web_fetch"]}
real claude result: {"subtype":"success","is_error":false,"num_turns":1,"result":"19 times 21 is 399."}
MCP probe on the consult's grant: tools ["memory_get","memory_search","read","web_fetch"]; gateway -> "Tool not available: gateway"
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-opus-5-5 activeSessions=1
[agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=1833 outBytes=19
"No API key" occurrences: 0     "cannot admit" occurrences: 0     mock provider requests: 0
googlemeet.leave -> {"found":true,"session":{... "state":"ended" ...}}   (browser: DELETE /tabs/vci-tab-1)

FaceTime (owner). The bundled facetime plugin is loaded and registered with ownerHandles and a realtime config. A test-side Gateway preload (surface-real-preload.mjs, a Node load hook, in memory, no file edited) records the plugin's own register(api) argument and exports its bundled, otherwise unexported startFaceTimeTalkDriver. The test plugin then starts that talk driver for the owner handle with facetime's own api.runtime, config and logger, from its service context (where the facetime-runtime service would create its helper RPC server). Everything after that is the plugin's code: talk driver → createFaceTimeConsultController → handleToolCall → consultRealtimeVoiceAgent {senderIsOwner: true, runner: "agent-turn", thinkLevel: "off"} → facetime's runCommandFromIngress (bundled-plugin owner admission). Faked: the native helper and carrier (no FaceTime.app, no injected helper, no call events), the capture helper (facetime-audio-capture printing its two readiness lines) and sox on PATH, and the realtime peer. The platform check is not faked: it only gates the facetime-runtime service (native helper supervisor), which stays off on Linux; the talk driver and controller do not read process.platform.

PLUGIN: {"id":"facetime","origin":"bundled","enabled":true}
[vci-preload] capturing bundled facetime plugin api
[vci-preload] exporting bundled facetime startFaceTimeTalkDriver
facetime.start {"pluginId":"facetime","runtimeApiUrl":"dist/extensions/facetime/runtime-api.js","realtime":{"provider":"vci-realtime","sessionKey":"main","toolPolicy":"owner"}}
peer: bridge.create tools ["openclaw_agent_consult","facetime_end_call"]; facetime.active
peer: tool.call {"question":"The caller asks: what is 13 times 17? Answer in one short sentence."}
[+26.6s] consult answered in 3762 ms
FINAL TOOL RESULT: {"text":"13 times 17 is 221."}
CONSULT SESSION: {"key":"agent:qa:facetime:vci-facetime-call-1","spawnedBy":"agent:qa:main",
  "agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}
claude argv: --mcp-config $TMP/.../mcp.json --effort low ... --model claude-opus-5-5 ...
real claude system/init: {"claude_code_version":"2.1.325","model":"claude-opus-5-5","apiKeySource":"none","tools":["ToolSearch","WebSearch",
  "mcp__openclaw__agents_wait", ..., "mcp__openclaw__exec","mcp__openclaw__gateway", ..., "mcp__openclaw__secrets", ..., "mcp__openclaw__sessions_send", ...]}
real claude result: {"subtype":"success","is_error":false,"num_turns":1,"result":"13 times 17 is 221."}
MCP probe on the consult's grant: 38 tools incl. automations, exec, gateway, plugins, secrets, sessions_send;
  gateway config.get -> "Action not available: config.get"   (passed the owner gate; config reads are off on this surface)
[agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=2073 outBytes=19
Thinking level clamped to low for anthropic/claude-opus-5-5 (requested off; preference retained).
"No API key" occurrences: 0     "cannot admit" occurrences: 0     mock provider requests: 0

Owner admission: a non-owner turn gets gateway needs the owner's authority, and this turn was not started by the owner before the tool runs (phone run above); the FaceTime consult's call reaches the tool. The earlier stand-in run (evidence-e2e-surfaces-8711c7b5a.log) showed the other side: the same owner consult from a non-bundled plugin is refused with Plugin "vci-surface-consult" cannot admit authenticated owner authority for channel "unknown".

Pre-existing, not changed here. When the peer delivers its tool call from a timer created in its connect() (the async context a provider WebSocket opened by googlemeet.join has) after googlemeet.join has returned, the consult fails before any runner is chosen: consultRealtimeVoiceAgent → beginSessionEffect throws GatewayDrainingError because that request's root is already released. beginSessionEffect sits at the same place in the helper on main (src/talk/agent-consult-runtime.ts:352 at d7d546f29), so this hits the embedded route the same way; the runs above deliver the peer's events from the test plugin's service context instead. File: evidence-e2e-meeting-released-root-7f72cb5c7.log (stub claude, no model turn):

FINAL TOOL RESULT: {"error":"Gateway is temporarily unavailable. Please try again shortly."}
[vci-debug] GatewayDrainingError Error
    at new GatewayDrainingError (dist/gateway-work-admission-*.mjs)
    at beginSessionEffect (dist/session-controller.lifecycle-*.mjs)
    at consultRealtimeVoiceAgent (dist/realtime-session-harness-*.mjs)
    at async consultMeetingAgent (dist/plugin-sdk/meeting-runtime.js)

This is the known main bug described under "Proof status" above (#142610, #202915), with open fixes in #202979 and #142692; this PR leaves it to those.

Meeting through the normal provider callback, with #202979 applied temporarily (Claude CLI, 7f72cb5c7 + #202979)

Same isolated Gateway as the runs above (env -i, private home, state dir, config and log file). Agent main is on anthropic/claude-opus-5-5 with agentRuntime: claude-cli, and the anthropic API base URL is a dead local path, so an answer can only come from the CLI. In the real-model run only the claude process gets the operator's HOME, through a logging wrapper on the Gateway's PATH. The bundled google-meet plugin runs its own code: googlemeet.join {transport: "chrome", mode: "bidi"}, its Chrome transport and PipeWire-Pulse backend check, the realtime engine, then handleToolCall → consultMeetingAgent → consultRealtimeVoiceAgent (runner: "agent-turn") → runCommandFromIngress. Faked, because there is no local equivalent: browser.request (a test plugin loaded through plugins.load.paths, with the browser plugin disabled, acts as a Chrome tab that is in the call with the mic on and audio routed), pactl/parec/pacat stubs on PATH, and the realtime voice provider and peer. What changed from the meeting run above: the peer now sends openclaw_agent_consult through the normal provider callback. The call comes from a timer created in the bridge's connect(), which runs in the async context of the googlemeet.join request, and the timer fires only after the driver has recorded that googlemeet.join returned. It no longer comes from the test plugin's service context. A test-only Gateway preload (an in-memory Node load hook; no file is edited) logs where any GatewayDrainingError is constructed.

#202979 is not part of this PR. It was applied only for these runs: its single commit (8fbc75de3) was cherry-picked onto a throwaway local branch on top of 7f72cb5c7, built with OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build, run, and then deleted. The branch was never pushed. This PR's head is still 7f72cb5c7 (local and fork). The cherry-pick had no textual conflicts. Its production change (consultRealtimeVoiceAgent wrapped in tryBeginGatewayRootWorkAdmission("realtime-voice-agent-consult")) is byte-for-byte #202979. I made one test-only change: on this branch FaceTime consults run as an agent turn, so #202979's new FaceTime test also needs a runCommandFromIngress mock, and it asserts that mock instead of runEmbeddedAgent. Temporary patch versus 7f72cb5c7:

 .../facetime/tests/talk-driver.consult.test.ts     | 144 ++++++++++++++++++++-
 src/talk/agent-consult-runtime.test.ts             | 135 +++++++++++++++++--
 src/talk/agent-consult-runtime.ts                  |  39 +++++-
 3 files changed, 302 insertions(+), 16 deletions(-)

Tests on the temporary branch:

There was one real Claude CLI consult. Files: evidence-run-a-control-7f72cb5c7.log, evidence-run-b-real-cli-7f72cb5c7+202979.log, evidence-run-c-stub-7f72cb5c7+202979.log (the same path as b with the stub claude), and temp-patch.diff.

a. Control, this PR alone (7f72cb5c7, stub claude). Same driver and same callback. The consult is refused at beginSessionEffect before any runner is chosen. The event-loop line shows that the consult runs under the googlemeet.join RPC context after that RPC has already responded:

[2026-11-24T01:17:54.082Z +0.0s] googlemeet.join {url, transport: "chrome", mode: "bidi"} ...
[plugins] [google-meet] realtime voice bridge starting: strategy=bidi provider=vci-realtime model=provider-default audioFormat=pcm16-24khz
12:18:00.168+11:00 [ws] ⇄ res ✓ googlemeet.join 1453ms
[2026-11-24T01:18:00.230Z +6.1s] googlemeet.join returned: {"id":"meet_<id-1>","transport":"chrome","mode":"bidi","state":"active","agentId":"main",
  "realtime":{"enabled":true,"strategy":"bidi","provider":"vci-realtime","toolPolicy":"safe-read-only"},"inCall":true,"audioBackend":"pipewire-pulse"}
peer 01:18:00.088Z: {"event":"bridge.create","tools":["openclaw_agent_consult"]}
peer 01:18:00.088Z: {"event":"connect"}
peer 01:18:00.791Z: {"event":"tool.call","firedFrom":"provider timer created in connect() (googlemeet.join async context)",
  "joinReturnedAt":"2026-11-24T01:18:00.230Z","question":"A participant asks: what is 19 times 21? Answer in one short sentence."}
peer 01:18:00.793Z: {"event":"tool.result","result":{"status":"working",...},"options":{"willContinue":true}}
peer 01:18:01.125Z: {"event":"tool.result","result":{"error":"Gateway is temporarily unavailable. Please try again shortly."}}
tool call fired 561 ms AFTER googlemeet.join returned
FINAL TOOL RESULT: {"error":"Gateway is temporarily unavailable. Please try again shortly."}
12:18:01.100+11:00 [event-loop] main-thread stall: elapsedMs=289 task="gateway:rpc:googlemeet.join" ...
12:18:01.124+11:00 [vci-debug] GatewayDrainingError GatewayDrainingError: Gateway is temporarily unavailable. Please try again shortly.
    at beginSessionEffect (file://<worktree>/dist/session-controller.lifecycle-DM3AE_Z0.mjs:31:4628)
    at consultRealtimeVoiceAgent (file://<worktree>/dist/realtime-session-harness-u80NByCF.mjs:17:4887)
    at async consultMeetingAgent (file://<worktree>/dist/plugin-sdk/meeting-runtime.js:82:2211)
    at async handleToolCall (file://<worktree>/dist/plugin-sdk/meeting-runtime.js:82:1605)
agent turns that reached claude: 0     "No API key": 0     requests to the anthropic URL: 0
googlemeet.leave -> {"found":true,"state":"ended"}

b. 7f72cb5c7 + #202979, real Claude CLI 2.1.325 (operator's own login). Same driver and same callback, firing 600 ms after googlemeet.join returned:

[2026-11-24T01:34:37.983Z +0.0s] googlemeet.join {url, transport: "chrome", mode: "bidi"} ...
12:34:39.167+11:00 [ws] ⇄ res ✓ googlemeet.join 288ms
[2026-11-24T01:34:39.219Z +1.2s] googlemeet.join returned: {"id":"meet_<id-4>","transport":"chrome","mode":"bidi","state":"active","agentId":"main",
  "realtime":{"enabled":true,"strategy":"bidi","provider":"vci-realtime","toolPolicy":"safe-read-only"},"inCall":true,"audioBackend":"pipewire-pulse"}
peer 01:34:39.818Z: {"event":"tool.call","firedFrom":"provider timer created in connect() (googlemeet.join async context)",
  "joinReturnedAt":"2026-11-24T01:34:39.218Z","question":"A participant asks: what is 19 times 21? Answer in one short sentence."}
peer 01:34:39.824Z: {"event":"tool.result","result":{"status":"working",...},"options":{"willContinue":true}}
12:34:43.443+11:00 [agent/cli-backend] cli live session start: provider=claude-cli model=claude-opus-5-5 activeSessions=1
12:34:46.368+11:00 [agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=2950 outBytes=55
peer 01:34:46.574Z: {"event":"tool.result","result":{"text":"Nineteen times twenty-one is three hundred ninety-nine."}}
tool call fired 600 ms AFTER googlemeet.join returned
consult finished in 6756 ms (from tool call)
FINAL TOOL RESULT: {"text":"Nineteen times twenty-one is three hundred ninety-nine."}
CONSULT SESSION: {"key":"agent:main:subagent:google-meet:meet_<id-4>","spawnedBy":"agent:main:main",
  "agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}
claude argv: --mcp-config /tmp/openclaw-cli-mcp-<x>/mcp.json --effort medium ... --print --input-format stream-json --output-format stream-json ...
real claude system/init: {"claude_code_version":"2.1.325","model":"claude-opus-5-5","apiKeySource":"none",
  "tools":["ToolSearch","mcp__openclaw__memory_get","mcp__openclaw__memory_search","mcp__openclaw__read","mcp__openclaw__web_fetch"],
  "mcp_servers":[{"name":"openclaw","status":"connected","source":"dynamic"}]}
real claude result: {"subtype":"success","is_error":false,"num_turns":1,"result":"Nineteen times twenty-one is three hundred ninety-nine."}
"No API key": 0     requests to the anthropic URL ("anthropic-unreachable"): 0     GatewayDrainingError constructed: 0
googlemeet.leave -> {"found":true,"state":"ended"}

Run c (stub claude, same temporary build) takes the same path deterministically. The tool call fires 587 ms after join returned, cli live session start: provider=claude-cli, the consult session row has agentRuntime claude-cli, FINAL TOOL RESULT: {"text":"CLAUDE-CLI-VOICE-OK turn 1"}, and no GatewayDrainingError is constructed.

With this PR alone, a meeting consult delivered through the normal provider callback after googlemeet.join has returned is still refused at beginSessionEffect. That refusal is the known main admission bug (#142610 / #202915), not something this PR changes. With #202979's fresh root admission applied on top, the same callback consult reaches this PR's agent-turn route. Claude CLI answers it on the operator's login (apiKeySource: "none", a claude-cli consult session, no API-key error, nothing sent to the Anthropic API URL) with the actual answer, and service context is never substituted. Nothing in this PR needs to change for the meeting callback path to work once #202979 (or #142692) lands.

Live FaceTime call (run by @omarshahine, 7f72cb5c7)

@omarshahine (FaceTime plugin author) ran the live owner call this PR asked for: an isolated Gateway from the exact 7f72cb5c7 checkout on an Apple Silicon Mac, a claude-cli/claude-opus-5-5 agent, one outbound FaceTime Audio call to the configured owner through the real helper, carrier and FaceTime.app. Reported results (comment):

  • The Gateway logged the expected thinking-level clamp (FaceTime's off → closest supported level) and no Anthropic API-key error.
  • The consult returned a nonempty response.
  • On the recipient side, the call arrived and Lobster spoke a clear answer (confirmed from the voicemail).

This covers the FaceTime entry path that the run above could not: real helper, owner handle check and call events, real audio and realtime provider. Not covered, as he notes: inbound calls, FaceTime video and repeated-call reliability. A later retry on November 21 ended before ringing with a native carrier error (account unsupported / empty destination set) on both the isolated and the installed Gateway, so it is not specific to this branch.

Upgrade from 2026.11.7 (latest stable, stub claude)

npm view openclaw dist-tags → latest: 2026.11.7; npm install [email protected] into a temp prefix and a fresh isolated home (env -i, fake HOME, own OPENCLAW_HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH and log file); agent main on anthropic/claude-opus-5-5 with agentRuntime: claude-cli; a stub claude first on PATH that answers every turn CLAUDE-CLI-VOICE-OK turn N (no model, no login); the anthropic API base URL is a dead local port (http://127.0.0.1:9/anthropic-unreachable), so an embedded-route attempt shows up as a failed fetch. Voice Call (@openclaw/[email protected] from ClawHub, then replaced by this branch's packed build) runs on the mock carrier with realtime and sessionScope: "main", so consults run in the shared agent:main:main session; a fake realtime peer emits openclaw_agent_consult. On 2026.11.7 the main session gets verboseLevel: "full", a chat turn and a phone consult; then the Gateway is stopped and the same home is switched to this branch. File: evidence-upgrade-2026.11.7-to-7f72cb5c7.log.

# 2026.11.7
$ openclaw --version                         OpenClaw 2026.11.7 (e31bbf0)
$ openclaw gateway call sessions.patch {key: agent:main:main, verboseLevel: full}
{"ok":true,"key":"agent:main:main","sessionId":"<sessionId>","verboseLevel":"full","resolved":{"modelProvider":"anthropic","model":"claude-opus-5-5","agentRuntime":{"id":"claude-cli","source":"model"}}}
$ openclaw gateway call agent {sessionKey: agent:main:main}
{"status":"ok","text":["CLAUDE-CLI-VOICE-OK turn 1"],"provider":"claude-cli","model":"claude-opus-5-5","sessionKey":"agent:main:main","sessionId":"<sessionId>"}
$ node consult-client.mjs   (phone consult, sessionScope main)
[+72.7s] consult answered in 72609 ms
FINAL TOOL RESULT: {"error":"Couldn't connect to the AI service. Check your connection, then try again. ..."}
[provider-transport-fetch] [model-fetch] start provider=anthropic api=anthropic-messages model=claude-opus-5-5 method=POST url=http://127.0.0.1:9/anthropic-unreachable/v1/messages ... sessionKey="agent:main:main" runId="voice-realtime-consult:..."
[agent/embedded] embedded run agent end: ... isError=true model=claude-opus-5-5 provider=anthropic failoverReason=timeout
[agent/embedded] transient same-model retry 1/8 ... 6/8 for anthropic/claude-opus-5-5   (7 requests to the dead URL)
[agent/embedded] embedded run failover decision: ... decision=surface_error reason=timeout ... from=anthropic/claude-opus-5-5
[voice-call] realtime tool call failed callId=... tool=openclaw_agent_consult elapsedMs=70162
$ openclaw sessions --all-agents --json
{"key":"agent:main:main","sessionId":"<sessionId>","verboseLevel":"full","agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}
state written by 2026.11.7: state/openclaw.sqlite schema v36, agents/main/agent/openclaw-agent.sqlite schema v38

# this branch, same home
$ openclaw --version                         OpenClaw 2026.11.5 (7f72cb5)
$ openclaw config validate                   Config valid
  "Your OpenClaw config was written by version 2026.11.7, but this command is running 2026.11.5."
  warning: installed voice-call requires plugin API >=2026.11.7, but this host is 2026.11.5; skipping discovery
$ openclaw doctor --fix --non-interactive    Doctor complete. exit=0
  Saved pre-migration SQLite backup: $OPENCLAW_HOME/.openclaw/agents/main/agent/openclaw-agent.sqlite.pre-startup-migration-<id>.bak
  Saved pre-migration SQLite backup: $OPENCLAW_HOME/.openclaw/state/openclaw.sqlite.pre-startup-migration-<id>.bak
  Retained immutable worker provider resource receipts (v37) ... Original worker provisioning source retained across recovery (v40)
  Upgraded agent database schema in $OPENCLAW_HOME/.openclaw/agents/main/agent/openclaw-agent.sqlite: v38 -> v43.
state after Doctor: state/openclaw.sqlite schema v40, openclaw-agent.sqlite schema v43
$ openclaw sessions --all-agents --json
{"key":"agent:main:main","sessionId":"<sessionId>","verboseLevel":"full","agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}
$ openclaw plugins install npm-pack:<branch voice-call 2026.11.5 tgz> --force --accept-capabilities
$ openclaw config validate                   Config valid (warning: bundled voice-call of this checkout overrides the installed copy)
$ openclaw gateway run ...
[state/agent-admission] agent database recovered after background inspection and preparation
[state/agent-admission] agent database background integrity verification complete
[gateway] session: transcript facts backfill pass complete: 28 rows filled, 0 rows skipped, 1/1 sessions completed
$ node consult-client.mjs
[+4.7s] consult answered in 4527 ms
FINAL TOOL RESULT: {"text":"CLAUDE-CLI-VOICE-OK turn 2"}
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-opus-5-5 activeSessions=1
[agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=114 outBytes=26
"No API key" occurrences: 0     requests to the anthropic URL: 0
$ openclaw gateway call chat.history {sessionKey: agent:main:main}   (summarized)
{"sessionId":"<sessionId>","messages":6}
  user: Hello from the upgrade proof
  assistant (claude-cli): CLAUDE-CLI-VOICE-OK turn 1
  user: Live voice request from the caller during a live phone call. ...
  custom: Your request couldn't be completed: Couldn't connect to the AI service. ...
  user: Live voice request from the caller during a live phone call. ...
  assistant (claude-cli): CLAUDE-CLI-VOICE-OK turn 2
$ openclaw gateway call agent {sessionKey: agent:main:main}
{"status":"ok","text":["CLAUDE-CLI-VOICE-OK turn 3"],"provider":"claude-cli","model":"claude-opus-5-5","sessionKey":"agent:main:main","sessionId":"<sessionId>"}
$ openclaw sessions --all-agents --json   (after the consult and the chat turn on the shared session)
{"key":"agent:main:main","sessionId":"<sessionId>","verboseLevel":"full","agentRuntime":{"id":"claude-cli","source":"model"},"modelProvider":"anthropic","model":"claude-opus-5-5"}

Existing stored data still loads and works after the upgrade. The session row written by 2026.11.7 keeps its key, its id and its saved preferences (verboseLevel: "full", agentRuntime: claude-cli) through the switch, Doctor, a Gateway restart, a phone consult and a new chat turn on the shared session. Its transcript, including the failed 2026.11.7 consult, reads back on the branch. Doctor migrates the 2026.11.7 databases forward (state v36 → v40, agent v38 → v43) and saves a backup of each first. This branch's base is newer than the 2026.11.7 release branch, so this is an upgrade, not a downgrade, even though the checkout reports 2026.11.5. On 2026.11.7 the same consult went to the embedded anthropic runner and failed after 70 s with 7 refused requests. On a real install without an API key, that error is No API key found. This is the bug this PR fixes. On the branch the consult is answered by claude-cli in 4.5 s, and no request goes to the API.

Notes: the branch build reports 2026.11.5, so Doctor and the branch Gateway skip the installed @openclaw/[email protected] (pluginApi >=2026.11.7). Installing the branch's packed build saved the install but exited 1 with Plugin "voice-call" has no authoritative package-owner metadata (an install-record check in a source checkout). In this checkout the bundled dist/extensions/voice-call of the same commit takes precedence over any installed copy (duplicate plugin id detected; global plugin will be overridden by bundled plugin), so the consult ran the branch's Voice Call code either way. The fake peer issues the Twilio stream session with the internal call id on 2026.11.7 and with the provider call id on the branch, because the stream identity check differs between the two (see the QA fixture note under Gaps).

Stub e2e (phone)

Isolated Gateway (QA gateway child, private state, mock voice provider, mock realtime bridge that calls openclaw_agent_consult), stub claude on PATH speaking stream-json and calling the real MCP loopback. No real model or provider credential.

Scenario Base abd4b4fc6 This branch
Claude CLI agent, phone consult embedded run → anthropic 401 / "Couldn't sign in to the AI service"; stub claude never got a turn answered by claude-cli in 2.0–4.2 s; 0 "No API key"
safe-read-only tools on the CLI route n/a MCP tools exactly memory_get, memory_search, read, voice_call, web_fetch; write → "Tool not available"; voice_call initiate_call → "This realtime consult may only end_call."
owner tool policy, guest caller n/a sessions_send to another session accepted; owner-only gateway refused ("not started by the owner"); voice_call still end_call-only
owner policy + toolsBySender["*"].deny: [sessions_send], tts allowed first commit (1698a745c): MCP tools/list includes sessions_send and tts; sessions_send → accepted sessions_send and tts not listed; sessions_send → "Tool not available: sessions_send"; voice_call still end_call-only
Hangup during a running CLI turn n/a call finalized → turn aborted ~0.5 s later ("consult owner was cancelled"), no model fallback (caller_signal_aborted), claude got SIGTERM
Embedded (mock model) agent, phone consult answered, 2.0 s answered, 2.4 / 3.2 s on quiet runs (6.6–8.2 s on runs with host I/O stalls)

Latency (gap called out in the task): the consult now goes through typed-turn preparation (session, model and runtime selection, workspace bootstrap) instead of a direct embedded run. On quiet runs with an embedded (mock) agent, base answered in 2.0 / 2.4 s and this branch in 2.4 / 3.2 s from media start to the final tool result, so expect up to roughly half a second more. Runs on this shared host that hit I/O stalls ranged 5.8–15.9 s on base and 6.6–8.2 s on the branch, so treat the numbers as indicative. Queueing: the turn queues only behind other turns of the same consult session (per call, per meeting, per FaceTime call), not behind the requester's chat, because the consult session is its own key.

Captured output (redacted)

Base abd4b4fc6, Claude CLI agent, toolPolicy: "safe-read-only":

[+20.5s] media stream started; realtime bridge will call openclaw_agent_consult
FINAL TOOL RESULT: {"error":"⚠️ Couldn't sign in to the AI service. Sign in again under Models in the OpenClaw app or run `openclaw configure`."}
--- stub claude turns ---
(none)
[provider-transport-fetch] [model-fetch] response provider=anthropic api=anthropic-messages model=claude-opus-5-5 status=401 ... sessionKey="agent:qa:voice:<phone>" runId="voice-realtime-consult:..."
[agent/embedded] embedded run failover decision: ... decision=surface_error reason=auth ... from=anthropic/claude-opus-5-5
[voice-call] realtime tool call failed callId=... tool=openclaw_agent_consult elapsedMs=2089

(The QA harness seeds a placeholder Anthropic profile, so base gets a 401 instead of No API key found; same embedded path either way.)

This branch, same setup:

[+45.1s] media stream started; realtime bridge will call openclaw_agent_consult
[+49.3s] consult answered in 4212 ms
FINAL TOOL RESULT: {"text":"CLAUDE-CLI-VOICE-OK turn 1"}
[agent/cli-backend] cli live session start: provider=claude-cli model=claude-opus-5-5 activeSessions=1
[agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=345 outBytes=26
stub argv: --mcp-config $QA_TMP/openclaw-cli-mcp-*/mcp.json ... --model claude-opus-5-5 --tools ToolSearch --allowedTools mcp__openclaw__web_fetch,mcp__openclaw__memory_search,mcp__openclaw__memory_get,mcp__openclaw__voice_call,mcp__openclaw__read --session-id ...
stub turn: {"turn":1,"promptHasConsult":true,"promptHead":"... Live voice request from the caller during a live phone call. ..."}
stub MCP: {"tools":["memory_get","memory_search","read","voice_call","web_fetch"],
           "initiate": {"text":"{\"error\":\"This realtime consult may only end_call.\"}","isError":true},
           "write":    {"text":"Tool not available: write","isError":true}}
"No API key" occurrences: 0

toolPolicy: "owner", with an existing requester session:

[+46.4s] requester session turn: {"status":"ok", ...}
[+48.6s] consult answered in 2004 ms
stub MCP: "initiate":  "This realtime consult may only end_call."
          "write":     "Successfully wrote 17 bytes to stub-write.txt"
          "relay":     sessions_send -> {"status":"accepted","sessionKey":"agent:qa:main","targetDisposition":"queued"}
          "ownerOnly": gateway -> "gateway needs the owner's authority, and this turn was not started by the owner. Do not retry gateway."

owner policy with tools.toolsBySender["*"].deny: ["sessions_send"] and tts in alsoAllow (stub calls tools/list, then sessions_send):

first commit 1698a745c:
  tools/list (41 tools) includes sessions_send: True, tts: True
  sessions_send -> {"runId":"a990b631-a3bc-4e35-b15b-28ec1a604f72","status":"accepted","sessionKey":"agent:qa:main","targetDisposition":"queued","delivery":{"status":"skipped"}}
this branch 503beb2ae:
  tools/list (38 tools) includes sessions_send: False, tts: False, voice_call: True
  (the 3 tools fewer than the first commit: sessions_send, tts, ask_user)
  sessions_send -> Tool not available: sessions_send
  voice_call initiate_call -> {"error":"This realtime consult may only end_call."}

Hangup while the Claude CLI turn is running:

[+38.1s] Claude CLI turn is running; hanging up (closing media stream + webhook hangup)
[voice-call/lifecycle] Call finalized callId=... endReason=hangup-user          11:56:39.150
[diagnostic] lane task error: lane=cli:claude-cli:owner:... error="Realtime native consult owner was cancelled."   11:56:39.681
[model-fallback/decision] model fallback chain stopped: reason=caller_signal_aborted candidate=anthropic/claude-opus-5-5
stub: {"signal":"SIGTERM"}

Tests: every new test fails against the base production files and passes on this branch (helper: agent-turn dispatch, hangup cancellation, refusal of embedded tool context; plugin ingress: channel-less turns and tool-binding ownership; CLI attempt and MCP grant carry tool bindings; Voice Call, meeting-bot and FaceTime callers opt in; the meeting shutdown fixture now drives the agent turn). Broader run on this branch: pnpm test src/talk src/gateway/talk src/meeting-bot src/plugins/registry-runtime.channel-ingress.test.ts src/plugins/runtime src/agents/cli-runner src/agents/command/attempt-execution*.test.ts src/gateway/mcp-http.test.ts src/gateway/tool-resolution.test.ts → 239 files, 2,722 tests passed (gateway project incl. all Talk tests: 691); pnpm test extensions/voice-call extensions/facetime → 91 files passed. pnpm tsgo:core:test and pnpm tsgo:extensions:test pass. Changed-file wall times with --maxWorkers=1 on a loaded host, mostly transform: helper 17.3 s, plugin ingress 21.8 s, CLI attempt 17.1 s, MCP grant / tool authority 13.7 s, meeting consult 11.2 s, Voice Call runtime 34.0 s, FaceTime consult 7.5 s. Review-fix batch (503beb2ae): the 11 new or changed test cases fail with the first commit's production files and pass after (.artifacts evidence: helper agent-turn shape and reply target, one-shot verbose, capped-grant sender policy, Voice Call remote party, MCP loopback tools/list, grant policy surface); touched suites src/talk, src/agents/cli-runner, src/agents/command, src/gateway/mcp-http*, src/gateway/tool-resolution*, src/meeting-bot, plugin ingress → 211 files, 2,262 tests passed; new loopback test 1.2 s wall in-test (141 s with cold transform). Net test lines against main +469 after 7f72cb5c7: over the 400-line allowance by 69, so the PR adds config/test-lines-allocations/202209-voice-consult-agent-turn.txt (69) for the regression tests of three bridges, the review fixes, the thinking clamp and the ingress continuation. pnpm check:test-lines-ratchet: "Test lines OK. Net test lines: +469; allowance: 400; allocation credit: 69."

Checks for 7f72cb5c7: pnpm tsgo:core, pnpm tsgo:core:test, oxlint and format on the two touched files, check-test-mock-exports, check:test-lines-ratchet, git diff --check; pnpm test src/plugins/runtime src/plugins/registry-runtime.channel-ingress.test.ts src/talk src/meeting-bot extensions/facetime extensions/google-meet/src/realtime.process.test.ts --maxWorkers=1 → 138 files, 1,289 tests passed, 3 skipped. Earlier checks (rerun on 503beb2ae; for 8711c7b5a: tsgo:core, tsgo:core:test, tsgo:extensions:test, oxlint and format on the touched files; pnpm test src/agents/command src/talk extensions/facetime src/meeting-bot → 122 files, 1,300 tests passed, 3 skipped; extensions/voice-call/src/runtime.test.ts 29 passed): pnpm tsgo:core, pnpm tsgo:core:test, pnpm tsgo:extensions, pnpm tsgo:extensions:test, check-test-mock-exports, oxlint on touched core files and extensions/voice-call, extensions/facetime, format check, git diff --check.

Gaps:

  • Meeting (Google Meet, bundled plugin): no Chrome, Google account, real meeting audio or realtime voice provider; the Chrome tab (browser.request), the PipeWire-Pulse device (pactl/parec/pacat) and the realtime peer are test fakes. The normal provider-callback path is now shown end to end with real Claude CLI, but only with fix(talk): run realtime voice consults under a fresh root admission #202979 applied temporarily on top of 7f72cb5c7 ("Meeting through the normal provider callback" above; fix(talk): run realtime voice consults under a fresh root admission #202979 is not part of this PR). On this PR alone, that path is still refused at beginSessionEffect by the known main bug (Meeting voice consult always fails with "Gateway is draining": inherits released root-work admission context #142610 / [Bug]: FaceTime realtime calls: openclaw_agent_consult is always refused with "Gateway is temporarily unavailable" (consult runs under a released root) #202915), and the fix belongs to fix(talk): run realtime voice consults under a fresh root admission #202979 / fix(meeting): own a fresh root admission for agent consults #142692. Teams and Zoom share createMeetingRealtimeEngineBindings but were not run.
  • FaceTime (bundled plugin): live outbound owner call covered by @omarshahine on 7f72cb5c7 ("Live FaceTime call" above). Still not covered: inbound calls, video, repeated-call reliability. The run on this host had no Mac, FaceTime.app, injected helper, carrier or real call. The helper's call events and its owner-handle check are not exercised: the test plugin starts the bundled talk driver for the configured owner handle directly, with the plugin's own runtime captured by a test-side load hook (no file edited). Audio (facetime-audio-capture, sox) and the realtime peer are fakes. The platform check is not faked; the facetime-runtime service stays off on Linux. A live FaceTime call needs a dedicated Apple Silicon Mac with SIP debugging protections reduced for the helper injection, which this setup does not have.
  • Real-model runs: phone (answer, sender policy; 8711c7b5a), meeting ×2 and FaceTime ×1 (7f72cb5c7), all on one operator login with simulated transports; plus one live FaceTime call by @omarshahine on 7f72cb5c7 with real transport. The phone runs predate 7f72cb5c7; the stub phone answer and hangup e2e were rerun on 7f72cb5c7 (evidence-e2e-{answer,hangup}-7f72cb5c7.log: answered by claude-cli; hangup → Realtime native consult owner was cancelled., caller_signal_aborted, claude got SIGTERM).
  • Upgrade proof (from 2026.11.7, the latest stable) uses the stub claude and ran on the exact head 7f72cb5c7. The branch build reports version 2026.11.5, so the installed @openclaw/[email protected] is skipped until replaced with the branch's packed build; in this checkout the bundled dist/extensions/voice-call of the same commit takes precedence over the installed copy, so the branch code ran either way.
  • Stub embedded-agent e2e was last run on 503beb2ae; later commits change only the thinking-level handling and plugin ingress admission for runCommandFromIngress, which the embedded route does not use.
  • The stock QA producer test/e2e/qa-lab/runtime/voice-call-gateway.ts fails on current main before this change: its fixture issues the Twilio stream session with the internal call id, which the realtime handler now rejects ("Call identity does not match stream session"). The e2e above patched its copy of the fixture to issue with the provider call id. Not fixed here.

Simplify pass: the plugin ingress gate stays inline in its existing owner (an earlier draft moved it to a new module). Delta against the merge base (7f72cb5c7): production +299 / −132, tests +505 / −36, docs +19 / −5, config +2. The runner option is kept rather than switching every caller, because Talk adapts embedded tool context and has its own pending rework, and third-party SDK callers keep today's default.

Maintainer validation at a5e3371 (2026-11-24)

The branch merged main at cc79ae6 in 15a238d. Commit a5e3371 reverses a temporary, synthetic-fixture-only CI probe; its source tree is identical to 15a238d. The PR still changes the same 36 files. The exact-head CI run completed with two failed test shards, both traced to behavior reproducible on main:

  • Beam adoption: PR job 139002954370 failed src/gateway/server.beam-owned-view.test.ts at line 591 with UNAVAILABLE. The temporary probe on the preceding head exposed a stale published state database lifecycle during plugin-state lookup. On trusted local main at 7071b82, the Beam file passes alone but fails with the same assertion when run after server.private-completion.test.ts and server.visible-spawn-fallback.product-proof.test.ts, the preceding files in the CI shard. Command: pnpm test src/gateway/server.private-completion.test.ts src/gateway/server.visible-spawn-fallback.product-proof.test.ts src/gateway/server.beam-owned-view.test.ts --maxWorkers=1. The Beam test, handler, state lifecycle, and test runner files are unchanged between scheduled main revision e80be914 and the PR CI tested base 79e42e0. This is a test module lifecycle failure exposed by file order; the production lifecycle guard remains in place.
  • MCP archive final effect: PR job 139002954288 failed the profile-revoked assertion at line 144 because the archive completed. The scheduled main CI run 45553662953, job 139000942605, on e80be914, failed the same test with the same successful archive response. e80be914 is an ancestor of the PR CI tested base 79e42e0; the test, MCP runtime, grant store, tool resolution, and in-process authority files are unchanged between those revisions. The test passes alone on local main, so the failure is sensitive to its run context.

The PR CI report calls both jobs unknown because the latest scheduled main run had no matching job names, so it did not compare test signatures. The evidence above identifies the matching failures without claiming the PR CI passed. The required maintainer security approval for this revision is still pending.

Maintainer conflict resolution at c23749e (2026-11-26)

The prepared branch fast forwarded from a5e3371 to signed merge commit c23749e, incorporating main at 1c59502. The eight resolved conflicts preserve sender-derived ownership for named plugin channels, the trusted owner claim for channel-less bridges, main's host-only thinking normalization, the consult's one-run thinking choice, and session-runtime workspace preparation for embedded consults. The PR still changes 36 files relative to the incorporated main tip.

Local preparation passed prepare-validate-commit, git diff --check, formatting on the 11 conflict-touched files, and scoped local review with no P0/P1 finding. The native prepare-gates recorded github_pending for c23749e; contributor code was not executed locally. The branch was published by a normal fast forward push, and native prepare-push verified the remote head and wrote its publication receipt without a second push. Exact-head CI and security review are pending. The prior-head failures above remain attributed to main; the current-head CI result will be assessed separately.

Exact-head CI correction at bbc1221 (2026-11-26)

CI on c23749e failed three PR checks and repeated the same inherited Beam assertion documented above. Signed follow-up bbc1221 repairs the three branch failures together:

  • Passes the plugin's senderIsOwner field under its original name through ingress admission. This preserves the existing trusted bridge claim and satisfies main's owner-producer boundary rule. Focused boundary lint passed locally.
  • Removes a stale FaceTime test expectation that the plugin sends senderIsOwner: true. The same test already asserts that the plugin omits the field so the host decides owner from the admitted sender.
  • Updates the justified test-line allocation from 69 to 81. CI measured +482 net test lines against its current base before the one-line test removal; the correction leaves +481, requiring 81 above the 400-line allowance. These are the existing phone, meeting, FaceTime, and ingress regression tests described in the allocation record.

The normal signed commit hook passed with frozen root dependencies installed in the isolated prep worktree and package scripts disabled. The correction fast forwarded the contributor branch without force. Fresh exact-head CI is pending. The native review refresh on the mounted worktree was stopped after its full transition verification and a slow clean-tree scan; its exact operation lock was recovered, and the transition journal and earlier preparation receipts remain intact. No merge request has been submitted. Required human security-sensitive review remains pending.

Beam test-runner fix at 4a83427 and test-line allocation at 7789990 (2026-11-28)

  • 4a83427 fixes the inherited server.beam-owned-view failure documented above. Non-isolated test workers now evict natively required repository sources (outside node_modules) after each file, so a later file no longer reaches a copy bound to the previous file's retired state lifecycle. The change is in src/plugins/native-module-require.ts (clearNativeRepositorySourceModulesForTest) and test/non-isolated-runner.ts. Cause, local before/after runs and checks: fix(voice): answer phone, meeting and FaceTime consults on Claude CLI agents #202209 (comment). The Beam shard passed at 4a83427.
  • 7789990 raises the justified test-line allocation from 81 to 105. CI measured 505 new test lines against the 400-line allowance. The extra 24 lines cover the regression test that verifies native repository modules are evicted between test files while dependencies stay cached.

@clawsweeper

clawsweeper Bot commented Nov 20, 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 docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call gateway Gateway runtime agents Agent runtime and tooling plugin: file-transfer plugin: facetime FaceTime plugin size: L labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Maintainer security changes approved

A maintainer approved this revision with an explicit security approval comment.

A later push requires a fresh approval comment for an external contributor's PR.

@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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. labels Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Routes phone, meeting, and FaceTime consultations through normal agent turns so they honor the configured runtime and fallbacks.

Example: A realtime phone caller asks a Claude CLI agent, “What is 17 times 23?”

  • Before: The consultation calls the Anthropic API directly and fails without an API key.
  • After: The configured Claude CLI runtime answers, “17 times 23 is 391.”

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, production-path-proven repair with no new blocking finding; current-head broad CI awaits maintainer revision approval.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Supplied Gateway logs exercise real Claude CLI consultations and policy enforcement, and Omar Shahine confirms live FaceTime delivery; the meeting callback limitation is independently demonstrated and tracked, while the upgrade capture preserves existing sessions and preferences.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Voice callers hear an authentication error although typed messages to their Claude CLI agent work.
Reason: The failure remains on main, the SDK expansion has a recorded owner decision, and the patch preserves existing embedded callers.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR fixes an active voice-routing bug that the merged browser Talk fix leaves untouched; no new blocking code defect was found.

Reviewed head: 4a834277db79a28af6a2224c4d07d97d5d5c201f

Before merge

  • Await maintainer action - An authorized maintainer must review the sensitive changes and approve head 4a83427 through the enforced current-revision approval gates.

Findings

None.

Agent review details

How this fits together

Voice bridges pass spoken requests, session context, sender identity, and tool limits into the shared consultation runtime, which returns speakable agent output.

flowchart LR
  A[Phone meeting or FaceTime] --> B[Shared consult runtime]
  B --> C[Plugin ingress admission]
  C --> D[Agent command owner]
  D --> E[Configured agent runtime]
  E --> F[Policy scoped MCP tools]
  E --> G[Speakable result]
  G --> A
Loading

Technical review

Best possible solution:

Use the existing command owner for these bridges while retaining the public embedded default and leaving callback admission to its separately tracked repair.

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

Current-main source confirms that these bridges bypass configured runtime selection, and supplied Gateway captures demonstrate the failing embedded route; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Reusing normal agent command execution addresses runtime selection at its existing owner, with explicit compatibility for embedded SDK callers and preserved sender and tool restrictions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared voice consultation runner changes intended behavior with a stated reason (e2f1395: Centralized Talk, Google Meet, and phone consultation policy and execution on the embedded runner.)
  • Plugin ingress ownership keeps the original intent (e968a68: Named-channel turns derive owner authority from the authenticated sender and commands.ownerAllowFrom; this rule remains intact alongside the approved channel-less contract.)
  • CLI sender policy keeps the original intent (9698a5b: Preserved requester restrictions across execution surfaces; the patch extends that same policy to capped CLI grants without node execution.)
  • Native module lifecycle cleanup keeps the original intent (81fd14c: Released captured native modules and retained load errors at disposal; the added test-worker cleanup applies corresponding retirement between file generations.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f78878c adds src/talk/agent-consult-runtime.ts:248 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f78878c8d012; files: src/talk/agent-consult-runtime.ts)
  • Omar Shahine: Raw commit 88c56ec adds extensions/facetime/src/talk-consult-controller.ts:313 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 88c56ec432a8; files: extensions/facetime/src/talk-consult-controller.ts)
  • Ayaan Zaidi: Raw commit bec7b09 adds src/talk/agent-consult-runtime.ts:274 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bec7b094d19f; files: src/talk/agent-consult-runtime.ts)

PR surface

Source +193, Tests +515, Docs +13, Other +2. Total +723 across 39 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 20 342 149 +193
Tests 15 553 38 +515
Docs 3 24 11 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 39 921 198 +723

Preflight source

Source 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

Metric Value Why it matters
Production versus test changes Production +342/-149; tests +543/-38; test support +10/-0 Growth covers runtime routing and distinct sender-policy, call-binding, preference, cancellation, and ingress-lifetime boundaries.

Root-cause cluster

Relationship: same_root_cause
Canonical: #202208
Summary: This PR owns the three bridge runtime-routing failures; browser Talk routing and released-root callback admission have separate implementations and work items.

Members:

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • merge-risk: 🚨 compatibility: The PR additively widens the public plugin ingress contract and changes bridge runtime selection; the SDK direction is explicitly accepted, and existing embedded callers retain their default.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 (8 earlier review cycles)
  • reviewed 2026-11-20T03:34:51.801Z sha 1fd6919 :: needs real behavior proof before merge. :: [P1] Preserve sender restrictions on phone consultations through MCP | [P2] Keep speech verbosity suppression out of saved preferences | [P2] Pass the resolved consultation workspace to command execution | [P2] Carry the resolved account and reply target into the turn | [P2] Preserve the voice policy surface in CLI MCP grants
  • reviewed 2026-11-20T06:39:49.514Z sha 8711c7b :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-20T06:47:31.262Z sha 8711c7b :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-20T08:48:14.355Z sha 7f72cb5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-23T22:34:29.325Z sha 7f72cb5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-23T23:34:09.740Z sha 7f72cb5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-24T01:52:07.784Z sha 7f72cb5 :: blocked before merge. :: none
  • reviewed 2026-11-25T06:38:01.096Z sha a5e3371 :: blocked before merge. :: none

Reviewed November 27, 2026, 8:05 AM ET / 13:05 UTC (Revision 9).

Voice Call, meeting-bot and FaceTime consults ran through runEmbeddedAgent with an explicit provider/model, so agents whose model runs on Claude CLI failed with "No API key found for provider anthropic". consultRealtimeVoiceAgent now accepts runner: "agent-turn", which runs the consult as a turn of the prepared consult session through runCommandFromIngress, the path typed messages and Discord voice use. The three callers opt in; Talk keeps the embedded runner.

Plugin ingress admits channel-less turns (owner only for bundled or trusted official plugins) and tool bindings only for the plugin's declared tools. The Claude CLI loopback grant carries tool bindings, so voice_call stays bound to the live call.
… agent-turn consults

Review fixes for the agent-turn consult runner:

- A Gateway-launched CLI run's MCP grant resolves requester policy like the embedded run, so a senderless caller gets the toolsBySender "*" entry even when a capped tool set drops node exec. Voice Call also passes the remote party's number as the consult's sender.
- The CLI MCP grant keeps a tool-policy surface that is not a delivery channel ("voice"), so the voice tool filter (tts) still applies.
- Consults suppress verbose output with a new one-run verboseOnce instead of the persistent verbose override, which saved "off" to a shared session.
- The agent turn gets the consult's resolved workspace and the delivery account, destination and thread, still with deliver false.
A consult's thinking level is a one-run choice the bridge makes for every
model: FaceTime always asks for "off", and Voice Call passes
realtime.consultThinkingLevel. The embedded runner clamps a level the model
lacks to its closest one; the agent-turn route instead failed the turn
("Thinking level "off" is not supported for anthropic/claude-opus-5-5"), so
every FaceTime consult on Claude Opus 5.5 failed.

New command option thinkingOnceClosest lets a one-run level fall through to
the attempt's clamp, as subagent spawns already do. Consults set it. A
persistent /think override and other callers still get the error.

Adds a test-lines allocation of 13 lines for the PR's regression tests.
@hannnnn-l
hannnnn-l force-pushed the fix/voice-consult-ingress branch from 1fd6919 to 8711c7b Compare November 20, 2026 06:31
@hannnnn-l

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Nov 27, 2026
@hannnnn-l

Copy link
Copy Markdown
Contributor Author

@omarshahine thanks for merging main into the branch. I've pushed a fix for the remaining red test (server.beam-owned-view): a test-runner isolation bug that already reproduces on main. The cause, the fix and before/after runs are in #202209 (comment).

ClawSweeper re-reviewed head 4a834277d (4/6, no findings). Because the push came from a fork, CI is still waiting on "Approve and run workflows". When you have a moment, could you approve the workflow runs for 4a834277d so CI can run again, and give the security-sensitive approval if you're happy with the change? Thanks!

@omarshahine omarshahine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Beam shard passed at 4a83427. The test-line budget check reports 505 new test lines. The default allowance is 400 and the current allocation is 81, so the check needs 24 more lines of credit.

Please update config/test-lines-allocations/202209-voice-consult-agent-turn.txt with this change.

-81
+# Native source module eviction prevents stale Beam state between non-isolated test files.
+105

Please also add this reason to the PR description. The allocation covers the regression test that verifies native repository modules are evicted between test files while dependencies stay cached.

@hannnnn-l

Copy link
Copy Markdown
Contributor Author

@omarshahine thanks for approving the runs. I've pushed 7789990 with your exact allocation change (81 → 105, plus the reason line) and added the reason to the PR description under "Beam test-runner fix at 4a83427 and test-line allocation at 7789990". Because the push came from a fork, CI on 7789990 is waiting for workflow approval again.

@omarshahine

Copy link
Copy Markdown
Contributor

⚠️ Maintainer security review required

This external contributor PR changes sensitive security components. A maintainer must review these changes before merging.

Current SHA: 77899905ada789887d4571387df309037245084c

These sensitive security changes were made:

  • src/agents/cli-runner/tool-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/tool-resolution-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-security-sensitive-change

A later push requires a fresh approval comment.

/allow-security-sensitive-change

@omarshahine

Copy link
Copy Markdown
Contributor

/allow-security-sensitive-change

@omarshahine
omarshahine merged commit 75ad0b7 into openclaw:main Nov 28, 2026
150 of 151 checks passed
@omarshahine

Copy link
Copy Markdown
Contributor

Merged via squash.

@hannnnn-l

Copy link
Copy Markdown
Contributor Author

@omarshahine thank you for merging this, and for all the help getting it there: the live FaceTime test, the SDK/security decision, reconciling with main, approving the CI runs and pointing out the exact test-line allocation fix. Phone, meeting and FaceTime consults on Claude CLI agents should now just work. Much appreciated!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
… agents (openclaw#202209)

* fix(voice): run phone, meeting and FaceTime consults as agent turns

Voice Call, meeting-bot and FaceTime consults ran through runEmbeddedAgent with an explicit provider/model, so agents whose model runs on Claude CLI failed with "No API key found for provider anthropic". consultRealtimeVoiceAgent now accepts runner: "agent-turn", which runs the consult as a turn of the prepared consult session through runCommandFromIngress, the path typed messages and Discord voice use. The three callers opt in; Talk keeps the embedded runner.

Plugin ingress admits channel-less turns (owner only for bundled or trusted official plugins) and tool bindings only for the plugin's declared tools. The Claude CLI loopback grant carries tool bindings, so voice_call stays bound to the live call.

* fix(voice): keep sender policy, voice surface and session settings on agent-turn consults

Review fixes for the agent-turn consult runner:

- A Gateway-launched CLI run's MCP grant resolves requester policy like the embedded run, so a senderless caller gets the toolsBySender "*" entry even when a capped tool set drops node exec. Voice Call also passes the remote party's number as the consult's sender.
- The CLI MCP grant keeps a tool-policy surface that is not a delivery channel ("voice"), so the voice tool filter (tts) still applies.
- Consults suppress verbose output with a new one-run verboseOnce instead of the persistent verbose override, which saved "off" to a shared session.
- The agent turn gets the consult's resolved workspace and the delivery account, destination and thread, still with deliver false.

* fix(voice): run an unsupported consult thinking level at the closest one

A consult's thinking level is a one-run choice the bridge makes for every
model: FaceTime always asks for "off", and Voice Call passes
realtime.consultThinkingLevel. The embedded runner clamps a level the model
lacks to its closest one; the agent-turn route instead failed the turn
("Thinking level "off" is not supported for anthropic/claude-opus-5-5"), so
every FaceTime consult on Claude Opus 5.5 failed.

New command option thinkingOnceClosest lets a one-run level fall through to
the attempt's clamp, as subagent spawns already do. Consults set it. A
persistent /think override and other callers still get the error.

Adds a test-lines allocation of 13 lines for the PR's regression tests.

* fix(voice): let a plugin ingress turn outlive the request that started it

Plugin runEmbeddedAgent runs its turn as a detached work continuation
("plugin turns can outlive both the triggering request root and its async
work scope"); plugin runCommandFromIngress, which realtime consults now use,
did not. A Google Meet bridge is opened inside the googlemeet.join request,
so a consult that reached the command queue after that request had ended
failed with "Gateway is temporarily unavailable. Please try again shortly."
instead of running, unlike the embedded route.

runCommandFromIngress now runs its turn as a detached work continuation,
the same way runEmbeddedAgent does.

Raises the PR's test-lines allocation to 69 for the new regression test.

* Merge branch 'main' into fix/voice-consult-ingress

* test(beam): expose synthetic adoption failure in CI

* Revert "test(beam): expose synthetic adoption failure in CI"

This reverts commit b11bbbf.

* chore: reconcile voice consult ingress with main

* fix(voice): reconcile consult checks with main

* fix(test): evict native source modules between non-isolated test files

Natively required repository sources live outside the Vitest module graph, so a later file in a shared worker reused copies bound to the previous file's retired state lifecycle (Beam owned-view failed with PLUGIN_STATE_OPEN_FAILED whenever it ran after another gateway file).

* test: allocate test lines for native source module eviction

Co-authored-by: Han Liu <[email protected]>
Co-authored-by: Omar Shahine <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message.

Fixes #206304

Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR.

With a `claude-cli` agent and `messages.visibleReplies: "message_tool"`, a turn that ends with plain text queues the stranded-reply retry (`[System] Your previous reply was not delivered ...`). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble.

The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same `[System] ...` text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions.

- The CLI candidate sets `promptOrigin: "host"` from the existing `FollowupRun.strandedReplyRetry` flag (`agent-runner-cli-candidate.ts`). `RunCliAgentParams` carries that one optional field, with the same value type `CliBackendExecuteContext.promptOrigin` already uses.
- The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (`execute-plugin.ts`). The Claude backend then sends `isSynthetic: true`, Claude saves an `isMeta` row, and the existing history import skips it.
- The retry's `inputProvenance` is unchanged (`external_user`). The first version of this PR switched it to `internal_system`; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (`reply-tool-authority.ts:353`, `reply-tool-authority-inbound.ts:83/116/214`, `agent-bundle-mcp-webchat-requester.ts:42`), reply threading and model urgency. Those changes are reverted, together with the `missingReplyNoticeAllowed` change it needed.
- No text classification: an operator who types the same `[System] ...` text still sees their own bubble. Existing history is not rewritten.

Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped.

Built Gateway + Control UI from `450c4b640ed6` (main) and this head in a secretless node:24.22.1 container. Agent `main` runs on `claude-cli` with a stand-in `claude` that writes a real Claude Code project JSONL (synthetic input -> `isMeta`) and calls the real OpenClaw MCP `message` tool; agent `embedded` runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: #207128 (comment)

| case | main | this PR |
|---|---|---|
| claude-cli stranded once: operator bubble with retry text (live / reload) | 1 / 1 | 0 / 0 |
| same: delivered reply "Delivered answer P206304." | shown | shown |
| same: chat.history retry row | `role: user`, no provenance, importedFrom claude-cli | absent (meta row skipped) |
| Claude stdin for retry | `isSynthetic` absent | `isSynthetic: true` |
| control: operator types the identical `[System] ...` text | own bubble, `external_user` | own bubble, `external_user` |
| control: retry also ends with plain text (second miss) | retry shown as operator bubble; retry final shown; no "No answer" notice | no operator bubble; retry final shown; no "No answer" notice (same as main) |
| control: embedded (non-CLI) agent, stranded once | no retry bubble, delivered | identical |

Regression test `agent-runner-execution-cli-sessions.test.ts` "sends a stranded-reply retry as host input without changing its provenance (#206304)": fails with the candidate line removed (`- "promptOrigin": "host"`), passes at head.

Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 0edb7c5)

Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; a736683 fix: show context usage during Claude CLI turns (#207036) [not selected for this narrow backport]; 75ad0b7 fix(voice): answer phone, meeting and FaceTime consults on Claude CLI agents (#202209) [not selected for this narrow backport]; b9ddb61 fix: keep saved system-event automations running after an upgrade (#207275) [not selected for this narrow backport]

Release adaptation: Propagate host prompt origin at the stable CLI backend input owner while preserving original human provenance.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. plugin: facetime FaceTime plugin plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Phone, meeting and FaceTime voice consults ignore the agent's Claude CLI runtime and fail with "No API key"

2 participants