Repository navigation
refactor(voice-call): share call-history encoding and provider policy - #145661
Conversation
Reuse one call-record encoder for runtime persistence and Doctor while preserving snapshot-before-await and ordered chunk publication. Consolidate Plivo parameter ordering and consume Twilio media-send results. Retain the distinct concurrent-admission regression on the upstream lifecycle fixture without duplicating the race fix already landed in #145382. Validation: 217 focused tests across 11 Voice suites, formatting and diff checks, and clean P2 review.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 12, 2026, 1:56 AM ET / 05:56 UTC. ClawSweeper reviewWhat this changesVoice Call shares call-history encoding between runtime persistence and Doctor, consolidates Plivo signature formatting, removes unused Twilio state, and strengthens boundary tests. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored refactor remains distinct from the merged lifecycle work. Source review found no introduced blocking defect. Priority: P3 Review scores
Verification
How this fits togetherThe Voice Call plugin connects carrier webhooks and audio streams to OpenClaw calls. Its persistence layer saves call history in SQLite, while provider adapters verify callbacks and control audio playback. flowchart TD
A[Call updates] --> B[Shared record encoder]
C[Doctor legacy import] --> B
B --> D[SQLite chunks then metadata]
E[Carrier callbacks] --> F[Signature and replay checks]
F --> A
A --> G[Twilio audio playback]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -115, Tests +248, Docs +3, Other -1. Total +135 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one plugin-owned encoder and provider policy implementation while preserving existing record bytes, publication ordering and playback contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR proposes consolidation without an intended behavior change; its added failure scenarios were reviewed in source but not executed here. Is this the best way to solve the issue? Yes: sharing the existing encoder and removing unreachable provider policy reduces competing implementations without changing public APIs or persisted formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 785266d3af19. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…openclaw#145661) Reuse one call-record encoder for runtime persistence and Doctor while preserving snapshot-before-await and ordered chunk publication. Consolidate Plivo parameter ordering and consume Twilio media-send results. Retain the distinct concurrent-admission regression on the upstream lifecycle fixture without duplicating the race fix already landed in openclaw#145382. Validation: 217 focused tests across 11 Voice suites, formatting and diff checks, and clean P2 review.
Related: #145047, #145382
What Problem This Solves
Voice Call's runtime persistence and Doctor migration duplicated call-record serialization and chunk construction. Provider code also repeated Plivo parameter ordering and retained an unwritten Twilio notification set.
Why This Change Was Made
Runtime and Doctor now share the record encoder, chunk keys, and row types. Snapshot capture still completes before the first await, chunk writes finish before metadata publication, and pruning remains ordered afterward. Doctor materializes every chunk before selecting migration capacity. Plivo uses one parameter-ordering implementation, and Twilio consumes the concrete media-send result.
This preserves #145382's already-landed admission guard, asynchronous provider cleanup, and fixture ownership. The retained regression covers two admissions waiting on persistence before either bridge exists; it uses the existing lifecycle helper. No production race fix or duplicate fixture is added here.
User Impact
No intended behavior change. Existing call-history bytes, migration ordering, and provider policy remain compatible. Coverage now also protects the concurrent-admission case fixed upstream.
The refreshed patch removes 101 production code lines and adds 264 test/support lines: +163 maintained code lines overall. The previously reviewed candidate was +178; its superseded race guard and fixture extraction are excluded from this PR and receive no new credit.
Evidence
At base
6678f6174b336fb5df22b661ab6e6cba0524bc9a, 217 tests passed across 11 focused Voice suites, including the current lifecycle and transcript-persistence tests. Formatting and whitespace checks passed. Fresh P2 review passed with no findings. PR-head CI remains pending.Retained proof for the earlier
9252b591candidate includes a full build, complete changed-file gate, nine-case/18-operation raw SQLite parity, and an installed update from published[email protected]to candidate2026.9.4. The installed proof checked all 27 non-dependency package files and separately verified old and candidate Doctor migrations, exact selected module/root/boundary, loader/file hashes, three chunks, 120,390 payload bytes, metadata, and archived input.That wrapper run exited 1 on an obsolete observer cache field after the product steps. Independent immutable-archive reconciliation passed; the original failure remains recorded. Those artifacts retain their original source/package identity and are not presented as a build or installed run of this newer base. The task-owned Testbox was stopped and confirmed completed. No carrier calls or live Gateway execution are claimed.
A bounded source preflight against main
3f0b8a175098c19f1a89d39e8649f8f82d54da1bfound unchanged Voice source, direct persistence/Doctor contracts, and package inputs; the accepted patch still applies. Later plugin-update changes are outside the retained artifact identity.