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 SummaryThis 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets config-health startup reads reuse clean-close seals and adds a retained config backup to the startup benchmark. Example: Start a Gateway with a retained openclaw.json.bak and cleanly closed shared-state SQLite database.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a concrete redundant startup copy using the existing snapshot owner, and review found no actionable code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway config recovery reads saved health rows through the shared-state reader; the snapshot owner selects sealed-source reuse or an artifact-preserving private copy and returns the health snapshot. flowchart TD
A[Gateway startup] --> B[Config recovery]
B --> C[Config health owner]
C --> D[Receipt cache]
C --> E[Existing snapshot owner]
E --> F[Sealed database read]
E --> G[Private snapshot read]
Technical reviewBest possible solution: Use the existing snapshot owner to eliminate the sealed-state copy while preserving receipt invalidation, unsealed artifact preservation, and recovery write guards. Do we have a high-confidence way to reproduce the issue? Source traces a retained backup to the health read and an artifact-preserving copy on main; the PR reports the regression failing on base, but this read-only review ran no target code. Is this the best way to solve the issue? The change is a focused reuse of existing lifecycle machinery, with no duplicate seal validation, cache, or storage owner; its end-to-end performance value remains subject to the recorded acceptance rule. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fe739f62fcfa. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +25, Docs +1, Other +3. Total +41 across 4 files. Added test files: 0. View PR surface stats
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 October 20, 2026, 1:39 PM ET / 17:39 UTC. |
Outcome
Not selected for landing: the prewritten performance acceptance criterion was not met. Two valid concurrent, swapped-core comparisons showed no material startup improvement. This proposed change is not shipped.
What Problem This Solves
A Gateway with a retained config backup copies the shared-state database during its first config-health read, even when a valid clean-close seal already permits a safe read without a copy.
User Impact
The proposal avoids one unnecessary whole-database snapshot for cleanly closed state. Unsealed state retains its private-copy path. Config recovery, stored data, permissions, and normal runtime reads are unchanged; no migration or new configuration is required.
Why This Change Was Made
The config-health owner now uses the existing retained snapshot owner after an artifact-preserving cache miss, allowing that owner to reuse its clean-close proof. Receipt cache hits remain before snapshot preparation; maintenance/schema contexts keep their existing path. The production change is net +12 lines (plus 3 benchmark lines) because it selects the existing snapshot lifecycle without removing the required unsealed fallback or duplicating seal validation. There is no new cache or snapshot implementation.
The existing
teamBootbenchmark now retains an identical config backup so it exercises this otherwise-missed startup read. It still seeds eight synthetic agents, 4,096 sessions, 44 synthetic startup-active plugins, and 128 MiB of incompressible shared-state payload.Evidence
node scripts/run-vitest.mjs src/config/io.health-state-scope.test.ts --maxWorkers=1: 15 passed. Wrapper wall time 46.67 s including worker compilation; tests approximately 10 s. Base regression failed for the intended extra copy; the other 13 existing cases passed.pnpm tsgo:core(tsrs) passed.Paired startup measurements
Both comparisons ran concurrently under an exclusive measurement lock, using separate state directories and 16 cores per side; the second pair swapped CPU halves. Each fresh fixture had eight agents, 4,096 sessions, a matching config backup, 135,950,336 allocated shared-state database bytes, and 44 loaded plugins (43 synthetic plugins plus explicitly selected
memory-core). Outside CPU load was recorded withmpstatfor context.Median paired spawn-to-ready difference: +146.6 ms (+0.65%). The gate required at least 5% improvement; it was not met. First seeded-session RPC was +44.1 ms (+0.19%), sampled CPU showed no difference at its sampling resolution, peak Gateway RSS was +50.0 MiB (+0.75%), and shutdown was −59.2 ms (−2.00%). These are neutral/noisy results, not a demonstrated performance benefit.
All four measured processes passed
/healthz,/readyz, the seededsessions.listrequirement, the exact 44-plugin inventory check, and clean shutdown without forced termination. All 59 PR checks passed; independent review and both automated reviews found no actionable code defect.Setup failures are excluded: an initial pair exited before startup because the artifact layout omitted root launcher companions. After correcting the layout, a functional smoke exposed the default fixture's 44 synthetic plugins plus default-slot
memory-core(45 total). The supported--bundled-plugin-fixtureoption supplied the explicit 44-plugin inventory above before any valid A/B result. A separate corrected smoke passed; its timings are excluded.Runtime compilation, asset preparation, bootstrap checks, 55 native plugin control-plane module loads, postbuild, and runtime stamps passed. The broader build's UI tail attempted dependency reconciliation and was refused; UI was disabled for this benchmark. Both sides reused the same external dependencies and current workspace-package outputs; this was controlled A/B evidence, not an exact frozen-lock installation reproduction. No production-ready improvement is claimed.