Repository navigation
test(sessions): scope reclamation faults to their connection - #138481
Conversation
Inject the recovered close error on the exact short-lived commit-barrier connection. A settled Worker can legitimately skip the lock transaction, leaving the former global one-shot fault to escape into archive publication. Preserve deletion, archive, lifecycle and fault-delivery assertions and the existing transaction-failure sibling coverage.
|
🦞👀 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: needs changes before merge. Reviewed September 4, 2026, 3:44 PM ET / 19:44 UTC. ClawSweeper reviewWhat this changesThis PR makes the SQLite session-reclamation regression test inject its recovered error when the short-lived commit-barrier connection closes, rather than on an unrelated later transaction. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open. This focused test repair replaces a global one-shot transaction fault with a close fault on the reclamation coordinator connection, matching the lower-level owner test; current main still has the race-prone setup. No introduced correctness or security defect was found, but the maintainer label requires explicit maintainer handling. Priority: P3 Review scores
Verification
How this fits togetherSession deletion materializes archives, asks a Worker to commit SQLite changes, then publishes deletion and archive events. The parent-side reclamation barrier keeps caller authority valid until the Worker's transaction settles. flowchart LR
A[Session deletion request] --> B[Archive materialization]
B --> C[Reclamation Worker]
C --> D[Parent commit barrier]
D --> E[SQLite transaction settles]
E --> F[Archive publication]
F --> G[Deletion event]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the handle-scoped fault injection and land it after maintainer review, retaining the separate lower-level barrier-close coverage. Do we have a high-confidence way to reproduce the issue? Yes—source inspection shows the former module-wide one-shot fault can be consumed by a later transaction, and the supplied CI evidence identifies that resulting regression-test failure. Is this the best way to solve the issue? Yes—the changed injection follows the existing coordinator-close test pattern and faults the owner whose recovered close behavior this case is intended to verify. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7911a0cd12ac. 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.
|
Reuse the canonical startup baseline from #138449, terminal-parent QA acknowledgment from #137342, and handle-scoped reclamation fixture from #138481. Keep the Watch, Rust and Gateway/provider production sources unchanged from the verified 907 native and real-provider checkpoint. The four-file delta has a clean independent review. Source binding retains all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and baseline proof remain source-specific. No required check, timeout or size allowance is disabled. Co-authored-by: Ayaan Zaidi <[email protected]>
…w#138481) Inject the recovered close error on the exact short-lived commit-barrier connection. A settled Worker can legitimately skip the lock transaction, leaving the former global one-shot fault to escape into archive publication. Preserve deletion, archive, lifecycle and fault-delivery assertions and the existing transaction-failure sibling coverage.
* feat(watch): add native standalone realtime voice Add opt-in Talk on Watch with provider-direct WebRTC/Opus, scoped Gateway control and explicit call/audio ownership. Preserve phone-mediated voice. Resolve native endpoints consistently across ICE and Network.framework, fence late resolver/media work after cancellation, and release received Opus promptly after packet loss while dropping late speech. Keep recoverable provider notices visible without closing the session; make setup actionable. Source review passes all eleven sections through P3. Native engine RED/GREEN passes eleven final cases; real Watch Simulator resolver classification and held-result cancellation pass fifteen and sixteen cases respectively. Full device/provider/current-base CI verification remains a landing gate. Uses the already-landed app-local companion journal; adds no database schema or protocol-version change. Physical Watch microphone/speaker, background and endurance behavior remains unverified. * fix(watch): use OS entropy for ICE credentials Supply fresh ICE credentials through the native engine's existing owner API instead of relying on the pinned library's non-cryptographic defaults. Fail engine creation closed if operating-system entropy is unavailable. The actual C-ABI regression repeats dependency RNG state: credentials repeat before the repair; all twelve engine cases pass afterward. The existing locked getrandom package owns the platform entropy call; no resolved packages, configuration, database schema, or Gateway protocol are added. * test(qa): follow canonical ClawHub documentation ownership * test(ios): retain websocket frames across receive registration * test(qa): align Watch branch with landed documentation reference * test(ios): include websocket regressions in selected lifecycle suite * fix(watchos): remove unused audio startup result Remove the unused audio-format result through the audio, media-session and controller path. Periphery exposed obsolete fields in a value the sole caller discarded; activation, cancellation and codec policy stay unchanged. Include the separately reviewed Apple fixture synchronization fixes from #138207 while that prerequisite lands. No Gateway runtime, protocol, configuration or persistence changes. * chore(watch): sync landed CI prerequisites Reuse the canonical startup baseline from #138449, terminal-parent QA acknowledgment from #137342, and handle-scoped reclamation fixture from #138481. Keep the Watch, Rust and Gateway/provider production sources unchanged from the verified 907 native and real-provider checkpoint. The four-file delta has a clean independent review. Source binding retains all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and baseline proof remain source-specific. No required check, timeout or size allowance is disabled. Co-authored-by: Ayaan Zaidi <[email protected]> * fix(gateway): compose device reply ownership with watch voice teardown Use the canonical committed-mutation response owner from #138492 for device remove, rotate and revoke, preserving immediate fencing and scoped teardown. Include the separately reviewed #138625 cleanup fix so a retired caller cannot skip removed-device worker reconciliation. Keep setup/bootstrap on their existing retirement helper and retain the Watch HTTP invalidation owner. Validation: 194 owner, Watch and authorization tests passed with zero skips; fresh scoped managed review found no P0-P3 findings. Full changed checks and new published-head native/Gateway live proof remain separate landing gates. * test(watch): isolate platform metadata regressions --------- Co-authored-by: Ayaan Zaidi <[email protected]>
* feat(watch): add native standalone realtime voice Add opt-in Talk on Watch with provider-direct WebRTC/Opus, scoped Gateway control and explicit call/audio ownership. Preserve phone-mediated voice. Resolve native endpoints consistently across ICE and Network.framework, fence late resolver/media work after cancellation, and release received Opus promptly after packet loss while dropping late speech. Keep recoverable provider notices visible without closing the session; make setup actionable. Source review passes all eleven sections through P3. Native engine RED/GREEN passes eleven final cases; real Watch Simulator resolver classification and held-result cancellation pass fifteen and sixteen cases respectively. Full device/provider/current-base CI verification remains a landing gate. Uses the already-landed app-local companion journal; adds no database schema or protocol-version change. Physical Watch microphone/speaker, background and endurance behavior remains unverified. * fix(watch): use OS entropy for ICE credentials Supply fresh ICE credentials through the native engine's existing owner API instead of relying on the pinned library's non-cryptographic defaults. Fail engine creation closed if operating-system entropy is unavailable. The actual C-ABI regression repeats dependency RNG state: credentials repeat before the repair; all twelve engine cases pass afterward. The existing locked getrandom package owns the platform entropy call; no resolved packages, configuration, database schema, or Gateway protocol are added. * test(qa): follow canonical ClawHub documentation ownership * test(ios): retain websocket frames across receive registration * test(qa): align Watch branch with landed documentation reference * test(ios): include websocket regressions in selected lifecycle suite * fix(watchos): remove unused audio startup result Remove the unused audio-format result through the audio, media-session and controller path. Periphery exposed obsolete fields in a value the sole caller discarded; activation, cancellation and codec policy stay unchanged. Include the separately reviewed Apple fixture synchronization fixes from openclaw#138207 while that prerequisite lands. No Gateway runtime, protocol, configuration or persistence changes. * chore(watch): sync landed CI prerequisites Reuse the canonical startup baseline from openclaw#138449, terminal-parent QA acknowledgment from openclaw#137342, and handle-scoped reclamation fixture from openclaw#138481. Keep the Watch, Rust and Gateway/provider production sources unchanged from the verified 907 native and real-provider checkpoint. The four-file delta has a clean independent review. Source binding retains all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and baseline proof remain source-specific. No required check, timeout or size allowance is disabled. Co-authored-by: Ayaan Zaidi <[email protected]> * fix(gateway): compose device reply ownership with watch voice teardown Use the canonical committed-mutation response owner from openclaw#138492 for device remove, rotate and revoke, preserving immediate fencing and scoped teardown. Include the separately reviewed openclaw#138625 cleanup fix so a retired caller cannot skip removed-device worker reconciliation. Keep setup/bootstrap on their existing retirement helper and retain the Watch HTTP invalidation owner. Validation: 194 owner, Watch and authorization tests passed with zero skips; fresh scoped managed review found no P0-P3 findings. Full changed checks and new published-head native/Gateway live proof remain separate landing gates. * test(watch): isolate platform metadata regressions --------- Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Resolves a native SQLite regression-test failure where a simulated commit-barrier error could escape into archive publication instead of exercising commit recovery.
The failure was observed in the runtime-config CI shard on
08665323601d6d41bc6f649806563fdbd1df6011: one failed test out of 4,192. This is a separate follow-up to the reclamation tests introduced by #137672, not an Apple fixture change.Why This Change Was Made
The integration test previously armed the next module-wide immediate transaction to throw. A Worker can legitimately finish its transaction before the parent checks its shared settlement state; in that case the parent does not need another lock transaction. The unused injected error then reached the later archive-schema transaction.
The test now uses the existing sibling-test pattern: capture the exact reclamation connection, call its real close, then inject one close error. This exercises recovered settlement errors regardless of which valid settlement path wins. The case name identifies that fault, and its deletion, archive-file, lifecycle-event, and fault-delivery assertions are preserved. The existing lower-level transaction-barrier fault tests remain unchanged.
User Impact
No production behavior changes. This repairs the test's fault ownership without changing SQLite schemas, store semantics, commit authorization, recovery policy, or timeouts. The one-file test delta is +13/−9 lines, net +4.
Evidence
On pinned main
8d060cd03dc4f6ae9ad842d4ba2f84cc39e9b98e, a private ordering control forwarded real commit approval and waited for the real Worker's settlement before letting the parent inspect it. It did not write shared commit state or fabricate results. The original test then failed at the sameensureSessionTranscriptArchiveSchemacall as hosted CI. With the repaired injection, the same controlled case passed. The four other cases were filtered out of those two focused runs, not counted as passes.After removing the diagnostic ordering control, both complete admission-race and commit suites passed 16/16 tests, zero skipped, in 88.899 seconds. They cover current/historical admission, retired caller authority, transient/permanent/closed barrier failures, Worker commit/rollback/exit, expired authorization, and successful/rejected close-fault settlement. The controlled RED and GREEN both finalized normally, with owned process groups gone.
The test and reclamation/publication owners match the failed CI source; current main's separate native transaction-nesting refactor is retained and disclosed. The private ordering control is not in this patch. All 20 canonical changed-file checks passed, including targeted test types, formatting, dead-export scans, and lint. A fresh independent P0–P3 review was scoped-clean. Exact-head canonical CI run33905912704 subsequently completed successfully at c6fdfae. The original failed shard remains retained as defect evidence.
Review disposition
The completed ClawSweeper review found no code or security defect and requested maintainer handling. This repair is being handled under the maintainer’s explicit fix-and-land direction, with direct source/owner review, the retained controlled reproduction,16 passing owner/sibling cases,20 canonical checks, independent review and green exact-head CI. No required check or independent-approval rule is bypassed.