Skip to content

refactor: route voice call agent runs through session target#96539

Merged
jalehman merged 1 commit into
openclaw:mainfrom
jalehman:josh/path3-voice-sessionfile
Jun 24, 2026
Merged

refactor: route voice call agent runs through session target#96539
jalehman merged 1 commit into
openclaw:mainfrom
jalehman:josh/path3-voice-sessionfile

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

What Problem This Solves

Voice Call still routed classic auto-response agent runs through the legacy sessionFile runtime identity path. That kept one bundled plugin on the file-backed session seam after the embedded-agent runtime already supports storage-neutral session targets.

Why This Change Was Made

Path 3 is migrating runtime callers away from session transcript/file paths and toward accessor/session identity seams. Voice Call already had enough local session identity to pass agentId, sessionId, sessionKey, and storePath directly, so preserving the sessionFile compatibility path was no longer needed for this caller.

User Impact

Voice Call response behavior is intended to stay the same. The change only alters the internal identity passed to embedded OpenClaw agent runs: responses still use the same voice session key, agent, model, workspace, timeout, lane, and tool allowlist, but no longer resolve or pass a transcript file path.

Evidence

  • node scripts/run-vitest.mjs extensions/voice-call/src/response-generator.test.ts
    • Passed: 10 tests.
  • node scripts/run-vitest.mjs test/scripts/check-session-accessor-boundary.test.ts
    • Passed: 31 tests.
  • node scripts/check-session-accessor-boundary.mjs
    • Passed.
  • pnpm exec oxfmt --check --threads=1 extensions/voice-call/src/response-generator.ts extensions/voice-call/src/response-generator.test.ts scripts/check-session-accessor-boundary.mjs test/scripts/check-session-accessor-boundary.test.ts
    • Passed.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/voice-call/src/response-generator.ts extensions/voice-call/src/response-generator.test.ts
    • Passed.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/check-session-accessor-boundary.mjs test/scripts/check-session-accessor-boundary.test.ts
    • Passed.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main
    • Clean: no accepted/actionable findings.
  • Live local OpenClaw checkout proof from /Users/phaedrus/Projects/clawdbot at e797e86dbe88ad91a3b6102ba312bbd85d16b10f:
    • node --import tsx /tmp/path3-voice-sessiontarget-proof.mjs
    • Passed: generateVoiceResponse returned "Proof passed.", called runEmbeddedAgent once, passed sessionTarget, did not pass sessionFile, and did not call resolveSessionFilePath.

Live proof note: this is direct runtime seam proof, not full phone/media ingress proof. The phone ingress path that reaches this classic response generator requires a streaming transcript callback; the mock Voice Call gateway methods prove plugin loading/call management but do not invoke handleInboundResponse.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 3:45 PM ET / 19:45 UTC.

Summary
The branch routes Voice Call classic auto-response embedded-agent runs through sessionTarget instead of sessionFile and adds a boundary guard/test for that migrated caller.

PR surface: Source +1, Tests +55, Other +69. Total +125 across 4 files.

Reproducibility: not applicable. This PR is an internal refactor rather than a user-reported bug. The behavior claim is verifiable through the changed generateVoiceResponse call path, the embedded-runner contract, and the PR's direct runtime seam proof.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No automated repair is needed; the protected maintainer-labeled PR should stay open for normal maintainer review/landing once CI is acceptable.

Security
Cleared: The diff changes TypeScript runtime/tests and a local guard script only; it does not add dependencies, widen permissions, touch secrets, or introduce new downloaded code execution.

Review details

Best possible solution:

Keep this bounded refactor open and land it after maintainer review/CI so Voice Call classic responses use the same sessionTarget identity seam as the embedded runner and realtime voice consult path.

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

Not applicable; this PR is an internal refactor rather than a user-reported bug. The behavior claim is verifiable through the changed generateVoiceResponse call path, the embedded-runner contract, and the PR's direct runtime seam proof.

Is this the best way to solve the issue?

Yes; this is the narrowest maintainable fix because the embedded runner already owns sessionTarget resolution and the realtime Voice Call consult path already uses the same shape. Keeping the old sessionFile call in this migrated caller would preserve an internal compatibility path the repo policy is actively retiring.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: This is a small internal session-runtime cleanup for one bundled plugin, with no reported user-facing regression or new product surface.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-change terminal proof from a live local checkout showing the changed function passed sessionTarget, omitted sessionFile, and returned the expected response; focused tests and guard output support it.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-change terminal proof from a live local checkout showing the changed function passed sessionTarget, omitted sessionFile, and returned the expected response; focused tests and guard output support it.

Label justifications:

  • P3: This is a small internal session-runtime cleanup for one bundled plugin, with no reported user-facing regression or new product surface.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-change terminal proof from a live local checkout showing the changed function passed sessionTarget, omitted sessionFile, and returned the expected response; focused tests and guard output support it.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-change terminal proof from a live local checkout showing the changed function passed sessionTarget, omitted sessionFile, and returned the expected response; focused tests and guard output support it.
Evidence reviewed

PR surface:

Source +1, Tests +55, Other +69. Total +125 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 5 +1
Tests 2 73 18 +55
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 69 0 +69
Total 4 148 23 +125

What I checked:

  • Current main still uses legacy file identity: On current main, generateVoiceResponse resolves a transcript file with resolveSessionFilePath and passes sessionFile into runEmbeddedAgent, so the PR is not obsolete on main. (extensions/voice-call/src/response-generator.ts:294, 3848b9619fdb)
  • PR uses the storage-neutral embedded-run target: At the PR head, the Voice Call caller passes sessionTarget with agentId, sessionId, sessionKey, and storePath, and no longer passes sessionFile directly. (extensions/voice-call/src/response-generator.ts:320, e797e86dbe88)
  • Embedded runner contract supports this shape: resolveAgentRunSessionTarget accepts sessionTarget and resolves the current file-backed runtime target from agentId, sessionId, sessionKey, and storePath; runEmbeddedAgentInternal applies that identity before resolving the transcript target. (src/agents/run-session-target.ts:23, 3848b9619fdb)
  • Embedded runner consumes resolved target before execution: runEmbeddedAgentInternal calls applyAgentRunSessionTargetIdentity, resolves the run session target, and backfills the runtime sessionFile internally for downstream file-backed internals. (src/agents/embedded-agent-runner/run.ts:625, 3848b9619fdb)
  • Sibling Voice Call path already uses the same invariant: The realtime voice consult path passes the same sessionTarget shape into runEmbeddedAgent, which supports this PR as a one-sided classic-response migration rather than a new runtime pattern. (src/talk/agent-consult-runtime.ts:269, 3848b9619fdb)
  • Boundary guard ratchets the migrated caller: The PR adds migratedEmbeddedAgentSessionTargetFiles and checks the Voice Call response generator for resolveSessionFilePath or sessionFile passed to runEmbeddedAgent. (scripts/check-session-accessor-boundary.mjs:430, e797e86dbe88)

Likely related people:

  • jalehman: Recent merged Path 3/session-accessor work updated the same boundary guard and plugin runtime surfaces, and this PR continues that already-merged migration path rather than introducing a disconnected idea. (role: recent area contributor; confidence: high; commits: 7e2b2d2987b2, 4d4769c0d6a5, e797e86dbe88; files: scripts/check-session-accessor-boundary.mjs, test/scripts/check-session-accessor-boundary.test.ts, extensions/voice-call/src/response-generator.ts)
  • Alix-007: Blame and file history show the current Voice Call response generator, embedded-run session target resolver, and sibling realtime consult path were introduced in commit 605aede.... (role: introduced behavior; confidence: medium; commits: 605aede38c10; files: extensions/voice-call/src/response-generator.ts, extensions/voice-call/src/response-generator.test.ts, src/agents/run-session-target.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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

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

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 24, 2026
@jalehman
jalehman merged commit d716900 into openclaw:main Jun 24, 2026
147 of 159 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 25, 2026
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant