Repository navigation
fix: stabilize macOS approval expiry and rejection tests - #136522
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 3:34 PM ET / 19:34 UTC. ClawSweeper reviewWhat this changesThe PR makes macOS approval-queue tests create expiring fixtures at mocked Gateway response time and verifies a structured rejection before queue re-sync. Merge readiness✅ Ready for maintainer review No blocking findings: this is a focused, test-only repair whose timing and structured-error assertions match the existing macOS approval-queue owner. It remains open because it is maintainer-labeled and authored by a repository member, which requires explicit maintainer handling rather than automated closure. Priority: P3 Review scores
Verification
How this fits togetherThe macOS status menu displays pending execution approvals fetched from the Gateway. The approval queue filters expired requests and re-lists the authoritative queue when another client wins a resolution race. flowchart LR
A[Status menu] --> B[Approval queue]
B --> C[Gateway client]
C --> D[Mock Gateway fixture]
D --> E[Expiry and rejection response]
E --> B
B --> F[Queue assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +27. Total +27 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the production approval-queue owner unchanged and land this focused fixture repair through the normal maintainer PR flow. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the prior timing failure: the fixture timestamp was created before connection and response work, so a 600 ms delay could consume its 500 ms lifetime before receipt. This read-only review did not execute a local reproduction. Is this the best way to solve the issue? Yes. Deferring fixture construction to the mocked Gateway’s list response fixes the timing at its producer, while the typed response assertion verifies the same structured-rejection contract used by the native client and Gateway. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0df437f0071c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where the macOS approval queue tests could fail during slow connection setup, or appear to validate a rejected approval only after a request timed out. These failures obscured whether approval expiry and competing-client recovery actually worked.
Why This Change Was Made
Create time-sensitive fixtures when the mocked Gateway prepares its response, not before the connection starts. Encode rejection responses with the shared protocol types and require the expected Gateway error before checking that the store re-fetches the authoritative queue. The original 500 ms expiry and queue assertions remain intact; no production behavior or timeout changes.
User Impact
No end-user behavior changes. Maintainers get reliable expiry coverage and a test that distinguishes a real approval rejection from timeout recovery. Scope: one test file, +53/-26 lines; production delta: zero. Related: #135808.
Evidence
NSError(Gateway request timeout) where the regression assertion requiredGatewayResponseError. The corrected response includes the canonicalINVALID_REQUESTcode andAPPROVAL_ALREADY_RESOLVEDreason.0ebdbe6155adc2413896989f61ca6fadc5fb4b12. The sole subsequent source change was the formatter movingtryoutward over the same JSON encoding expression; the native results are not presented as an exact formatted-head run.Review follow-up
The requested expiry and structured-rejection trace is included below from the full native CI run. It covers the changed test fixture using the production native Gateway client; replacing the fixture with a live Gateway would not exercise the code changed by this PR. This is native fixture behavior proof, not a live Gateway or rendered-UI claim. A separate focused rerun was not performed.
Exact-head native CI evidence
The
macos-swift (tests)job 100380864505 completed successfully for PR headef7966b5808755991b1087cb82bca2e02c8e48ff. GitHub checked out merge commitf182d901a149c08fbd7e2c1b0c5ea87f572b0ed2, merging that head intof92a12c5813fb880ed6a05c4a728fd5f4ccc5473. The fixture and unchanged production owner in the merge were independently read back and are byte-identical to the PR head (fixture SHA-2563a6807e62ba4cd7d017f94c01e73c26f1f99ebc851a1a77ca24be3848929be0a).This is an excerpt from the full CI suite, not a separate focused rerun.
ExecApprovalQueueStoreTestspassed all six methods/seven cases, including the original 500 ms expiry scenario with both 0 and 600 ms response-preparation delays. The structured-rejection method passed in 9.304 seconds. Its source requiresGatewayResponseError,INVALID_REQUEST, andAPPROVAL_ALREADY_RESOLVED; successful assertion values are not individually printed in the log, so this is a source-bound method pass rather than a separate wire trace.The complete Mac Swift Testing run reported 1,926 tests in 200 suites passed; XCTest reported 4 tests, 0 failures. The separate named-profile
AppStateIsolationTestsinvocation passed 2 tests in 1 suite. The same job's preceding sharedOpenClawKitstep passed 1,577 tests in 121 suites. Its later isolated render step passed 1 test in 1 suite. These are separate runner-reported totals, not one inflated combined count.The full-suite fixture elapsed time is not compared with the isolated local run as a performance claim. Separately, the complete submitted-head CI run finished successfully at 19:41:08 UTC: eight selected jobs passed and 25 were correctly skipped. The required aggregate gate passed. The latest 19:34 UTC ClawSweeper review has no blocking findings or remaining before-merge items.