Repository navigation
test(apple): fix asynchronous fixture ownership - #138207
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 4, 2026, 2:37 PM ET / 18:37 UTC. ClawSweeper reviewWhat this changesThis PR makes Apple test fixtures observe asynchronous sends deterministically, isolate ConfigStore override state, and stop delivering mocked WebSocket frames after cancellation. Merge readiness✅ Ready for maintainer review Keep open for normal maintainer handling: the introduced test-fixture repairs remain absent from current main, and no actionable source defect was found. The maintainer association and Priority: P2 Review scores
Verification
How this fits togetheriOS and macOS tests use shared Gateway and ConfigStore fixtures to model asynchronous transport and configuration operations. These fixtures feed native test suites and CI reliability, without changing the shipped application runtime. flowchart LR
A[Native test cases] --> B[Shared state isolation]
A --> C[WebSocket test fixture]
B --> D[ConfigStore overrides]
C --> E[Cancellation and receive guard]
D --> F[Load and save assertions]
E --> G[Apple CI results]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +43. Total +43 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the focused fixture-owner repairs after ordinary maintainer review, preserving the canonical FIFO fixture and the shared isolation lease. Do we have a high-confidence way to reproduce the issue? Yes—source makes the cancellation fixture failure deterministic: pre-fix it can return the queued success after cancellation, while the introduced regression requires only a cancellation error. The PR body also records a focused red/green run, which was not rerun in this read-only review. Is this the best way to solve the issue? Yes—the repair stays with the shared fixture owners, replaces polling with the gate-owned event, and retains the already-merged FIFO behavior rather than adding a competing transport path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0062f2b127bb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
The Apple-platform dependency check is now complete. Apple’s A separate native macOS Foundation probe therefore exercised the actual callback API against a maintained This supports the FIFO receive-gap behavior modeled by the repaired test double. It is a narrow macOS platform observation—not proof of unbounded buffering, cancellation-buffer internals, physical Watch behavior, or the cause of the original CI failure. No product code change was needed for this check. |
Integrate main's canonical FIFO repair from #138132 instead of retaining a competing one-shot emitter. Reject callback receives and late inbound frames after cancellation or completion, with the existing regression in the CI-selected iOS lifecycle suite. The exact current-main native reproduction completed with three controls passing and the cancellation case failing. The same four cases pass after the four-line test-support repair. All 12 changed-path checks and an independent Codex review pass. Production behavior and timeouts are unchanged.
Observe the held journal send through its gate-owned event with the existing two-second timeout instead of busy-yield polling. Keep the exact command and ownership assertions. Hold the existing shared TestIsolation lease through every ConfigStore fixture's override setup, async load/save and cleanup. Require the intended errors in negative-save cases so an unrelated origin failure cannot count as a pass. Production origin fencing and deadlines are unchanged.
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.
|
Merged via squash.
|
Complete the event-owned synchronization introduced by #138207 for the Watch journal test's storage warning and terminal receipt observations. The normal iOS lifecycle job timed out in its remaining busy-yield waits. Keep the two-second timeout, injected acceptance-write failure, held sibling, journal phases, attempt versions, exact command counts, and no-replay checks. Dispose the fixture callback and event stream after coordinator cleanup. No production, schema, dependency, or timeout policy changes.
…138209) Manual, polling and post-mutation Cron refreshes bypassed the scheduled task owner. A successful deletion could drop its required refresh while an older list was pending, then show the deleted row again. Route every refresh through the existing cancellation-and-drain chain, propagating caller cancellation only to its captured task. Preserve lease/generation publication and consumer lifetime boundaries; remove the redundant delayed same-lease hello refresh. Native fixture cleanup establishes Dashboard readiness/focus and shared config ownership, replaces request-observation spinning with the existing gate, removes an unrelated WebChat semaphore while retaining all four no-reopen assertions, and supplies the settings layout's inert Tailscale dependency. Keep canonical ConfigStore repair #138207. Document the Cron refresh guarantee. Proof: frozen-response regression failed before and passed with the identical test body afterward; 28 focused tests/69 cases; 4 XCTest and 2102 Swift tests/219 suites in one isolated full run; changed gate and managed Codex review passed. Required CI 33923636281 on 3da6d7a passed 11 jobs with 23 skips. The integrated checkout passed 1629 shared Swift tests, 2109 app Swift tests/220 suites, the XCTest suites and both named Keychain/catalog tests. The one rerun recovered zero-step runner admission only. Prior full matrix (191 success/4 failure/1 skip) and historical event-only/HTTP-fixture uncertainty remain documented in the PR. Production +18/-8 (net +10), tests +233/-171, docs +2. The added runtime lines replace the untracked bypass with one owner and exact-caller cancellation; no new queue, config, protocol, store, dependency, timeout or permission surface.
* test(ios): retain websocket frames across receive registration * test(ios): include websocket regressions in selected lifecycle suite * test(apple): synchronize journal and config fixtures Observe the held journal send through its gate-owned event with the existing two-second timeout instead of busy-yield polling. Keep the exact command and ownership assertions. Hold the existing shared TestIsolation lease through every ConfigStore fixture's override setup, async load/save and cleanup. Require the intended errors in negative-save cases so an unrelated origin failure cannot count as a pass. Production origin fencing and deadlines are unchanged.
…penclaw#138209) Manual, polling and post-mutation Cron refreshes bypassed the scheduled task owner. A successful deletion could drop its required refresh while an older list was pending, then show the deleted row again. Route every refresh through the existing cancellation-and-drain chain, propagating caller cancellation only to its captured task. Preserve lease/generation publication and consumer lifetime boundaries; remove the redundant delayed same-lease hello refresh. Native fixture cleanup establishes Dashboard readiness/focus and shared config ownership, replaces request-observation spinning with the existing gate, removes an unrelated WebChat semaphore while retaining all four no-reopen assertions, and supplies the settings layout's inert Tailscale dependency. Keep canonical ConfigStore repair openclaw#138207. Document the Cron refresh guarantee. Proof: frozen-response regression failed before and passed with the identical test body afterward; 28 focused tests/69 cases; 4 XCTest and 2102 Swift tests/219 suites in one isolated full run; changed gate and managed Codex review passed. Required CI 33923636281 on 3da6d7a passed 11 jobs with 23 skips. The integrated checkout passed 1629 shared Swift tests, 2109 app Swift tests/220 suites, the XCTest suites and both named Keychain/catalog tests. The one rerun recovered zero-step runner admission only. Prior full matrix (191 success/4 failure/1 skip) and historical event-only/HTTP-fixture uncertainty remain documented in the PR. Production +18/-8 (net +10), tests +233/-171, docs +2. The added runtime lines replace the untracked bypass with one owner and exact-caller cancellation; no new queue, config, protocol, store, dependency, timeout or permission surface.
Complete the event-owned synchronization introduced by #138207 for the Watch journal test's storage warning and terminal receipt observations. The normal iOS lifecycle job timed out in its remaining busy-yield waits. Keep the two-second timeout, injected acceptance-write failure, held sibling, journal phases, attempt versions, exact command counts, and no-replay checks. Dispose the fixture callback and event stream after coordinator cleanup. No production, schema, dependency, or timeout policy changes.
* 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]>
Related: #138132
What Problem This Solves
Resolves problems in native test fixtures that could accept WebSocket callbacks after cancellation, poll for an asynchronous journal send instead of observing its entry, or run ConfigStore operations without the shared-state isolation used by neighboring suites.
The earlier FIFO work is already on
mainthrough #138132. This PR retains that canonical implementation; it does not restore the old one-shot emitter or duplicate its FIFO regression.Why This Change Was Made
The repairs stay at the fixture owners. The WebSocket task rejects receives and ignores inbound results after cancellation, invoking callbacks outside its lock. The journal send gate publishes its first admitted command through a buffered event; the test awaits that event with the existing two-second
AsyncTimeoutand still checks the exact command list and journal state. ConfigStore fixtures hold the existingTestIsolationlease across override installation, asynchronous load/save, and cleanup, including throwing paths. Both negative-save tests now require their intended error.No production code, persistence schema, dependencies, or timeouts change. No assertions are skipped or weakened. Across three test/test-support files, the full PR is +92/−49 lines, net +43; production +0/−0.
User Impact
No user-facing runtime behavior changes. Native tests observe their own asynchronous work and respect shared fixture ownership without weakening production cancellation, document-origin checks, or journal replay guarantees.
Evidence
The proof identities are separate:
d0f061242bbdd9f46056ffc8failed the ambiguous-response case at the send-entry poll: 322 tests, one issueaa9f79437086, run 33883277428 attempt 2: remote-save failed with ConfigStore Code 3; 2,084 tests, one issueThe 13-case run used an
aa9f79437086application with source-aligned journal owners, not an exact-d9 whole-app build. Its final journal test file is byte-identical to published08665323601d6d41bc6f649806563fdbd1df6011. Temporary selection adapters, the copied canonical FIFO test, and portable AsyncTimeout execution aids are not part of the PR. Signed products, source/dependency bindings, and owned process/Simulator cleanup were verified.The earlier cancellation patch passed all 12 canonical changed-file checks. Independent review of the final journal/ConfigStore follow-up found no actionable source issues. Neither result substitutes for required hosted CI on the final head.
Limits: captured journal logs establish a failed observation followed by late progress, not a scheduler or production-journal root cause. An earlier receipt-unwind hypothesis was not reproduced and its candidate remains unapplied. The exact competing ConfigStore test and invalidated origin field were not captured. Cancellation is not claimed to explain the original journal CI failure. An older native finalization timeout remains recorded as incomplete evidence; the current four-case RED/GREEN and 13-case GREEN finalized normally. No physical-device, provider, microphone, or playback proof is claimed.
Final-head CI and review disposition
CI run 33900080680, attempt 2 completed successfully on
08665323601d6d41bc6f649806563fdbd1df6011. The iOS job passed 322 application tests, six logic tests, UI checks, and 31 Watch tests. The Mac job passed all 2,084 application tests, including ConfigStore.The initial runtime-config failure was independently reproduced as an existing test fault-injection race from #137672: a settled Worker can skip the intended transaction, leaving a global one-shot error to fire during archive publication. It is unrelated to these three Apple fixture files. The exact failed job passed its rerun; that retry is not presented as the fix. The separately reviewed root-cause test repair is #138481, with deterministic RED/GREEN and 16 passing owner/sibling cases. This classifies the failed check and completes the hosted-Mac evidence requested by the latest ClawSweeper review.
Canonical PR check recovery
The canonical pull-request CI run 33899472565, attempt 2 also completed successfully on exact head08665323601d6d41bc6f649806563fdbd1df6011. Its two original Mac jobs never acquired runners. Cancelling that stalled run and rerunning unsuccessful jobs used the workflow’s existing hosted macOS retry route; both Mac phases and the required aggregate passed. No source, required check, timeout or policy was weakened. The separate manual full CI success remains additional evidence.