Repository navigation
fix: keep revoked and cancelled callers from affecting shared database preparation - #175307
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: needs maintainer review before merge. What this changesRequire a current caller for shared database preparation and preserve healthy borrowers after confirmed admission refusals. Example: Deletion of agent:main:validation-revoked loses authority during database integrity validation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR fixes a current caller-authority defect without sacrificing shared database preparation; no introduced defect was found, the earlier conflict blocker is resolved, and exact-head CI remains pending. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe agent database executor coordinates logical borrowers, physical worker generations, preparation, and cleanup; caller authority enters through admission sources and governs worker database effects. flowchart TD
A[Session and reply callers] --> B[Execution owner]
B --> C[Native generation]
C --> D[Shared preparation followers]
D --> E[Current caller admission]
E --> F[Database worker]
F --> G[Agent database]
Technical reviewBest possible solution: Keep preparation with the existing physical owner while requiring live follower authority and preserving borrower recovery only for confirmed uncommitted refusals. Do we have a high-confidence way to reproduce the issue? Current-main source exposes generation-only preparation authority, and the supplied real-worker regressions exercise revocation during validation and refusal before promotion; no target code was executed during this review. Is this the best way to solve the issue? The fix belongs in the shared preparation and execution owners, preserves physical preparation sharing, and distinguishes confirmed refusals from protocol faults, unknown outcomes, and cleanup failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c289fc3e057c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +51, Tests +54, Docs +5. Total +110 across 9 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 HistoryReview history (2 earlier review cycles)
Reviewed October 17, 2026, 5:27 AM ET / 09:27 UTC (Revision 3). |
46c9464 to
67ee184
Compare
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. |
|
@clawsweeper re-review Updated the idle-generation fixture contract at ec2e277cc13c. The full execution test group, state-logging test types, targeted checks, and independent P2 review pass; the PR body contains the proof and existing platform-specific gap. |
|
🦞👀 Re-review progress:
|
Require one current follower for shared integrity/schema effects. Settle request-owned native opening before a healthy successor reuses or replaces the generation; keep the full shared preparation joinable. Both hourly 39010956087 regressions came from #175008. Preserve the existing reclamation assertions while checking the missing index before incidental worker termination. Initial native admission and first-use creation retain original caller authority. Focused six-file proof plus final three-case integration cover 74 distinct passing cases; the existing Linux-only killed-owner case remains for CI. Targeted types, type-aware lint, docs, formatting and P2 review pass. Integrates with prerequisite #175295, which owns refusal propagation; no duplicate broker or worker changes.
Capture shared promotion admission as well as initial native admission, preserving logical borrowers only for known, uncommitted refusals. Protocol faults, unknown outcomes and cleanup failures retain their terminal handling. The new retained-borrower regression failed before this correction and passes with it. Also seed transcript data in the reclamation concurrency fixture: #175091 intentionally avoids reclamation workers for eventless deletes. Keep all original assertions and deadlines. Rebased focused proof covers 75 cases including both hourly 39013936147 reds; all 8 final error-path cases pass. Targeted types, lint, format, docs and independent P2 review pass.
Return no pending native open from the timer-only generation stub, matching the required contract introduced by #175307. The production factory already supplies this method; wrappers retain the real generation. Keep every idle expiry, reborrow, creation, alias, cleanup and restart assertion unchanged. Before: four idle lifecycle cases fail with getPendingNativeOpen missing, and the state-logging test graph reports TS2345. After: all eight openclaw-agent-execution test files pass (91 tests, one existing Linux-only skip; 125.20 seconds including worker preparation). State-logging test types, targeted lint, formatting and P2 review pass.
Main b499c60 moved existing-file opening off caller admission. Observe the real physical open so the refusal fixture still starts concurrent survivor reads, and remove its obsolete caller callback. Keep all refusal, liveness, exact-result and cleanup assertions. Clarify the shared native opening wording after integrating the peer cancellation fix. The requested ten-file proof passed 99 cases and exposed this stale trigger. The corrected close-wedge file passes all 7 cases (17.37 seconds), bringing combined coverage to 100 distinct passes and one existing Linux-only skip. Gateway reclamation is 2/2; reply admission, state-logging types, targeted lint and formatting pass. No CI reruns. Independent P2 review is scoped-clean for the rebased candidate and this fixture follow-up.
ec2e277 to
6ab6bb0
Compare
|
@clawsweeper re-review Rebased onto current main and resolved the shared-opening conflicts at 6ab6bb0. The PR body records the preserved authority and cancellation checks, 100 passing focused cases with one existing platform skip, targeted checks, and clean P2 reviews. |
|
🦞👀 Re-review progress:
|
#175461) 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.
…e preparation (openclaw#175307) * fix(state): retain caller authority during shared database preparation Require one current follower for shared integrity/schema effects. Settle request-owned native opening before a healthy successor reuses or replaces the generation; keep the full shared preparation joinable. Both hourly 39010956087 regressions came from openclaw#175008. Preserve the existing reclamation assertions while checking the missing index before incidental worker termination. Initial native admission and first-use creation retain original caller authority. Focused six-file proof plus final three-case integration cover 74 distinct passing cases; the existing Linux-only killed-owner case remains for CI. Targeted types, type-aware lint, docs, formatting and P2 review pass. Integrates with prerequisite openclaw#175295, which owns refusal propagation; no duplicate broker or worker changes. * fix(state): preserve borrowers after known promotion refusals Capture shared promotion admission as well as initial native admission, preserving logical borrowers only for known, uncommitted refusals. Protocol faults, unknown outcomes and cleanup failures retain their terminal handling. The new retained-borrower regression failed before this correction and passes with it. Also seed transcript data in the reclamation concurrency fixture: openclaw#175091 intentionally avoids reclamation workers for eventless deletes. Keep all original assertions and deadlines. Rebased focused proof covers 75 cases including both hourly 39013936147 reds; all 8 final error-path cases pass. Targeted types, lint, format, docs and independent P2 review pass. * test(state): complete idle generation fixture contract Return no pending native open from the timer-only generation stub, matching the required contract introduced by openclaw#175307. The production factory already supplies this method; wrappers retain the real generation. Keep every idle expiry, reborrow, creation, alias, cleanup and restart assertion unchanged. Before: four idle lifecycle cases fail with getPendingNativeOpen missing, and the state-logging test graph reports TS2345. After: all eight openclaw-agent-execution test files pass (91 tests, one existing Linux-only skip; 125.20 seconds including worker preparation). State-logging test types, targeted lint, formatting and P2 review pass. * test(state): follow physical admission in refusal fixture Main 0f21575 moved existing-file opening off caller admission. Observe the real physical open so the refusal fixture still starts concurrent survivor reads, and remove its obsolete caller callback. Keep all refusal, liveness, exact-result and cleanup assertions. Clarify the shared native opening wording after integrating the peer cancellation fix. The requested ten-file proof passed 99 cases and exposed this stale trigger. The corrected close-wedge file passes all 7 cases (17.37 seconds), bringing combined coverage to 100 distinct passes and one existing Linux-only skip. Gateway reclamation is 2/2; reply admission, state-logging types, targeted lint and formatting pass. No CI reruns. Independent P2 review is scoped-clean for the rebased candidate and this fixture follow-up.
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
A revoked session-deletion caller could repair its database before being refused. Shared database preparation must retain current caller authority without letting one cancelled or refused opener poison healthy borrowers. These failures were originally reproduced from main hourly 39013936147.
User Impact
Revoked callers cannot authorize schema repair or deletion. Healthy replies retain access after another caller is cancelled or refused, while current callers still share physical preparation. First-use creation, fatal native failures, cleanup failures, and unknown outcomes retain their existing ownership rules.
Why This Change Was Made
The shared preparation owner now retains each follower's authority check in that caller's context. Preparation effects require at least one current follower. The execution owner waits for pending initial native opening before choosing whether to reuse or replace a generation. Initial opening and shared promotion capture their actual admission outcome: a confirmed refusal before native entry preserves retained borrowers; protocol faults, unknown outcomes, committed work and cleanup failures keep their terminal handling.
Rebased onto main
b46ec6167975f57fa33cc298e78c8338ae59746e. Peer commitb499c60e1968says: “Existing-file opening belongs to the physical owner, like integrity preparation. Keep caller authority for first-use creation and actual operations so cancellation cannot poison a healthy peer.” The resolution preserves its shared-source and cancellation isolation, physical-failure fixtures, and creation-witness tests. It also preserves this PR's requirement that preparation effects have a current caller. The Gateway regression still checks that revocation leaves the index absent, the session and transcript unchanged, and native custody settled.Main already contains the transcript seed needed to exercise reclamation after #175091 moved eventless deletion to the admitted writer. That duplicate fixture hunk was removed. The idle-generation fixture includes the required
getPendingNativeOpenmethod. A remaining close-wedge fixture now observes the real physical open through the existing admission probe, since the peer change stopped routing that open through caller admission. Every refusal, concurrent-survivor, exact-result and cleanup assertion remains; the unused caller callback was removed.The patch keeps one preparation owner and one admission-capture helper. It introduces no schema, dependency, retry, timeout, or permission expansion.
Evidence
Reviewed head:
6ab6bb04830eeee99b6e9c702bdc95059ee46689.The original two-SHA evidence remains recorded: both reported cases failed on main
8d4591a6c152and passed on #175008's parent77cb93218d60. The reordered Gateway assertion demonstrated actual index repair after authority revocation, not just a worker-lifetime mismatch. The retained-borrower regression also failed before the promotion-outcome correction.Fresh proof after conflict resolution:
The requested ten-file run passed 99 cases and exposed the stale close-wedge trigger described above. After that fixture correction, its complete file passed 7/7 in 17.37 seconds. Combined retained proof covers 100 distinct passing cases across the requested files, including Gateway reclamation 2/2 (35.25 seconds) and all reply-turn admission cases. The pre-existing Linux-only killed-owner case remains unchanged and is skipped on this macOS host; PR CI covers Linux. The other passing suites were reused after the fixture-only correction.
The state-logging test type graph, targeted type-aware lint, formatting and whitespace checks pass. Typecheck and lint were repeated after the fixture imports changed. Independent P2 reviews are scoped-clean for the full rebased candidate and the final fixture delta; the reviewed final tree matches this head.
No CI dispatch or rerun. The lead owns landing after this head's CI.