Repository navigation
fix(gateway): preserve session state during slow shutdown - #188920
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 changesKeep accepted session finalizers joined before shutdown releases Gateway state ownership. Example: An accepted agent finalizer takes six seconds to finish after SIGTERM.
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 addresses a shutdown persistence defect still present on main. The focused change preserves existing ownership and deadline mechanisms; no actionable introduced defect was found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway shutdown coordinator receives committed stop or restart requests, persists restart markers, cancels execution, joins accepted work, and then retires resources and releases the Gateway lock. flowchart TD
A[Committed stop or restart] --> B[Fence new admission]
B --> C[Persist restart markers]
C --> D[Cancel active execution]
D --> E[Join accepted finalizers]
E --> F[Retire resources]
F --> G[Release Gateway lock]
Technical reviewBest possible solution: Join required finalizers through the existing shutdown owners before state retirement, retaining the current outer shutdown deadline. Do we have a high-confidence way to reproduce the issue? Source tracing establishes the early-return-to-state-seal path; the author reports matching base failures and fixed process results under Node and Bun, which this read-only review did not rerun. Is this the best way to solve the issue? The patch is the smallest complete repair for the stated persistence boundary: remove premature timeout settlement, join all accepted siblings, and retain existing cancellation and watchdog owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3e1dbed3b0de. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -18, Tests +115, Docs +1. Total +98 across 7 files. Added test files: 0. View PR surface stats
Review metrics
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 30, 2026, 9:43 PM ET / October 31, 2026, 01:43 UTC. |
…settle (openclaw#188920) On the Team stop of 2026-10-31 00:12Z, session admissions exceeded the 5 s shutdown grace, shutdown abandoned the required join and released the Gateway lock, and state read admission was invalidated while accepted finalizers were still writing: terminal session persistence for three sessions, pending-input settlement and worktree run-lease release all failed with STATE_DATABASE_READ_ADMISSION_INVALIDATED. Required close steps now keep their join after the grace warning instead of breaking, and session shutdown waits for every accepted persistence sibling (allSettled, rejections surfaced together) before state admission is released. A stuck finalizer is still bounded by the existing watchdog deadline; budgets are unchanged. The agent-DB reopen loop seen in the same stop (session-row projection backfill queue without a close fence is the identified candidate) and a generic plugin shared-state fence remain follow-ups.
Align startup rollback proof with required finalizer joins from #188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]>
…very (#188656) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from #188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f --------- Co-authored-by: galiniliev <[email protected]>
Integrate the exact upstream base used by the failing PR CI merge so the fixture follows #188920 required-shutdown custody after diagnostic grace. Release the held sidecar before awaiting startup settlement, then verify transport and secret cleanup without extending timeouts. The local pre-repair merge tree matches CI merge 3b597b415d094401a55ad798ee25ed371f3c908e. The repaired five-file cohort passes 21/21 on that full merged tree. The optional same-node split prototype remains unpublished. Co-authored-by: galiniliev <[email protected]>
…188679) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Keep image preparation separate from repository contents and empty workspaces. Select runtime-only intents for image-capacity integrations, claim under live authority, and perform repository startup with the current request's credential reader. Settle rejected unallocated image requests without breaking stored provisioning replay. Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: eb6f32e5-03b0-429d-809d-1189bd23b87c * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * test: restore canonical image reserve test ordering Keep Gateway database-worker discovery and its canonical registry in the same sorted order. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * test(workers): prove image claims through real repository effects Exercise native App issuance, authenticated Git checkout, checkpoint restore, revoked and reassigned callers, and fresh recovery authority without cloud spend. Preserve existing prepared-node proof via a shared unprepared-node fixture. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 16ac53c7-b38a-4982-8945-8f24c047ff8e * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * test(workers): cover managed identity image claims and recovery Exercise PAT and OAuth image checkout with the original host admission reader, denied callers and caller retirement. Share native profile setup with source-capacity proof, whose fixture remains explicit about repository preparation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c3df37e2-07fc-4a9b-95a6-acb3a077f3cb * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: cb7ac3cb-df17-4874-98ec-23f5eec0838c * test(workers): exercise repository admission after image allocation Remove the RPC fixture-only repository identity call from credential-free image intent creation. Keep actual repository startup and all denial controls, assert one managed verification on success, and shrink the matching test allocation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 21adb907-ae6f-446c-8e58-29fa48af700a * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from #188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 2098e121-027c-4257-bfed-57016863f99b * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 0ec84c8a-6397-489f-8d47-3fed1f9c9414 --------- Co-authored-by: galiniliev <[email protected]>
…ence (#188686) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Keep image preparation separate from repository contents and empty workspaces. Select runtime-only intents for image-capacity integrations, claim under live authority, and perform repository startup with the current request's credential reader. Settle rejected unallocated image requests without breaking stored provisioning replay. Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: eb6f32e5-03b0-429d-809d-1189bd23b87c * feat(workers): keep runtime image reserves ready without browser presence Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 130a2b63-442c-4c80-aa7b-39bc5c4b872b * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * test: restore canonical image reserve test ordering Keep Gateway database-worker discovery and its canonical registry in the same sorted order. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * fix(workers): keep reserve cleanup independent of policy admission Co-authored-by: galiniliev <[email protected]> * test(workers): prove image claims through real repository effects Exercise native App issuance, authenticated Git checkout, checkpoint restore, revoked and reassigned callers, and fresh recovery authority without cloud spend. Preserve existing prepared-node proof via a shared unprepared-node fixture. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 16ac53c7-b38a-4982-8945-8f24c047ff8e * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 36d2aa5d-b360-4bb3-b442-ca44063ff2b2 * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * test(workers): cover managed identity image claims and recovery Exercise PAT and OAuth image checkout with the original host admission reader, denied callers and caller retirement. Share native profile setup with source-capacity proof, whose fixture remains explicit about repository preparation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c3df37e2-07fc-4a9b-95a6-acb3a077f3cb * fix(workers): retain standing reserves during demand reconstruction Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 59e2edfb-d822-4d6e-93de-a5edbb076479 * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: cb7ac3cb-df17-4874-98ec-23f5eec0838c * test(workers): exercise repository admission after image allocation Remove the RPC fixture-only repository identity call from credential-free image intent creation. Keep actual repository startup and all denial controls, assert one managed verification on success, and shrink the matching test allocation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 21adb907-ae6f-446c-8e58-29fa48af700a * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 869588f1-1142-4887-9785-353e5050fa2f * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from #188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 2098e121-027c-4257-bfed-57016863f99b * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5537df35-0ca3-4b29-a1b1-8f2ce9b02a23 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 0ec84c8a-6397-489f-8d47-3fed1f9c9414 * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 184bf98b-756a-4986-9bbb-ef9a7cf5a640 * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c21eb49f-3ad5-4ec6-be3a-da37e8a22288 --------- Co-authored-by: galiniliev <[email protected]>
…very (openclaw#188656) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from openclaw#188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f --------- Co-authored-by: galiniliev <[email protected]>
…penclaw#188679) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Keep image preparation separate from repository contents and empty workspaces. Select runtime-only intents for image-capacity integrations, claim under live authority, and perform repository startup with the current request's credential reader. Settle rejected unallocated image requests without breaking stored provisioning replay. Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: eb6f32e5-03b0-429d-809d-1189bd23b87c * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * test: restore canonical image reserve test ordering Keep Gateway database-worker discovery and its canonical registry in the same sorted order. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * test(workers): prove image claims through real repository effects Exercise native App issuance, authenticated Git checkout, checkpoint restore, revoked and reassigned callers, and fresh recovery authority without cloud spend. Preserve existing prepared-node proof via a shared unprepared-node fixture. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 16ac53c7-b38a-4982-8945-8f24c047ff8e * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * test(workers): cover managed identity image claims and recovery Exercise PAT and OAuth image checkout with the original host admission reader, denied callers and caller retirement. Share native profile setup with source-capacity proof, whose fixture remains explicit about repository preparation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c3df37e2-07fc-4a9b-95a6-acb3a077f3cb * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: cb7ac3cb-df17-4874-98ec-23f5eec0838c * test(workers): exercise repository admission after image allocation Remove the RPC fixture-only repository identity call from credential-free image intent creation. Keep actual repository startup and all denial controls, assert one managed verification on success, and shrink the matching test allocation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 21adb907-ae6f-446c-8e58-29fa48af700a * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from openclaw#188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 2098e121-027c-4257-bfed-57016863f99b * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 0ec84c8a-6397-489f-8d47-3fed1f9c9414 --------- Co-authored-by: galiniliev <[email protected]>
…ence (openclaw#188686) * feat(workers): preserve repository authority through dispatch and recovery Extract the optional repository integration prerequisite and carry current caller authority through native App issuance, preparation, checkout and authenticated redispatch. Keep cleanup with dispatch and preserve native behavior when no integration is selected. Co-authored-by: galiniliev <[email protected]> * fix(workers): keep repository admission out of node transport Consume source credential capabilities in the host access owner before handing the ordinary prepared binding to node transport. Co-authored-by: galiniliev <[email protected]> * feat(workers): preserve repository authority during dispatch and recovery Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 4abaa98c-2f3b-4712-af02-5afb8839a3bd * test: preserve integration exports in dispatch fixture Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Keep image preparation separate from repository contents and empty workspaces. Select runtime-only intents for image-capacity integrations, claim under live authority, and perform repository startup with the current request's credential reader. Settle rejected unallocated image requests without breaking stored provisioning replay. Co-authored-by: galiniliev <[email protected]> * feat(workers): start repository sessions from runtime image reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: eb6f32e5-03b0-429d-809d-1189bd23b87c * feat(workers): keep runtime image reserves ready without browser presence Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 130a2b63-442c-4c80-aa7b-39bc5c4b872b * fix(workers): stop checkout when repository access is revoked Keep the repository policy assertion in shared read identities and prepared workspace synchronization through checkpoint awaits and each worker command. Prove allowed, forbidden, and late-revoked cold and prepared flows with local Node execution, Git, and checkpoint transfer. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ca19bb5b-7413-420d-9ba1-46578e011f37 * test: restore canonical image reserve test ordering Keep Gateway database-worker discovery and its canonical registry in the same sorted order. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: ab1916b4-e0cf-4992-a62f-13d94e27e2db * fix(workers): keep reserve cleanup independent of policy admission Co-authored-by: galiniliev <[email protected]> * test(workers): prove image claims through real repository effects Exercise native App issuance, authenticated Git checkout, checkpoint restore, revoked and reassigned callers, and fresh recovery authority without cloud spend. Preserve existing prepared-node proof via a shared unprepared-node fixture. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 16ac53c7-b38a-4982-8945-8f24c047ff8e * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 36d2aa5d-b360-4bb3-b442-ca44063ff2b2 * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: f39063e4-d5ac-484a-996c-378d1aed25ae * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 405b9b26-cce1-43e7-9acb-93166b710d9c * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c1d161ad-84f6-4784-bd5c-c779e8588775 * test(workers): cover managed identity image claims and recovery Exercise PAT and OAuth image checkout with the original host admission reader, denied callers and caller retirement. Share native profile setup with source-capacity proof, whose fixture remains explicit about repository preparation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c3df37e2-07fc-4a9b-95a6-acb3a077f3cb * fix(workers): retain standing reserves during demand reconstruction Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 59e2edfb-d822-4d6e-93de-a5edbb076479 * fix(workers): retain repository admission after session creation Forward the native caller-bound reader through required placement without borrowing a chat scope. Keep automatic repository setup aligned with required-worker setup policy and repair the exact-head CI fixtures. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 72a91f97-2870-4d52-87e3-5f276658e867 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: cb7ac3cb-df17-4874-98ec-23f5eec0838c * test(workers): exercise repository admission after image allocation Remove the RPC fixture-only repository identity call from credential-free image intent creation. Keep actual repository startup and all denial controls, assert one managed verification on success, and shrink the matching test allocation. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 21adb907-ae6f-446c-8e58-29fa48af700a * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 869588f1-1142-4887-9785-353e5050fa2f * fix(gateway): preserve native shutdown and identity fixture contracts Align startup rollback proof with required finalizer joins from openclaw#188920. Keep native repository connection and Enterprise identity resolution in the handshake fixture, mocking only remote enrichment. Preserve existing handshake and revocation assertions. Co-authored-by: galiniliev <[email protected]> * Publish openclaw/p3a-repository-authority Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5bbb8a2f-4466-4f58-9406-3c8b39e44b5f * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 2098e121-027c-4257-bfed-57016863f99b * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 5537df35-0ca3-4b29-a1b1-8f2ce9b02a23 * Publish openclaw/p3a-runtime-image-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 0ec84c8a-6397-489f-8d47-3fed1f9c9414 * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: 184bf98b-756a-4986-9bbb-ef9a7cf5a640 * Publish openclaw/p3a-standing-reserves Worked on by: - @galiniliev Co-authored-by: galiniliev <[email protected]> OpenClaw-Publication: c21eb49f-3ad5-4ec6-be3a-da37e8a22288 --------- Co-authored-by: galiniliev <[email protected]>
…settle (#188920) On the Team stop of 2026-10-31 00:12Z, session admissions exceeded the 5 s shutdown grace, shutdown abandoned the required join and released the Gateway lock, and state read admission was invalidated while accepted finalizers were still writing: terminal session persistence for three sessions, pending-input settlement and worktree run-lease release all failed with STATE_DATABASE_READ_ADMISSION_INVALIDATED. Required close steps now keep their join after the grace warning instead of breaking, and session shutdown waits for every accepted persistence sibling (allSettled, rejections surfaced together) before state admission is released. A stuck finalizer is still bounded by the existing watchdog deadline; budgets are unchanged. The agent-DB reopen loop seen in the same stop (session-row projection backfill queue without a close fence is the identified candidate) and a generic plugin shared-state fence remain follow-ups. (cherry picked from commit 4e55843) Co-authored-by: RomneyDa <[email protected]>
Related: #188402, #188496, #188413
What Problem This Solves
Fixes terminal-session and pending-input persistence being invalidated during Gateway shutdown when accepted finalizers take longer than five seconds.
User Impact
Deploys keep accepted session finalizers joined before releasing the Gateway lock and state admission. The existing shutdown deadline and hard-exit watchdog remain unchanged; a finalizer that never settles can still reach that deadline.
Why This Change Was Made
The required connection-work join treated its five-second diagnostic grace as permission to return. The run loop then released the Gateway owner lease, whose seal-on-close invalidated shared-state read admission while finalizers were still writing. Keeping the actual required join alive preserves the existing after-resources retirement ordering. Session shutdown also waits for all accepted persistence siblings before reporting a rejection, instead of abandoning them through a separate five-second race.
Marker persistence still precedes cancellation, the snapshot abort remains intact, and no timeout, config, schema, dependency, or run-loop change is included. This is the coordinator-prioritized persistence repair; the production agent-DB reopen caller and wider plugin-work fence remain follow-ups. Exec/spawn-broker cleanup is owned by a separate lane.
Evidence
6f7b63cd95f27bd5c03df2b8a048087769708089, with the final tests and production fix removed: the required-join regression is red under both Node and Bun (1 failed, 3 passed). The isolated SIGTERM process regression is also red under both runtimes: the process still hasexitCode === nullten seconds after the held finalizer is released.git diff --checkpasses. The initial changed-check run found three missing-brace lint errors in the fixture; they were corrected and the final targeted lint passed.Exact focused commands (each test command uses
--maxWorkers=1):The existing isolated restart process scenario now includes an active worktree-bound agent RPC run, another active tool run, a subagent, queued input, and a plugin scheduler touching shared cron state. A documented plugin hook holds the accepted finalizer beyond five seconds; the test then releases it, requires exit 0 within the existing ten-second assertion, checks that the worktree lease was released, rejects persistence-loss diagnostics, and verifies restart markers and queued-input replay. No live Gateway or real user state was used.
The production change removes 18 net lines. The process fixture and existing owner tests grow by 115 net lines to exercise the requested combined failure boundary without adding a separate Gateway fixture or new production test seam. No budget or baseline was raised.
Reported deployment timeline, 2026-10-31 UTC
The reported stop of release
797540497ae5already contained #188402 and #188496:STATE_DATABASE_READ_ADMISSION_INVALIDATED.Follow-up source evidence: the concrete reopen-capable owner is optional transcript backfill:
src/gateway/session-row-projection-backfill.ts:57–79drains queued rows until disposal, without a Gateway-close fence. Each row captures writable execution atsrc/gateway/session-row-transcript-backfill.ts:69–76with a no-op source guard and releases it at line 85;src/state/openclaw-agent-execution-owner.ts:579–620closes each native generation after the cleanup signal. Projection disposal belongs to the later request-runtime sidecar (src/gateway/server-kernel-request-runtime.ts:86–101), which the original required-join timeout skipped. This proves an unfenced reopen-capable owner, not that the reported production receipts came from this stack or that one row retried indefinitely; a large queue can also produce one receipt per row.src/agents/worktrees/run-lease.ts:182–210still retries deliberate admission invalidation. Plugin scheduling is already fenced atsrc/gateway/server-lifecycle.ts:529and joined throughsrc/plugins/service-scheduler.ts:33–51; the reported plugin work needs separate ownership tracing.