Skip to content

fix(voice-call): require recorded owners for restored calls - #163118

Merged
steipete merged 5 commits into
mainfrom
fix/lg-runtime-voice-explicit-owner
Oct 3, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/lg-runtime-voice-explicit-owner

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Restored Voice Call records without an agent owner could inherit the current configured agent. After an operator changed configuration, an old call could use a different agent's workspace, session store, and tools.

Require the agentId recorded when the call was created. Active-call restoration skips unowned records before provider verification; realtime registration, instructions, and classic response generation use the same strict owner resolver. Response generation requires an explicit owner. Current call producers already persist normalized ownership.

User-visible behavior: old active calls without a recorded owner no longer resume automatically, even when their session key names an agent. Hang up any remaining call with the provider and start a new call. Saved rows and transcripts stay unchanged, completed history remains readable, and delayed callbacks do not readmit skipped calls. Changing configuration affects new calls.

Scope and overlap

Main's #162669 superseded this PR's original JSONL retirement. The conflict reconciliation preserves that retirement owner, SQLite schema migration, manifests, shared Doctor contracts, store declarations, and their tests unchanged. This PR now contains only the recorded-owner cutover and its regressions. The earlier retiredStateFiles proposal is removed.

Production changes from the complete paginated GitHub file comparison: +23 / -19 / net +4, six production files. Tests and test support are excluded. The JSONL deletion is already on main and is not counted again here.

Evidence

Candidate: 97a8faf3eee3532aca0a291d6fc33ee7e8c964c4, source tree 10c919135488a4f98f76fc9b3934bfb0923899b1, based on conflict-reconciled main 7f0410c2e66e912a524e72ca883deef2dca09d0f.

Canonical SQLite call rows remain readable and are not rewritten by this change. Main owns the retired JSONL refusal and the instruction to run OpenClaw 2026.9.7 Doctor as an intermediate upgrade. This PR adds no importer or schema transform.

Independent Codex review through P2 is clean for the complete candidate. Formatting and git diff --check pass. Exact-head hosted CI 37091368873 passed, including the CI and security gates. No local build or tests were run on the loaded coordinator host.

Final-source proof ran on Hetzner lease cbx_0ddfa2afe062, run run_a0307b7b301f8fe66b94000c6306a2cc, exact head and tree above. Frozen install took 8.90 s. The blank-owner negative control against pre-fix fd93734cebefae356501437f69ab53c23c83aed8 failed for the expected resolved-instead-of-rejected assertion, with no unhandled or suite errors (44.28 s wall). The candidate response-generator suite passed all 35 cases (28.64 s wall); the restore/runtime/webhook sibling command passed all 67 cases (44.94 s wall), including the three corrected fast-memory cases.

The supported installed-driver update cell passed: unmodified published [email protected] and Voice Call 2026.9.7 imported the synthetic historical log through their Doctor, then openclaw update installed this candidate in 460 s. Artifact identities, all 17 canonical call rows, historical timestamps, ownership, transcript bytes, preserved source backup, and Gateway health passed. Repeated candidate Doctor passed in 36 s and left those rows unchanged. The task-private fixture changed only package version/cohort metadata to 2026.9.99-first-hop.0 because source and published packages both declare 2026.9.7; executable members were verified unchanged. This is published-driver-to-candidate proof, not a publication or same-version replacement claim. No live telephony claim is made.

A separate retired-log refusal cell exposed an inherited update gap and failed; the overall 2,035.042 s command is not reported as passing. Candidate admission and copied-state Doctor accepted, but live post-plugin Doctor rejected calls.jsonl after service replacement. Original JSONL bytes remained intact, yet the strict original Gateway/supervisor identity assertion correctly failed. The assertion remains unchanged. Published 2026.9.7 snapshots registered SQLite families, execution approvals, and plugin code but omits this JSONL source; the candidate admission owner has no plugin-owned retired-file preflight. The retirement contract and update owners are byte-identical to main 7f0410c2e66e912a524e72ca883deef2dca09d0f (#162669), and this PR changes neither. The owning follow-up is candidate update admission plus plugin Doctor artifact/resource inspection on original live paths before snapshots/service replacement; it must reuse plugin-owned detection and preserve external artifact selection. The missing synthetic @openclaw/[email protected] warning was advisory; the recorded refusal explicitly names Voice Call's retired log. Canonical update and this PR's own owner regressions passed independently. No retired-log pre-stop success is claimed.

Two earlier deterministic test defects were corrected: a missing-owner assertion was placed in a fixture without access to the realtime callback, and a redundant assignment grew an already capped webhook test. The regression now exercises the registered callback, and the shared fixture supplies its existing outbound default. Neither was a flake; no baseline increase or assertion weakening was used.

Preceding-head hosted run 37086435608 tested merge 83fd547a52c94a823fd966e358cbc61edd96c6c0 (0324730b85dc6044acfac1ff7d090e27fc0828d0 into main 06ac4a4672ea5a9ac2bcef9c01e3e1121011ed24). The Voice shard passed 288 cases and failed three fast-memory cases in 22.53 s. Their shared fixture omitted the now-required recorded owner and failed at the owner guard before provider/cancellation assertions. A single agentId: "main" fixture field repairs all three without changing production or assertions. This is a PR-caused deterministic fixture mismatch, not an inherited failure or flake. The blank-owner response regression passed in that run (2 ms test time). The final candidate runtime suite passed before packaging.

@clawsweeper

clawsweeper Bot commented Oct 2, 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 size: L labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 11:17 PM ET / October 3, 2026, 03:17 UTC (Revision 13).

ClawSweeper review

What this changes

Voice Call requires each active call’s recorded agent owner for restoration and responses, while retaining unowned saved history.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains useful: current main still permits configured-agent fallback for unowned calls. No introduced correctness defect was found; final-source startup and installed-upgrade evidence remains pending.

Priority: P2
Reviewed head: 97a8faf3eee3532aca0a291d6fc33ee7e8c964c4

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no concrete correctness finding, but required installed-runtime validation remains incomplete.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Source and supplemental tests connect restoration and response owners to early rejection of unowned calls; repository-required final-source startup and installed-upgrade observations are still explicitly pending. No stored-data format changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Source and supplemental tests connect restoration and response owners to early rejection of unowned calls; repository-required final-source startup and installed-upgrade observations are still explicitly pending. No stored-data format changes.
Evidence reviewed 10 items Verified introduced scope: Reviewed the pinned merge-base-to-head delta. It contains the recorded-owner cutover and its tests, not the already-merged JSONL retirement. The supplied test merge is stale and was not used to infer removal of current-main behavior.
Still necessary on main and latest release: Both fetched main and v2026.9.7 resolve an absent recorded owner using the configured agent. Neither contains this strict-owner cutover.
Shipped baseline checked: The latest release retains configured-agent fallback for legacy records.
Findings None None.
Security None None.

How this fits together

The Voice Call plugin receives carrier callbacks and saved call records, then routes conversations to an OpenClaw agent. Recorded ownership determines the workspace, sessions, and tools used for responses.

flowchart TD
  A[Saved call records] --> B[Call restoration]
  B --> C{Recorded owner present?}
  C -->|No| D[Retain history without resuming]
  C -->|Yes| E[Verify carrier status]
  E --> F[Active call]
  G[Carrier callbacks] --> F
  F --> H[Recorded agent responses]
Loading

Before merge

  • Resolve merge risk (P1) - Final-source startup and installed-upgrade observations remain pending, leaving the documented legacy-call admission change unverified through the installed runtime.
  • Complete next step (P2) - Complete the pending final-source startup and installed-upgrade observations, confirming owned-call restoration, exclusion of unowned calls through delayed callbacks, preserved history, and ownership on fresh calls.
Agent review details

Security

None.

PR surface

Source +4, Tests +120, Docs +6. Total +130 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 6 23 19 +4
Tests 5 125 5 +120
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 154 24 +130

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Complete the pending runtime observations (recommended)
    Record final-source startup and published-driver upgrade results showing owned calls resume, unowned calls stay excluded through delayed callbacks, and saved history survives.

Technical review

Best possible solution:

Keep recorded ownership authoritative across restoration and responses, with saved history preserved and the accepted legacy-call refusal verified during upgrade.

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

Yes, from source: restoring an unowned active record after changing the configured agent selects that new agent on current main. This review did not execute a runtime reproduction.

Is this the best way to solve the issue?

Yes. One strict resolver replaces configuration fallback across restoration, realtime registration, and classic responses without inventing ownership or rewriting retained records.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a focused Voice Call ownership repair with limited subsystem scope.
  • merge-risk: 🚨 compatibility: Legacy active calls without recorded ownership intentionally stop resuming; that tradeoff is accepted, but installed-runtime upgrade observations remain pending.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Source and supplemental tests connect restoration and response owners to early rejection of unowned calls; repository-required final-source startup and installed-upgrade observations are still explicitly pending. No stored-data format changes.

Evidence

What I checked:

  • Verified introduced scope: Reviewed the pinned merge-base-to-head delta. It contains the recorded-owner cutover and its tests, not the already-merged JSONL retirement. The supplied test merge is stale and was not used to infer removal of current-main behavior. (97a8faf3eee3)
  • Still necessary on main and latest release: Both fetched main and v2026.9.7 resolve an absent recorded owner using the configured agent. Neither contains this strict-owner cutover. (extensions/voice-call/src/resolve-call-agent-id.ts:27, 1b08795ae494)
  • Shipped baseline checked: The latest release retains configured-agent fallback for legacy records. (extensions/voice-call/src/resolve-call-agent-id.ts:27, c074824a27c9)
  • Owner validation precedes admission: Restoration checks recorded ownership before carrier verification. Realtime registration and classic response generation use the same resolver; blank owners throw before session admission or agent execution. (extensions/voice-call/src/manager.ts:296, 97a8faf3eee3)
  • Delayed callbacks cannot readmit skipped records: The event owner resolves retained call identity before auto-registration and ignores retained nonterminal calls absent from active memory. The added restore regression checks this behavior together with unchanged history and completed-record readability. (extensions/voice-call/src/manager/events.ts:194, 97a8faf3eee3)
  • Stored format remains compatible: The call schema still permits an absent agentId, its only schema-file change is a comment, and the SQLite store implementation is unchanged. Unowned records are skipped without a persistence write; new inbound and outbound producers already persist normalized ownership. (extensions/voice-call/src/types.ts:87, 97a8faf3eee3)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Replace the pending evidence paragraph with final-source startup, regression, and installed-upgrade observations, including measured test costs.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-02T06:30:38.783Z sha bf6991c :: blocked before merge. :: none
  • reviewed 2026-10-02T09:44:11.199Z sha bf6991c :: blocked before merge. :: none
  • reviewed 2026-10-02T10:13:12.283Z sha 7b91a53 :: blocked before merge. :: none
  • reviewed 2026-10-02T17:30:40.765Z sha 1c70de8 :: blocked before merge. :: none
  • reviewed 2026-10-03T00:52:42.752Z sha a35f5887be72555aca3772f2aa02b91748d0de08 :: blocked before merge. :: none
  • reviewed 2026-10-03T01:38:31.788Z sha 0324730 :: blocked before merge. :: none
  • reviewed 2026-10-03T02:08:33.894Z sha 0324730 :: blocked before merge. :: none
  • reviewed 2026-10-03T02:59:48.929Z sha 97a8faf :: blocked before merge. :: none

@steipete
steipete force-pushed the fix/lg-runtime-voice-explicit-owner branch from e7feaa3 to bf6991c Compare October 2, 2026 03:10
@steipete
steipete marked this pull request as ready for review October 2, 2026 09:39
@steipete
steipete force-pushed the fix/lg-runtime-voice-explicit-owner branch 2 times, most recently from 1c70de8 to a35f588 Compare October 3, 2026 00:46
@steipete
steipete force-pushed the fix/lg-runtime-voice-explicit-owner branch from a35f588 to 0324730 Compare October 3, 2026 01:31
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed gateway Gateway runtime size: L labels Oct 3, 2026
@steipete steipete changed the title refactor(voice-call): retire old call state readers fix(voice-call): require recorded owners for restored calls Oct 3, 2026
@steipete
steipete merged commit 9b480e2 into main Oct 3, 2026
124 of 125 checks passed
@steipete
steipete deleted the fix/lg-runtime-voice-explicit-owner branch October 3, 2026 05:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…#163118)

* refactor(voice-call): retire old call state readers

* test(voice-call): exercise missing owner in realtime callback

* test(voice-call): reuse outbound direction fixture default

* fix(voice-call): require recorded response owners

* test(voice-call): record fast-context fixture owner
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 docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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