Repository navigation
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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper re-review Please review the current head. The macOS fixture proof, local review, and exact-head CI are complete. |
|
🦞👀 Re-review progress:
|
|
Codex review: passed. What this changesThis PR scopes the Linux platform mock to the memory-pressure check so real SQLite workers retain their native platform identity. Example: Run the cron maintenance pressure=process case on macOS with 128 MiB available against a 1 GiB process limit.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — suspected predecessor, not a causality claim: source commit Possible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR restores useful macOS test coverage with a focused fixture repair; no actionable correctness or security defects were found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway cron maintenance checks memory pressure before admitting retention work; this test combines a controlled scheduler and memory inputs with real SQLite-backed history and session maintenance. flowchart TD
A[Controlled scheduler] --> B[Cron maintenance]
B --> C[Real memory pressure decision]
C --> D[Scoped Linux platform mock]
B --> E[Retention and session maintenance]
E --> F[SQLite with native platform identity]
Technical reviewBest possible solution: Retain this fixture repair so memory-pressure coverage uses the real decision while SQLite observes the native platform. Do we have a high-confidence way to reproduce the issue? The fixture-wide platform mock and platform-sensitive namespace reader establish the failure path, supported by the author's macOS base-fail/head-pass report; this read-only review ran no tests. Is this the best way to solve the issue? The change uses an existing scoped helper, preserves the real memory-pressure calculation and every assertion, and avoids changing production SQLite or maintenance behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8052dd7cffb7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +5. Total +5 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 10:52 AM ET / 15:52 UTC. |
|
Merged via squash.
|
(cherry picked from commit c8e6d12) Companion audit: #204622 (1ee3caa) is not applicable: its keep-warm config is absent from the baseline and this test fails schema validation with it. #200180 (9f50802) is separately selected later in this lane; #206779 (76f14c3) targets that later pressure macOS simulation. Co-authored-by: RomneyDa <[email protected]>
* fix(runtime): defer optional work under host memory pressure * style(infra): format memory pressure admission * style(gateway): format the deferred prewarm check (cherry picked from commit 9f50802) Companion audit: #207993 selected later for publication fixture isolation. #206779 required if the new Cron host-memory fixture spoofs platform: preserve native SQLite namespace. #206041/#206230/#206308/#206746 are separate cgroup detection and optimization changes; #206322 is service-aware cron run budget, #206483 forks chat and #206384 changes a main-only warmer. Release adaptation: Extend the stable optional-memory owner and its existing callers only. Preserve cgroup/Bun/macOS behavior and upstream threshold cases; omit main-only prompt warmer, cgroup diagnosis, and Cron platform-spoof changes. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Two cron retention tests on macOS fail with a SQLite offline-maintenance error introduced by #200180. The fixture reports Linux while it opens a real SQLite worker, so the writer cannot publish a usable macOS process namespace.
User Impact
Developers can run the cron retention suite on macOS and get a verdict on retention and memory pressure. This is a test-only change with production LOC 0.
Why This Change Was Made
The fixture uses the existing
withMockedPlatformhelper around the real synchronous memory-pressure decision. The SQLite writer and worker use the native platform. All existing assertions and the synthetic low-memory inputs still run.Evidence
On clean macOS
origin/mainat4d7e00b86313, thepressure=noneandpressure=processcases both failed with SQLite offline maintenance. The same command passed both cases with the fix in 14.92 s wall.node scripts/run-vitest.mjs src/cron/maintenance.test.ts -t 'runs Gateway retention after memory pressure clears \(pressure=(none|process)\)$' --maxWorkers=1 --reporter=verboseOPENCLAW_VITEST_RUNTIME=node pnpm test src/cron/maintenance.test.ts --maxWorkers=1 --reporter=verbosepassed all six cases in 27.76 s wall, includingpressure=host.A temporary change from 20% to 10% in both pressure thresholds caused
pressure=processandpressure=hostto fail at the existing zero-admissions assertion. Each observed onecron:maintenanceadmission. Restoring the thresholds left a fixture-only diff.pnpm check:changedpassed format, lint, cron typechecking, and the remaining checks. Its sole failure, the production Knip finding forsrc/infra/restart.ts: hasPendingGatewayRestart, reproduced on clean4d7e00b86313. improve: keep Gateway restart controls out of local model preparation #206739 moved the last production caller torestart-pending.tsand retained the old re-export.The scoped rerun of
pnpm check:changedpassed with only the reproduced dead-export scan omitted.Codex autoreview found no actionable P0–P2 issues in the fixture diff against
4d7e00b86313.