Repository navigation
fix(macos): prevent premature catalog frame-limit test failures - #132585
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 10:44 AM ET / 14:44 UTC. ClawSweeper reviewWhat this changesThe PR replaces a macOS test’s marker-file readiness wait with cancellable nonblocking FIFO readiness before it exercises a smaller frame limit on the queued request. Merge readinessKeep open: current main still has the premature marker wait, while this focused test-only patch replaces it with a causal FIFO readiness observation. No introduced correctness or security defect was found; reconcile the current exact-head required-check rollup before merge. Priority: P3 Review scores
Verification
How this fits togetherThe macOS catalog runtime serializes requests to an App Server process and enforces each active request’s frame-size limit. The changed fixture controls two requests through a FIFO so it can verify the first succeeds and the oversized second response fails. flowchart LR
A[Catalog test] --> B[Serialized client queue]
B --> C[Fake App Server]
C --> D[FIFO response gate]
D --> E[First request succeeds]
B --> F[Second oversized response]
F --> G[Frame-limit error]
Before merge
Agent review detailsSecurityNone. PR surfaceOther +48. Total +48 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the FIFO-based readiness assertion once the required exact-head check state is confirmed, retaining the existing first-request success and second-request frame-limit contract. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the prior fixture started a two-second marker wait before the client admitted its first request, while the client creates that request’s timer only after queue admission. Is this the best way to solve the issue? Yes. FIFO writer acquisition observes the fake server after it consumes the first request, unlike the removed pre-admission marker deadline; increasing a timeout would only mask the scheduling boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8d30790f083c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready for the unchanged native-only patch, reviewed head a1272b232cb34b0f4f229d3403ae608f4b1503ed. Required PR CI 33252731903, attempt 1 completed successfully, including Native job logs were independently inspected:
The original warmup, two-second request timeout, first-request success, 1024→64 transition, and exact I re-read the latest ClawSweeper review and rank-up moves. The exact-head native result is now confirmed in both CI modes, and the latest review/moves have been checked; no code changes were requested. Explicitly separate baseline failures: the broader hosted fallback 33253792826 is not green. Its Chromium preregistration fixture and offline native-ripgrep prerequisite failures are recorded as independent follow-ups; the schema-test mismatch is already fixed on main by 16367468. The maintainer explicitly chose to land only this native fix on its successful required gate, with those broader failures documented—not repaired, hidden, or called passing here. No production/schema, CI/backend/runner configuration, or unrelated test changes are included. Local scheduling/failure-injection controls were not executed, as documented in the PR body. The serial CI success is not claimed to reproduce the original exact order or identify the originally delayed phase. All native proof used disposable CI; no operator app, Keychain/config/defaults, installed Gateway, or excluded resource was used. |
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where the native catalog frame-limit test could fail its readiness assertion under scheduling delay even though the first request succeeded and the next request correctly rejected an oversized response. The reported serial native run failed only the
first-startedmarker expectation atd53f57c3d25059244376b5a799b89b8756b240ea.Why This Change Was Made
The test already had a response FIFO, but still started a separate marker deadline before its first task reached the client's serial queue. The request's own timeout starts inside queue admission. Successful FIFO-writer acquisition now establishes that the fake server has consumed the first request and reached its response gate before the second request is created.
The shared test-only FIFO helper uses cancellable nonblocking opens, and first-request completion cancels readiness so an early server failure is reported rather than leaving a blocking open behind. SIGPIPE protection and owned descriptor, task, fake-server, and client cleanup remain explicit.
Warmup, the two-second request timeout, the 1024 → 64 frame-limit transition, the throwing first-request success check, and the exact
responseTooLargeexpectation remain intact. No production code, queue hooks, dependency settings, or SwiftPM backend configuration changes are included. Increasing the marker timeout or moving the old blocking FIFO open earlier would not repair the causal/failure-aware readiness boundary.The marker originated in Codex App Server client reuse, authored and merged by @vincentkoc, and was retained by the later FIFO/warmup conversion in session provenance and native fixture cleanup, authored and merged by @steipete. This is a test-fixture synchronization repair, not a Codex protocol-defect claim.
User Impact
No runtime behavior changes. Native verification no longer imposes an unrelated pre-admission readiness deadline, without relaxing the frame-size or request-timeout contracts.
Production LOC: +0 / −0. Tests/test support: +79 / −31 (net +48).
Evidence
Reported pre-fix evidence: the serial native run on disposable macOS 26.6.2 / Swift 6.4 failed only the two-second
first-startedmarker expectation; the first request succeeded and the second produced the expectedresponseTooLarge. The case took 4.444 seconds, which does not identify the delayed phase. The test/client originals are unchanged between the reported revision and the checked main baseline.Completed source checks:
swiftformat --lint --cache ignore --config config/swiftformat apps/macos/Tests/OpenClawIPCTests/MacNodeCodexThreadCatalogTests.swift(SwiftFormat 0.62.1)node scripts/check-no-conflict-markers.mjsgit diff --checkscoped-clean, no findings (source review only)Required exact-head CI is green: run 33252731903, attempt 1, including
macos-swift,macos-node, and the Actions-ownedopenclaw/ci-gate, ata1272b232cb34b0f4f229d3403ae608f4b1503ed.Native evidence was independently read from the completed job logs:
Both use the existing repository CI/native build-engine configuration selected by the maintainer. No workflow, runner, backend, or timeout setting was changed.
The broader hosted fallback run 33253792826 failed non-native baseline checks: Chromium fixture preregistration, a missing real ripgrep prerequisite for offline native-grep tests, and schema-version fixture assertions. The schema-test mismatch is already repaired on main by 16367468 — track current agent schema in eligibility checks. The browser fixture and hosted-ripgrep prerequisite are recorded as separate follow-ups, not added to this PR. The maintainer explicitly selected native-only landing on the successful required PR gate; the broader fallback is not represented as green and no gate bypass is used.
Local proof gap: no local native test or diagnostic control executed. The initial supplemental macOS 26.6 / Swift 6.3.3 VM failed to build the unchanged baseline on missing SwiftUI macro plugins. A verified Swift 6.4 payload was then prepared, but Parallels could not launch that guest bootstrap; a boot-runner alternative could not clone the active/suspended templates without disturbing their owners. All task-created VMs were cleaned up. The proposed controlled scheduling, early-exit, timeout, and frame-size sensitivity checks remain unexecuted; source review is not presented as runtime proof.
Follow-up outside this patch: audit the remaining marker-based timeout/cancellation readiness cases separately. Second-task creation preserves the existing queue scenario; this patch does not add a production queue-admission test seam.
AI-assisted.