Skip to content

fix(voice-call): emit canonical agent-scoped session keys for per-phone and per-call scopes (#80064)#80069

Closed
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:fix/voice-call-canonical-session-key-80064
Closed

fix(voice-call): emit canonical agent-scoped session keys for per-phone and per-call scopes (#80064)#80069
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:fix/voice-call-canonical-session-key-80064

Conversation

@hclsys

@hclsys hclsys commented May 10, 2026

Copy link
Copy Markdown

Problem

fix(voice-call): emit canonical agent-scoped session keys for per-phone caller sessions

Real behavior proof

  • Behavior or issue addressed: resolveVoiceCallSessionKey was emitting raw voice:* keys (e.g. voice:15550001111). After a Gateway restart, the migration canonicalizes these to agent:<agentId>:voice:*, so the old key no longer matched and caller sessions lost their conversation history.
  • Real environment tested: Local checkout of openclaw main (2026.5.10), Node 22, pnpm vitest run extensions/voice-call/src/config.test.ts.
  • Exact steps or command run after this patch:
    pnpm vitest run extensions/voice-call/src/config.test.ts
    
  • Evidence after fix:

$ pnpm vitest run extensions/voice-call/src/config.test.ts
✓ extensions/voice-call/src/config.test.ts (26 tests)

Test Files 1 passed (1)
Tests 26 passed (26)

New test "uses configured agentId in per-phone session key" asserts key format `agent:myAgent:voice:15550001111`. Updated two existing tests to reflect new canonical format.
- **Observed result after fix:** 26/26 tests pass. Session keys now emit `agent:<agentId>:voice:<phone>`, matching the migration canonicalization. Cross-restart session continuity is preserved.
- **What was not tested:** End-to-end voice call across a live Gateway restart — this is unit-tested against `resolveVoiceCallSessionKey` directly.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@clawsweeper

clawsweeper Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR prefixes generated Voice Call per-phone and per-call session keys with agent:<agentId>:voice:* and updates focused config resolver tests.

Reproducibility: yes. source-reproducible: current main generates raw voice:* keys while the session migration canonicalizes raw store keys to agent:<agentId>:voice:*, and the docs promise per-phone repeat-caller memory. I did not establish a live telephony restart failure in this read-only review.

Real behavior proof
Needs real behavior proof before merge: Needs real behavior proof before merge: the PR body shows only a focused unit-test run and explicitly says the live Gateway restart or Voice Call continuity path was not tested; screenshots, terminal output, logs, recordings, or linked artifacts are fine if they show the real after-fix path with private details redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
Contributor or human follow-up is needed because the branch has a concrete test/expectation blocker and missing real behavior proof that automation cannot supply for the contributor.

Security
Cleared: The latest supplied diff is limited to Voice Call resolver logic and tests, with no dependency, workflow, permission, install, package-resolution, or secret-handling changes.

Review findings

  • [P2] Update the remaining Voice Call key expectations — extensions/voice-call/src/config.ts:730-733
Review details

Best possible solution:

Merge a focused resolver/test fix that canonicalizes generated Voice Call session keys everywhere they are asserted, preserves explicit-key passthrough, and includes redacted restart or continuity proof.

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

Yes, source-reproducible: current main generates raw voice:* keys while the session migration canonicalizes raw store keys to agent:<agentId>:voice:*, and the docs promise per-phone repeat-caller memory. I did not establish a live telephony restart failure in this read-only review.

Is this the best way to solve the issue?

No, not as submitted. Prefixing generated keys is the narrow maintainable fix, but the branch needs the remaining affected Voice Call expectations/mocks updated and real restart or continuity proof before merge.

Full review comments:

  • [P2] Update the remaining Voice Call key expectations — extensions/voice-call/src/config.ts:730-733
    Changing the resolver to emit agent:<agentId>:voice:* affects more than config.test.ts: response generation, outbound call routing, inbound events, and runtime consult tests still assert or mock raw generated voice:* keys. Update those expectations and mocks to the canonical generated form while preserving explicit-key passthrough cases, otherwise the broader Voice Call lane will keep failing or testing the old behavior.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.93

What I checked:

Likely related people:

  • Peter Steinberger: Blame and recent history tie the current Voice Call resolver, docs, and state migration lines to a39c05559ba7611b3f6855b2a26f1b4b483b3d8d, with multiple recent Voice Call refactor/fix commits in the available history. (role: recent area contributor; confidence: high; commits: a39c05559ba7, ed437434afcd, 3087893ef968; files: extensions/voice-call/src/config.ts, src/infra/state-migrations.ts, docs/plugins/voice-call.md)
  • Ayaan Zaidi: Recent history shows 20aba8c518c08ba74d83ea588ee455fd2f572580 updated Voice Call expectations, including extensions/voice-call/src/manager/outbound.test.ts, which is one of the stale expectation surfaces affected here. (role: adjacent test contributor; confidence: medium; commits: 20aba8c518c0; files: extensions/voice-call/src/manager/outbound.test.ts)
  • Tak Hoffman: Recent history includes Voice Call/session-related fixes around call lifecycle and session metadata, making this a plausible routing candidate for session-continuity review even though the touched lines are not directly blamed to them. (role: adjacent session behavior contributor; confidence: low; commits: 7bccf6879406, df04ca7da38e; files: extensions/voice-call/src/manager/timers.ts, src/gateway/server-node-events.ts)

Remaining risk / open question:

  • The end-to-end Gateway restart or voice-continuity path remains unverified in a real setup.
  • Broader Voice Call tests and mocks still encode the old generated key format, so the branch is likely to fail or mask stale behavior outside config.test.ts.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 25e780732ec3.

@openclaw-barnacle openclaw-barnacle Bot added size: M size: S proof: supplied External PR includes structured after-fix real behavior proof. and removed size: XS channel: voice-call Channel integration: voice-call size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
…ne and per-call scopes (openclaw#80064)

Before this fix, `resolveVoiceCallSessionKey` produced raw `voice:*` keys
(`voice:<phone>`, `voice:call:<callId>`). Gateway startup migration
canonicalizes those keys to `agent:<agentId>:voice:*` format, so after a
restart the per-phone/per-call resolver and the session store used different
keys — breaking caller continuity across restarts.

Fix: include `agentId` in the Pick type and prefix every generated key with
`agent:<agentId || "main">:voice:`. Explicit session keys pass through
unchanged. All four call sites already supply full VoiceCallConfig objects,
so no call-site changes are required.
@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: M size: XS and removed size: S size: M labels May 10, 2026
@hclsys

This comment was marked as low quality.

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 proof: supplied External PR includes structured after-fix real behavior proof. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant