Skip to content

fix(gateway): preserve session state during slow shutdown - #188920

Merged
steipete merged 1 commit into
mainfrom
codex/shutdown-reopen-loop
Oct 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/shutdown-reopen-loop

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Base 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 has exitCode === null ten seconds after the held finalizer is released.
  • Fixed candidate: restart process scenarios pass under Node and the pinned Bun fork, including suspend/reopen, SIGTERM, managed handoff, queued-input replay, and crash/restart. Deliberately delayed SIGTERM exits 0 in 6,728 ms on Node and 6,884 ms on Bun; marker/abort phases are 1,476/1,544 ms.
  • Focused close-owner and run-loop process checks: 48 close-owner tests plus 2 run-loop process cases pass under both Node and Bun.
  • Targeted production and test typecheck/lint/format pass. All changed-lane ratchets pass; SQLite T1 calls remain 168 and compatibility calls remain 15. Final test-line ratchet: 6,316,453 / 6,348,324. git diff --check passes. The initial changed-check run found three missing-brace lint errors in the fixture; they were corrected and the final targeted lint passed.
  • Independent local Codex autoreview of the final candidate against the base above, including the lock-release/state-seal callers: scoped-clean at P0/P1, no accepted/actionable findings. Review did not execute the project tests. One earlier Bun attempt timed out in the unchanged SIGUSR2 retained-cleanup fixture at its 60-second limit. Baseline isolated, ordered-file, and original-shard comparisons passed; the unchanged fixed candidate then passed all 50 focused cases in the original shard sequence. The timeout was not reproduced or repaired, and remains an explicit follow-up rather than a claimed fix.

Exact focused commands (each test command uses --maxWorkers=1):

OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs test/gateway-restart-resume.e2e.test.ts --maxWorkers=1 -t 'blocked store: false'
OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs test/gateway-restart-resume.e2e.test.ts --maxWorkers=1 -t 'blocked store: true'
OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs test/gateway-restart-resume.e2e.test.ts --maxWorkers=1
# Required-join red/green: execute once with each runtime on base and fixed production.
OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/gateway/server-shutdown.test.ts --maxWorkers=1
# Focused green: execute with OPENCLAW_VITEST_RUNTIME=node and bun.
OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/gateway/server-close.test.ts src/gateway/server-shutdown.test.ts src/gateway/server-close.plugin-state.test.ts src/cli/gateway-cli/run-loop.direct-stop-active-work.process.test.ts --maxWorkers=1
node scripts/check-changed.mjs --base 6f7b63cd95f27bd5c03df2b8a048087769708089
node scripts/run-tsgo-core-test-shards.mjs root
node scripts/run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.test.root.json test/gateway-restart-resume.e2e.test.ts
pnpm check:test-lines-ratchet
git diff --check

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 797540497ae5 already contained #188402 and #188496:

  • 00:12:02.917: SIGTERM after committed handoff; drain/shutdown budgets were 74,924/84,924 ms.
  • 00:12:03.373: four restart markers persisted.
  • 00:12:08.403–.495: session admission and received-connection cleanup exceeded five seconds.
  • 00:12:08.865–.944: exec cleanup reported lost child identity and an unavailable spawn broker; this remains a separate investigation.
  • 00:12:09.37–.57: slow state commit, three terminal-session persistence failures, pending-input completion failures, and three attempts per worktree lease release, with STATE_DATABASE_READ_ADMISSION_INVALIDATED.
  • 00:12:13.096–00:13:29.846: 205 agent database clean-close receipts, roughly 350–400 ms apart. The exact reopening caller is not established by this PR.
  • 00:12:17.947–00:12:52.959: audit, usage-cache, dreaming-cron, and Discord work encountered shared-state retirement while still in use.
  • 00:13:27.915: shutdown deadline with no pending close steps; 00:13:29.914: watchdog SIGKILL. The next startup succeeded.

Follow-up source evidence: the concrete reopen-capable owner is optional transcript backfill: src/gateway/session-row-projection-backfill.ts:57–79 drains queued rows until disposal, without a Gateway-close fence. Each row captures writable execution at src/gateway/session-row-transcript-backfill.ts:69–76 with a no-op source guard and releases it at line 85; src/state/openclaw-agent-execution-owner.ts:579–620 closes 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–210 still retries deliberate admission invalidation. Plugin scheduling is already fenced at src/gateway/server-lifecycle.ts:529 and joined through src/plugins/service-scheduler.ts:33–51; the reported plugin work needs separate ownership tracing.

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime labels Oct 31, 2026
@steipete
steipete marked this pull request as ready for review October 31, 2026 01:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T01:22:36.078594Z 7ef7b81 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Keep accepted session finalizers joined before shutdown releases Gateway state ownership.

Example: An accepted agent finalizer takes six seconds to finish after SIGTERM.

  • Before: The five-second grace can return control to lock release while terminal-session and pending-input persistence remain active.
  • After: Shutdown warns after five seconds and continues joining accepted finalizers before releasing state ownership, subject to the existing process deadline.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused repair with no identified correctness defect; the reported regression evidence comes from controlled process fixtures rather than an independently inspected live-agent run.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied evidence exercises an isolated Gateway process with a synthetic provider and delayed plugin finalizer, reporting successful persistence, lease release, exit, and replay under Node and Bun.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A slow accepted finalizer can lose access to state while saving session completion and pending-input results during shutdown.
Reason: The maintainer-authored direction restores accepted-write settlement with less production code and explicitly leaves separate reopen and plugin investigations outside this repair.

Regression provenance

Possible 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
Reviewed head: 7ef7b81f7d8455a7af476b72bdece048c6a88106

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Required shutdown-step grace changes intended behavior with a stated reason (9344233: Bound process-owned cleanup and avoid waiting for full execution completion during graceful restart.)
  • Session-admission timeout changes intended behavior with a stated reason (a4062ee: Prevent pending session resource settlement from extending process shutdown beyond its deadline.)
  • Session persistence sibling settlement keeps the original intent (9344233: Join cancellation and terminal persistence after recording restart markers; allSettled preserves this ownership while avoiding fail-fast abandonment of siblings.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -18, Tests +115, Docs +1. Total +98 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 10 28 -18
Tests 3 132 17 +115
Docs 1 8 7 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 150 52 +98

Review metrics

Metric Value Why it matters
Production versus test growth Production −18 net LOC; tests +115 net LOC Production removes an early-return path; test growth extends existing fixtures to cover delayed finalization, persistence, lease release, and restart replay.

Labels

Label changes:

  • add P1: The reported shutdown failure invalidates accepted terminal-session and pending-input persistence during real deployment stops.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The reported shutdown failure invalidates accepted terminal-session and pending-input persistence during real deployment stops.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 9:43 PM ET / October 31, 2026, 01:43 UTC.

@steipete
steipete merged commit 4e55843 into main Oct 31, 2026
213 of 216 checks passed
@steipete
steipete deleted the codex/shutdown-reopen-loop branch October 31, 2026 01:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…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.
roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
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]>
roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
…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]>
roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
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]>
roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
…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]>
roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…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]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant