Skip to content

fix(voice-call): realtime phone consults fail on Claude CLI agents with no API key - #191683

Closed
hannnnn-l wants to merge 3 commits into
openclaw:mainfrom
hannnnn-l:fix/voice-consult-cli-runtime
Closed

hannnnn-l wants to merge 3 commits into
openclaw:mainfrom
hannnnn-l:fix/voice-consult-cli-runtime

Conversation

@hannnnn-l

Copy link
Copy Markdown
Contributor

Related: #188440 (this fixes the realtime consult path; the classic responder that #188440 reports is unchanged, see Gaps)

What Problem This Solves

Fixes: realtime phone consults fail with No API key found for provider "anthropic" when the called agent runs on a CLI runtime such as agentRuntime: { id: "claude-cli" }.

User Impact

User impact: a realtime Voice Call consult now runs on the agent's configured runtime, including a subscription-backed Claude CLI agent with no provider API key. Each consult is an ordinary turn of the call session, so later consults in the same call keep earlier ones, and the agent's normal tools (for example sessions_send to another agent) work under toolPolicy: "owner". The caller stays a guest: owner-only tools stay refused, and voice_call stays bound to ending the current call.

The classic (non-realtime) phone responder is unchanged and still runs runEmbeddedAgent; see Gaps.

Why This Change Was Made

Realtime consults called runEmbeddedAgent, which never selects a CLI runtime. Discord voice does not have this problem because it runs a normal agent turn (runCommandFromIngress). Consults now take that same path:

  • consultRealtimeVoiceAgent accepts runner: "agent-turn": session preparation (fork, lineage, delivery) is unchanged, and the turn runs through agentRuntime.runCommandFromIngress as a guest. Voice Call opts in; other consult callers keep embedded.
  • Plugin ingress: a plugin that owns no channel may admit a turn without messageChannel, and only as a guest. Owner elevation still requires the exact trusted plugin of the named channel. toolBindings are accepted only for tools the calling plugin declares in contracts.tools. Public agentCommandFromIngress still strips both.
  • The CLI runner carries toolBindings into the MCP loopback grant (they already reached embedded tools), so voice_call keeps its active-call binding on the CLI route.
  • Voice Call runs consults in its service context. Webhook handlers run outside the Gateway, and without the service's Gateway context sessions_send failed with "Requester provenance requires trusted in-process Gateway dispatch."

A CLI-dispatch alternative (cliBackendDispatch on the embedded runner) was considered and rejected: it is a one-shot helper path without session history or the requester's normal tool policy.

Evidence

Focused tests (all new tests fail on origin/main and pass here):

  • src/talk/agent-consult-runtime.test.ts 18/18: agent-turn consult shape (guest, deliver: false, one-shot thinking, bindings), and refusal of embedded tool-context adaptation.
  • src/plugins/registry-runtime.channel-ingress.test.ts 32/32: channel-less guest turn admitted; owner claim and foreign channel refused; foreign tool binding refused; bindings snapshotted.
  • src/agents/command/attempt-execution.cli-mcp.test.ts 5/5: toolBindings reach the prepared CLI run.
  • src/agents/cli-runner/{mcp-grant-context,tool-authority}.test.ts: bindings snapshotted into the loopback grant.
  • extensions/voice-call/src/runtime.test.ts 23/23: consults run as agent turns (an embedded call throws) inside the service context; a host-forced consult (consultPolicy: "always", called the way scheduleForcedAgentConsult calls it) runs as a guest agent turn and its owner's abort cancels the turn.

Gateway e2e (real Gateway, real Voice Call plugin with the mock carrier, fixture realtime provider issuing two consults, agent on anthropic/claude-opus-5-5 with agentRuntime: claude-cli, stub claude that speaks stream-json and uses the real MCP loopback, second agent on the mock model):

Check owner safe-read-only
Consult 1 / 2 answered by the CLI runtime yes / yes yes / yes
Consult 2 in the same Claude process and session yes (turnInProcess=2) yes
No API key found in Gateway log 0 0
Native Claude tools ToolSearch only ToolSearch only
MCP tools normal agent surface read, web_fetch, memory_search, memory_get, voice_call
voice_call initiate_call refused: may only end_call refused: may only end_call
gateway, automations refused: needs owner authority not available
sessions_send to another agent accepted; target model received the message not available

Host-forced consults (realtime.consultPolicy: "always"; the fixture provider never calls the consult tool and emits two final caller transcripts, so scheduleForcedAgentConsult issues both consults):

Check owner safe-read-only
Forced consult 1 / 2 answered by the CLI runtime and spoken via sendUserMessage yes / yes yes / yes
Consult 2 in the same Claude process and session yes (turnInProcess=2) yes (turnInProcess=2)
No API key found in Gateway log 0 0
MCP tools normal agent surface read, web_fetch, memory_search, memory_get, voice_call
voice_call initiate_call refused: may only end_call refused: may only end_call
gateway, automations refused: needs owner authority not available
sessions_send to another agent accepted; target model received the message not available

Before the service-context commit, the same e2e returned Requester provenance requires trusted in-process Gateway dispatch. for sessions_send.

Regression: test/e2e/qa-lab/runtime/voice-call-gateway.ts (voice-call-cli-rpc-agent-tool) passes.

After rebasing onto origin/main 2e24ab7, the six focused suites above and the four tsgo checks were rerun and pass.

Other checks: pnpm tsgo:core, pnpm tsgo:extensions, pnpm tsgo:core:test, pnpm tsgo:extensions:test, oxlint on touched files, format check, docs markdown lint, git diff --check.

Size against origin/main: production +240/−105, tests +256/−22. The ingress admission check moved out of registry-runtime.ts into its own module unchanged, with the guest and binding rules added there.

Gaps

  • A failed host-forced consult is still only logged (realtime forced agent consult failed), so the caller hears nothing. Unchanged here.
  • Classic phone responder (generateVoiceResponse) still uses runEmbeddedAgent; it relies on pre-compaction early-speech block hooks that the agent-turn API does not expose. Moving it needs a separate change.
  • pnpm test:extension voice-call: manager.async-store.test.ts "checks registered steering admission and effects" (3 cases) fails identically on origin/main code on this host; all other files pass.
  • check:line-cap-ratchet / check:test-lines-ratchet need git cat-file --batch -z (newer than this host's git 2.34); line growth was checked by hand and no grandfathered file grows.

Realtime phone consults called runEmbeddedAgent, which skips the agent's configured runtime, so a Claude-CLI-only agent failed with 'No API key found for provider "anthropic"'. Consults now run as ordinary guest agent turns of the call session through runCommandFromIngress, as Discord voice does: the agent's runtime, the call's history and the normal tool policy apply.

Plugin ingress admits a guest turn without messageChannel for a plugin that owns no channel, and accepts toolBindings only for the plugin's declared tools. The CLI runner carries toolBindings into the loopback grant, so voice_call stays bound to the active call.
Webhook handlers run outside the Gateway. Consults now run in the voice-call service context, which carries the in-process Gateway that agent tools such as sessions_send dispatch through.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 05:03
@clawsweeper

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

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T05:18:47.727541Z
We couldn’t complete this review. Comment @codex review to try again.
5f12d7b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 3, 2026 •

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: 5f12d7b4d58a8c13991c6ba03f963e6ebedc73b4

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.

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.

Copilot AI 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.

🟡 Changes recommended

Inbound calls using owner tool policy can bypass sender-based tool restrictions, while consults also mishandle session settings and routing.

7 open issues
What changed in this PR

Routes realtime Voice Call consults through normal agent turns so they can use the configured runtime, including Claude CLI without a provider API key, and retain session history. The classic phone responder reported in #188440 remains unchanged.

Changes:

  • Adds an opt-in agent-turn consult runner and runs Voice Call consults in the service’s Gateway context.
  • Supports channel-less guest ingress and carries declared tool bindings through CLI execution and loopback tool resolution.
  • Adds focused regression tests and documents the new runtime behavior.
File Description
src/​talk/​agent-consult-runtime.ts Adds the agent-turn consult runner.
src/​talk/​agent-consult-runtime.test.ts Tests guest turn options and runner constraints.
src/​plugins/​runtime/​types-core.ts Defines plugin ingress options and guarantees.
src/​plugins/​runtime/​runtime-agent.ts Forwards admitted tool bindings.
src/​plugins/​registry-runtime.ts Delegates ingress checks to the new admission helper.
src/​plugins/​registry-runtime.channel-ingress.test.ts Tests guest admission and binding restrictions.
src/​plugins/​registry-runtime-command-ingress.ts Validates plugin ingress authority and declared bindings.
src/​gateway/​tool-resolution.ts Passes bindings into tool construction.
src/​gateway/​mcp-grant-store.ts Adds tool bindings to loopback request context.
src/​agents/​command/​types.ts Adds plugin-specific ingress options.
src/​agents/​command/​attempt-execution.ts Carries bindings into CLI attempts.
src/​agents/​command/​attempt-execution.cli-mcp.test.ts Tests binding propagation to prepared CLI runs.
src/​agents/​cli-runner/​types.ts Includes tool bindings in CLI run parameters.
src/​agents/​cli-runner/​tool-authority.ts Preserves bindings in tool-authority preparation.
src/​agents/​cli-runner/​tool-authority.test.ts Updates authority-field coverage.
src/​agents/​cli-runner/​mcp-grant-context.ts Snapshots bindings into loopback grants.
src/​agents/​cli-runner/​mcp-grant-context.test.ts Tests binding snapshot isolation.
extensions/​voice-call/​src/​runtime.ts Selects agent turns within the service context.
extensions/​voice-call/​src/​runtime.test.ts Tests dispatch, service context, and cancellation.
docs/​plugins/​voice-call/​realtime-and-streaming.md Documents runtime selection, history, and guest authority.
docs/​plugins/​sdk-runtime/​config-and-utilities.md Documents channel-less ingress and binding rules.

Review effort: Balanced

agentRuntime,
logger: log,
agentId,
sessionKey,
Comment on lines +373 to +375
// An ordinary agent turn of the call session: the agent's runtime (including
// Claude CLI), the call's history and the caller's guest tool policy apply.
runner: "agent-turn",
Comment on lines +376 to +377
provider: agentProvider,
model,
{
message: prompt,
agentId,
sessionKey: params.sessionKey,
Comment on lines +566 to +567
messageProvider: toolAuthorityOverlay.messageProvider,
runContext: { senderId: params.senderId ?? undefined },
allowModelOverride: Boolean(params.provider || params.model),
provider: params.provider,
model: params.model,
thinkingOnce: thinkLevel,
model: params.model,
thinkingOnce: thinkLevel,
fastMode: params.fastMode,
verbose: "off",
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Routes realtime phone consultations through ordinary agent turns so they can use the agent’s configured CLI runtime.

Example: A realtime phone consultation uses a Claude CLI agent without an Anthropic API key.

  • Before: The consultation enters embedded execution and fails looking for an API key.
  • After: The consultation enters the configured CLI runtime and retains conversational history.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The repair direction is useful, but executable caller policy and existing session contracts regress, and the supplied behavior claims lack inspectable artifacts.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial
User problem: A phone caller receives no agent answer when the configured model runs through Claude CLI without a direct provider API key.
Reason: The routing repair has clear value, but the plugin authority extension needs an owner decision; the PR correctly uses Related for the broader classic-response issue.

Merge readiness

⛔ Blocked before merge - 15 items remain

This PR addresses a current routing defect, but introduces caller-policy, session-state, and routing regressions that block merging.

Priority: P1
Reviewed head: 5f12d7b4d58a8c13991c6ba03f963e6ebedc73b4
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should active non-channel plugins receive channel-less guest-turn admission and bindings for their declared tools through the existing plugin runtime API?
  • Recommendation: Approve the scoped extension: Retain the existing ingress owner, require the listed repairs, and validate guest and call-binding authority through final effects.
  • Why: This expands the authority contract established by exact-channel admission, and no maintainer approval of that expansion appears in the discussion.

Before merge

  • Add real behavior proof - Authority-chain proof required: the body describes a real Gateway with fixture voice and CLI peers, but supplies no inspectable execution artifact establishing repeated CLI consultations, allowed current-call effects, rejection of another active call, or rejection after call/service retirement; provide redacted logs, live output, or a recording and remove IPs, keys, phone numbers, and non-public endpoints. 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.
  • Forward the phone caller identity into the agent turn (P1) - With toolPolicy set to owner and tools.toolsBySender["*"].deny containing sessions_send, Voice Call still supplies no senderId. The new mediated CLI route consequently builds its MCP catalog using when-sender-id and skips that wildcard restriction. sessions_send can enter the executable catalog even though embedded consultations applied the restriction. Forward the remote party’s phone identity through the existing sender field and cover the final MCP invocation.
  • Preserve the voice policy surface in CLI grants (P2) - For a phone consultation without an inherited delivery channel, messageProvider is voice. buildCliMcpGrantContext passes that through resolveGatewayMessageChannel, which discards voice because it is not a delivery channel. The MCP resolver then misses filterToolsByMessageProvider’s voice exclusion and can expose tts under owner tool policy, although the phone transport cannot render that tool’s output. Preserve the policy surface independently of delivery-channel normalization.
  • Keep verbose suppression out of persisted session preferences (P2) - verbose is a persistent command override: prepareEmbeddedSessionState writes it to sessionEntry.verboseLevel. With sessionScope main or an explicit shared call session whose verboseLevel is full, this consultation changes the stored preference to off and affects subsequent chat turns. Preserve transient speech-output suppression without passing a persistent session override.
  • Forward the resolved session workspace (P2) - The shared owner resolves workspaceDir from spawnedWorkspaceDir or spawnedCwd, but the new command receives neither workspaceDir nor that resolved workspace selection. Command preparation instead uses its explicit workspace option or the agent default. A consultation bound to an inherited workspace therefore loads context and operates tools against a different workspace than the previous embedded path. Pass the already-resolved workspace through the existing command option.
  • Carry the resolved reply destination into the command context (P2) - The embedded branch supplied consultDeliveryContext’s destination, account, and thread. The agent-turn branch retains only messageProvider and senderId, and prepareCurrentRunDelivery returns immediately because deliver is false. A consultation originating from a threaded conversation consequently loses the current target and account needed by message tools. Forward those resolved facts through the existing run-context and reply-target fields while keeping automatic delivery disabled.
  • Distinguish inherited model selection from an explicit override (P2) - Voice Call always supplies the resolved provider/model, including when responseModel is unset. The new command interprets that pair as a manual override and requires visibilityPolicy.allows. An exact modelPolicy allowlist can intentionally exclude the configured primary from manual selection while retaining it for automatic execution; ordinary turns work, but this consultation now rejects the primary before running. Preserve automatic selection semantics for an inherited primary and reserve explicit override handling for an explicitly configured responseModel.
  • Let the selected runtime resolve inherited thinking defaults (P2) - Voice Call resolves a thinking default before dispatch, and this branch always converts it into thinkingOnce. Command model selection rejects unsupported explicit thinking levels while it clamps ordinary defaults. For example, a configured max default on a runtime supporting only lower levels can now fail the consultation instead of running with the supported level. Pass thinkingOnce only for an explicit consultation override and let the command owner resolve inherited defaults.
  • Keep prompt construction inside startup cleanup (P2) - buildRealtimeVoiceAgentConsultPrompt can throw, for example when the public consultation API receives args without a question. It now runs after onRunStarted has acquired registration resources but before the try block that calls cleanupBeforeRun and cleanup. That input leaks the registration instead of following the previous startup-failure cleanup path. Move fallible prompt preparation back inside the guarded startup block.
  • Resolve security concern: Sender restrictions can disappear from executable MCP tools - The sender-policy finding reaches non-coding MCP tools: their executable catalog omits the wildcard denial, while final handler checks validate grant lifetime rather than reconstructing the missing sender policy.
  • Resolve merge risk - Before merge, the contributor must establish that retained CLI call bindings reject another active call and stop authorizing effects after call or service retirement.
  • Await maintainer action - After repairs and validation, obtain the enforced security-sensitive approval for the current PR revision.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.
  • Explain or restore the original intent of Synchronous startup cleanup - 6f16678: Keep fallible argument preparation inside startup cleanup so failed consultations release registrations.

Findings

  • [P1] Forward the phone caller identity into the agent turn — extensions/voice-call/src/runtime.ts:362-375
  • [P2] Preserve the voice policy surface in CLI grants — src/talk/agent-consult-runtime.ts:565-567
  • [P2] Keep verbose suppression out of persisted session preferences — src/talk/agent-consult-runtime.ts:574
  • [high] Sender restrictions can disappear from executable MCP tools — extensions/voice-call/src/runtime.ts:375

Provenance

  • Synchronous startup cleanup changes intended behavior without addressing why it exists (6f16678: Keep fallible argument preparation inside startup cleanup so failed consultations release registrations.)

Tests

  • Low-value test src/agents/command/attempt-execution.cli-mcp.test.ts: The added binding test asserts forwarding into a mocked CLI executor; replace this mock echo with a regression that exercises the resulting MCP tool restriction.
  • Low-value test src/talk/agent-consult-runtime.test.ts: The added successful agent-turn case pins a complete mocked argument object rather than exercising runtime selection or preserved session behavior.
  • Missing end-to-end proof: Supply inspectable Gateway/CLI results for repeated consultations, final-effect authority rejection, cancellation, and an upgrade preserving existing session preferences and context.
Agent review details

How this fits together

The Voice Call plugin forwards spoken requests into the agent runtime; CLI agents receive tools through Gateway-issued MCP grants, and consultation results return as speech.

flowchart LR
  A[Phone caller] --> B[Voice Call plugin]
  B --> C[Shared consultation runtime]
  C --> D[Plugin ingress admission]
  D --> E[Agent turn and CLI runtime]
  E --> F[Gateway MCP tools]
  E --> G[Spoken consultation result]
Loading

Technical review

Best possible solution:

Use the existing conversational runtime owner while preserving caller policy, resolved session context, transient output settings, and live call authority.

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

Current source establishes the embedded-routing failure for CLI-only consultations; this read-only review ran no target code.

Is this the best way to solve the issue?

Ordinary agent turns are a suitable repair boundary, but the adapter must preserve the contracts already resolved by the shared consultation owner.

Full review comments:

  • [P1] Forward the phone caller identity into the agent turn — extensions/voice-call/src/runtime.ts:362-375
    With toolPolicy set to owner and tools.toolsBySender["*"].deny containing sessions_send, Voice Call still supplies no senderId. The new mediated CLI route consequently builds its MCP catalog using when-sender-id and skips that wildcard restriction. sessions_send can enter the executable catalog even though embedded consultations applied the restriction. Forward the remote party’s phone identity through the existing sender field and cover the final MCP invocation.
    Confidence: 0.94
  • [P2] Preserve the voice policy surface in CLI grants — src/talk/agent-consult-runtime.ts:565-567
    For a phone consultation without an inherited delivery channel, messageProvider is voice. buildCliMcpGrantContext passes that through resolveGatewayMessageChannel, which discards voice because it is not a delivery channel. The MCP resolver then misses filterToolsByMessageProvider’s voice exclusion and can expose tts under owner tool policy, although the phone transport cannot render that tool’s output. Preserve the policy surface independently of delivery-channel normalization.
    Confidence: 0.97
  • [P2] Keep verbose suppression out of persisted session preferences — src/talk/agent-consult-runtime.ts:574
    verbose is a persistent command override: prepareEmbeddedSessionState writes it to sessionEntry.verboseLevel. With sessionScope main or an explicit shared call session whose verboseLevel is full, this consultation changes the stored preference to off and affects subsequent chat turns. Preserve transient speech-output suppression without passing a persistent session override.
    Confidence: 0.99
  • [P2] Forward the resolved session workspace — src/talk/agent-consult-runtime.ts:563-567
    The shared owner resolves workspaceDir from spawnedWorkspaceDir or spawnedCwd, but the new command receives neither workspaceDir nor that resolved workspace selection. Command preparation instead uses its explicit workspace option or the agent default. A consultation bound to an inherited workspace therefore loads context and operates tools against a different workspace than the previous embedded path. Pass the already-resolved workspace through the existing command option.
    Confidence: 0.98
  • [P2] Carry the resolved reply destination into the command context — src/talk/agent-consult-runtime.ts:566-567
    The embedded branch supplied consultDeliveryContext’s destination, account, and thread. The agent-turn branch retains only messageProvider and senderId, and prepareCurrentRunDelivery returns immediately because deliver is false. A consultation originating from a threaded conversation consequently loses the current target and account needed by message tools. Forward those resolved facts through the existing run-context and reply-target fields while keeping automatic delivery disabled.
    Confidence: 0.97
  • [P2] Distinguish inherited model selection from an explicit override — src/talk/agent-consult-runtime.ts:569-571
    Voice Call always supplies the resolved provider/model, including when responseModel is unset. The new command interprets that pair as a manual override and requires visibilityPolicy.allows. An exact modelPolicy allowlist can intentionally exclude the configured primary from manual selection while retaining it for automatic execution; ordinary turns work, but this consultation now rejects the primary before running. Preserve automatic selection semantics for an inherited primary and reserve explicit override handling for an explicitly configured responseModel.
    Confidence: 0.97
  • [P2] Let the selected runtime resolve inherited thinking defaults — src/talk/agent-consult-runtime.ts:572
    Voice Call resolves a thinking default before dispatch, and this branch always converts it into thinkingOnce. Command model selection rejects unsupported explicit thinking levels while it clamps ordinary defaults. For example, a configured max default on a runtime supporting only lower levels can now fail the consultation instead of running with the supported level. Pass thinkingOnce only for an explicit consultation override and let the command owner resolve inherited defaults.
    Confidence: 0.95
  • [P2] Keep prompt construction inside startup cleanup — src/talk/agent-consult-runtime.ts:545
    buildRealtimeVoiceAgentConsultPrompt can throw, for example when the public consultation API receives args without a question. It now runs after onRunStarted has acquired registration resources but before the try block that calls cleanupBeforeRun and cleanup. That input leaks the registration instead of following the previous startup-failure cleanup path. Move fallible prompt preparation back inside the guarded startup block.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Repair and prove the existing boundaries (recommended)
    The contributor fixes the adapter regressions and demonstrates allowed, foreign-call, and retired-authority behavior before maintainer approval.

Provenance checked

  • Shared consultation execution changes intended behavior with a stated reason (e2f1395: Centralize consultation parsing, sessions, prompts, and tool policy across realtime voice callers.)
  • Plugin ingress authority changes intended behavior with a stated reason (20b453f: Reject forged owner privileges and preserve owner elevation only through the exact trusted channel plugin.)
  • Call-scoped voice tools keeps the original intent (e5c50c9: Allow native-delegation consultations to end only their current phone call.)
  • Configured voice response model keeps the original intent (14c3cf6: Inherit the call agent’s configured primary when responseModel is unset while preserving explicit voice overrides.)

Testing

Proof path: unit tests only.

Security

Needs attention: Caller-policy enforcement regresses on the CLI path, and the expanded plugin authority contract needs current-head security approval.

Evidence

Security concerns:

  • [high] Sender restrictions can disappear from executable MCP tools — extensions/voice-call/src/runtime.ts:375
    The sender-policy finding reaches non-coding MCP tools: their executable catalog omits the wildcard denial, while final handler checks validate grant lifetime rather than reconstructing the missing sender policy.
    Confidence: 0.94

What I checked:

PR surface

Source +130, Tests +234, Docs +5. Total +369 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 13 233 103 +130
Tests 6 256 22 +234
Docs 2 7 2 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 496 127 +369

Labels

Label changes:

  • add P1: CLI-only agents currently cannot answer realtime consultations, and the proposed replacement introduces a caller-policy bypass.
  • add merge-risk: 🚨 compatibility: The PR expands plugin ingress behavior and changes existing model and thinking defaults into explicitly validated overrides.
  • add merge-risk: 🚨 session-state: Consultations can overwrite a shared session’s verbose preference and lose its resolved workspace.
  • add merge-risk: 🚨 security-boundary: The new CLI consultation path can omit wildcard sender restrictions and transfers call-scoped tool bindings into MCP grants.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P1: CLI-only agents currently cannot answer realtime consultations, and the proposed replacement introduces a caller-policy bypass.
  • merge-risk: 🚨 security-boundary: The new CLI consultation path can omit wildcard sender restrictions and transfers call-scoped tool bindings into MCP grants.
  • merge-risk: 🚨 session-state: Consultations can overwrite a shared session’s verbose preference and lose its resolved workspace.
  • merge-risk: 🚨 compatibility: The PR expands plugin ingress behavior and changes existing model and thinking defaults into explicitly validated overrides.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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.

Reviewed November 3, 2026, 12:22 AM ET / 05:22 UTC.

@hannnnn-l

Copy link
Copy Markdown
Contributor Author

Closing in favour of #164229, which routes realtime consults through the admitted turn and CLI-candidate owners with the configured fallback chain. That approach should also cover voice-call once it is applied to the shared consult runtime, rather than adding a separate voice-call-only runner here. Related: #188440, #161885.

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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation gateway Gateway runtime plugin: file-transfer security-review-required security-sensitive-changed size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants