Repository navigation
fix(state): retire startup metadata readers before gateway admission - #189722
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
793d087 to
ba633a5
Compare
Co-authored-by: RomneyDa <[email protected]>
ba633a5 to
91f24fa
Compare
Co-authored-by: RomneyDa <[email protected]>
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRetire startup metadata reader processes before returning their results so they cannot block Gateway admission. Example: A packaged macOS 2026.11.1-beta.1 installation reads config health before starting its Gateway.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete startup ownership failure with a focused lifecycle repair; no introduced defect was found. Priority: P0 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherConfig-health and plugin-metadata reads enter the shared SQLite reader pool; isolated children return metadata, and Gateway startup subsequently acquires state ownership. flowchart LR
A[Startup metadata request] --> B[SQLite reader pool]
B --> C[Broker reader process]
C --> D[Read under maintenance custody]
D --> E[Await native process exit]
E --> F[Return metadata]
F --> G[Gateway admission]
Technical reviewBest possible solution: Make startup recover automatically by awaiting native reader retirement in the existing pool before Gateway admission. Do we have a high-confidence way to reproduce the issue? The sealed startup reader borrows maintenance custody while the existing pool retains its process after success; the PR reports a red-before/green-after real-broker regression, which was inspected but not executed during this read-only review. Is this the best way to solve the issue? The patch restores the ownership invariant at the existing pool boundary, reuses native-close settlement, and preserves SQL, admission checks, and unrelated worker reuse. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4ade7ee96f86. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +13, Tests +58. Total +71 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 31, 2026, 4:14 PM ET / 20:14 UTC. |
|
Merged via squash.
|
…189722) * fix(state): retire startup metadata readers before gateway admission Co-authored-by: RomneyDa <[email protected]> * test(state): prove startup reader native retirement Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit a805746)
…penclaw#189722) * fix(state): retire startup metadata readers before gateway admission Co-authored-by: RomneyDa <[email protected]> * test(state): prove startup reader native retirement Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
Summary
retire-after-resultprocess-lifecycle policyRelease evidence
Fresh macOS packaged and installer checks for 2026.11.1-beta.1 both completed config health reads, retained the pooled reader process, then refused Gateway startup because that process still held the host-side sqlite-maintenance admission.
This does not alter SQL, schema, write behavior, or owner reclamation. It restores the existing ownership invariant at the transport boundary: a result is not returned while its process-scoped host admission remains live.
Validation
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/infra/sqlite-readonly-worker.operations.test.ts --maxWorkers=1(10/10)node scripts/run-format.mts --write src/infra/sqlite-readonly-worker.operations.test.tsgit diff --check