Repository navigation
fix(state): settle restart reads after caller retirement - #175461
Conversation
Fix forward from #175307. The native admission helper recognized a committed registration notice, but its outer callback still checked the retired caller. Refusing that bookkeeping notice left an opened worker without its installed identity and replaced the expected lifecycle refusal with unknown settlement. End authorization for this already-observed COMMIT at the outer callback. Receipt observation still validates and records the exact registration owner; subsequent validation, preparation and command admission keep live authority. Generic failed-report retirement and first-use creation checks are unchanged. Also align the queued-collector fixture with #174111's documented contract: uncaptured lifecycle events publish current updated facts. Select create or updated session publications while retaining every payload, runtime, Stop and authority assertion. A forced initial capture miss reproduced the exact hourly failure with a correctly published Collector B row, and passes after this fix. Current main with #175307 reverted passed both full files (48 tests). Restoring it reproduced both cold-registration failures. The repair passes 148 tests across the execution, restart, reclamation, reply and collector files; one existing Linux-only killed-owner test remains skipped on macOS. Targeted state and Gateway test type graphs, type-aware lint, formatting and P0-P2 review pass. No timeouts, retries, schemas or permission contracts changed.
|
🦞👀 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 changesThe PR acknowledges completed database registration after caller retirement and aligns the queued-collector test with current event publication behavior. Example: A reply lifecycle retires while cold database registration reports its completed COMMIT.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a source-confirmed restart-readiness failure, with no actionable introduced defects found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe native agent database executor connects Gateway callers to SQLite workers, admitting operations and reconciling registration receipts, identity, and settlement. flowchart LR
Caller[Gateway caller] --> Executor[Agent database executor]
Executor --> Admission[Worker admission]
Admission --> Worker[SQLite worker]
Worker --> Receipt[Registration receipt]
Receipt --> Registry[Registration settlement]
Registry --> Executor
Technical reviewBest possible solution: Acknowledge completed registration once, then enforce current caller authority before subsequent preparation and commands. Do we have a high-confidence way to reproduce the issue? The existing cold-registration lifecycle test supplies a concrete trigger, and independently inspected main-hourly annotations match the source-visible unknown-settlement path; no target code was executed during this review. Is this the best way to solve the issue? The repair restores the existing distinction between recording completed work and authorizing future effects, while the fixture change follows the broadcaster's established contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9f39528c0cc7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +4. Total +5 across 2 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 17, 2026, 7:33 AM ET / 11:33 UTC. |
openclaw#175461) Fix forward from openclaw#175307. The native admission helper recognized a committed registration notice, but its outer callback still checked the retired caller. Refusing that bookkeeping notice left an opened worker without its installed identity and replaced the expected lifecycle refusal with unknown settlement. End authorization for this already-observed COMMIT at the outer callback. Receipt observation still validates and records the exact registration owner; subsequent validation, preparation and command admission keep live authority. Generic failed-report retirement and first-use creation checks are unchanged. Also align the queued-collector fixture with openclaw#174111's documented contract: uncaptured lifecycle events publish current updated facts. Select create or updated session publications while retaining every payload, runtime, Stop and authority assertion. A forced initial capture miss reproduced the exact hourly failure with a correctly published Collector B row, and passes after this fix. Current main with openclaw#175307 reverted passed both full files (48 tests). Restoring it reproduced both cold-registration failures. The repair passes 148 tests across the execution, restart, reclamation, reply and collector files; one existing Linux-only killed-owner test remains skipped on macOS. Targeted state and Gateway test type graphs, type-aware lint, formatting and P0-P2 review pass. No timeouts, retries, schemas or permission contracts changed.
What Problem This Solves
Fixes the restart-readiness regression introduced by #175307 without removing its revoked-caller and cancellation guarantees. When an old reply's lifecycle retires while a cold agent registration reports its already-completed COMMIT, the inner admission helper returned but the outer callback still checked caller authority. That refused a bookkeeping acknowledgement while the worker had an open connection but had not installed its identity. Settlement then replaced the expected stale-lifecycle refusal with an unknown-outcome error.
The committed-registration exception now ends the outer authorization callback. The admission observer still validates and records the exact registration receipt. The next validation and every actual operation still require live authority. First-use creation wrappers keep their independent checks, and genuine reporting failures still require retirement.
The queued-collector failure is a separate fixture assumption. Since #174111, “uncaptured lifecycle events publish current updated facts without predecessor label/swarm/capacity overrides.” The fixture selected only
reason: create. It now selects thesessions.changedpublication for either documentedcreateorupdatedform, retaining all label, status, runtime, Stop and authorization assertions.Evidence
Main hourly 39025102777 reported both failures. The correct restart job is
117374543019(compact-small-10); the supplied117374542980is compact-small-7 and does not contain that test. The collector job is117374542999. Each log was fetched once.8839e329ea70, a local diagnostic revert of fix: keep revoked and cancelled callers from affecting shared database preparation #175307 passed both complete reported files: 48 tests. Restoring fix: keep revoked and cancelled callers from affecting shared database preparation #175307 reproduced both cold-registration cases with the exactunsettled native connection/unknown-outcome signature. The diagnostic revert is not part of this PR.updatedrow with queued status and null runtime. The corrected selection passed that same forced condition. All temporary diagnostic hooks were removed.--maxWorkers=1: 122 passing cases across all eight execution test files, restart lifecycle, Gateway reclamation and reply admission; then all 26 collector cases passed. One pre-existing Linux-only killed-owner case is skipped on macOS and remains for CI. The native group took 205.30 seconds including preparation; the collector file took 62.71 seconds including preparation.git diff --check.The collector's publication contract predates the hourly window; no single new scheduling commit is claimed as its trigger. No retries, longer timeouts, schema changes or permission expansion. No workflow was dispatched or rerun. Ready for the lead to land after CI.