Skip to content

fix(gateway): subagent sessions stay running after restart - #126322

Merged
fuller-stack-dev merged 7 commits into
openclaw:mainfrom
vladimirkrdzic:fix/i011-interrupted-subagent-recovery
Sep 15, 2026
Merged

fuller-stack-dev merged 7 commits into
openclaw:mainfrom
vladimirkrdzic:fix/i011-interrupted-subagent-recovery

Conversation

@vladimirkrdzic

@vladimirkrdzic vladimirkrdzic commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes session-only subagent sessions that remain falsely running after a Gateway restart.

User Impact

Truly ownerless sessions from the prior process are marked interrupted instead of appearing active indefinitely. Active, queued and recoverable work is preserved. No configuration change or migration is required.

Why This Change Was Made

Recovery now uses the current per-database startup handoff and rechecks ownership at the SQLite commit boundary. Elapsed time alone does not authorize recovery. Public status remains failed, without invented end times, runtime, completion notifications or delivery.

Contributor vladimirkrdzic / VACInc is credited; original commit2141c251 remains an ancestor on this same branch through signed, non-force integration.

Published Updater and Rollback Qualification

The supported contract retains canonical interrupted. Rollback to the published binary restores a pre-update backup into fresh state; running that older binary directly against candidate-written state is not supported.

A fresh native, task-isolated cell used the integrity-pinned published [email protected] updater against the package built from 7c6aa315f12d0daae7363b33aedd0b95aff8545c:

  • Package build and tarball-integrity checks passed. Candidate SHA-256: 7b934effdbe2ee56046c5ed2bc1f9391a1006c83296805d045df60faba4680aa.
  • Published backup create --verify and backup verify passed before the update.
  • The installed published openclaw update --tag file:<candidate.tgz> --yes --no-restart --json exited 0 with status ok. All 7,945 checked installed runtime files matched the candidate archive.
  • Candidate Gateway startup changed the session-only orphan to canonical interrupted / public failed, without fabricated end time or runtime. Completed session identity, status and lifecycle timestamps were retained.
  • The existing Doctor migration added delivery: {kind: "none"} to both synthetic rows. This exact change is recorded by the updater and its source is unchanged from the integrated base. The initial whole-row equality failure is retained; the reconciled check requires the complete expected rows, including that migration.
  • Candidate backup restore --target <fresh-directory>, published-binary Doctor, and published Gateway reads passed. Restored canonical rows exactly match the pre-update backup; the separate candidate state stayed unchanged. All proof Gateways shut down cleanly.

The first harness attempts exposed a released-CLI URL-override rule and lazy agent-database creation. Both receipts are retained; the successful setup used the configured local target and metadata-only sessions.create with runStarted: false. No updater invocation was replayed, no inference ran, and no operator state was used.

The follow-up commit d5e3c19a510f3df782e9e296764958153a0f8d42 only makes the subprocess fixture reference statically discoverable. It changes no production source. All 3 default/shared/embedded process tests, lint, and production/full-tree Knip unused-file scans passed. The original 124-artifact restart proof was retained, not replayed.

Earlier CI failures are retained. The landed canonical UI and registry fixes are now integrated through #149023, #149016 and #149038; the remaining work in #148769 is not a prerequisite for those already-landed roots. Required exact-current-head CI and native landing remain pending.

Evidence

  • Real restart/SQLite/CLI proof: an exited predecessor leaves the orphan running on unmodified main; the qualified successor changes it to canonical interrupted/public failed while preserving queued and completed controls.
  • Readonly/startup validation: 34 readonly/startup tests passed, including distinct interrupted-only/failed-only probes and current-owner/lease races. Lint, formatting, unchanged ratchets and both production/test type lanes passed.
  • Retained qualification: 167 adjacent tests, 30 static gates and the full build/CLI proof; subsequent 42-test registry/startup and 78-test lease/lifecycle validations also passed. These overlapping counts are not summed or presented as fresh published-head runs.
  • Current-main integration: scoped registry/session-list changes from main were preserved verbatim. The PR patch ID is unchanged; affected registry/session-list/race tests and both type lanes passed again after integration.
  • Independent source/security review: the final PR patch was reviewed for P0–P2, with no actionable findings. Earlier findings were reproduced and corrected before that review; patch-identical current-main integration retains its result.
  • All 18 qualified source hashes matched the integrated candidate at 7c6aa315…; the later test-only reference fix leaves production bytes unchanged. Fresh exact-head hosted CI remains required before native landing. No operator Gateway or account state was used.
Behavioral proof and source provenance
Scenario Observed result
Unmodified-main restart Prior-process session-only orphan remained running (expected red)
Qualified successor startup Same orphan became canonical interrupted; abortedLastRun=true
Completed and queued controls SQLite row values remained identical
Public gateway call sessions.list Orphan projected to failed without endedAt/runtimeMs
Session identity or lifecycle generation changes during planning New/rebound row retained
New local or durable owner after planning Mutation refused; row retained
Durable owner hidden by inherited snapshot Expected red, then green with current-read helper
Lease released/replaced inside inherited snapshot Expected red, then green: commit refused
Suppressed lifecycle event Current status preserved; intentional field clearing still works
Interrupted-only/failed-only readonly probes Expected red, then green; shared derived index does not conflate canonical statuses; no database registration

The original proof used a real exited predecessor and built successor Gateway against isolated real SQLite on loopback, without model inference. Commands included:
node openclaw.mjs gateway run --bind loopback --port 39073 --auth none --allow-unconfigured
and
node openclaw.mjs gateway call sessions.list --json --params '{"limit":100}' --expect-url ws://127.0.0.1:39073.

The124 original artifacts and14 qualified afterimages remain retained. Current source additionally preserves newer main registry projections and corrects snapshot ownership, lease admission, suppressed public projections and readonly canonical status matching. Clean-review tree: 265a1f975a50e390f1756741bbcc89b27072c4a9 against base12d055d7cd16e5fbdae86231d83b4135a2b5d89d. Patch-identical integrated tree: 2414686b0ef0320a1c19e7642d5ab1feb8dd3c5a against base04400e289e101c439a76bbdce9425cf04c07b293; published head: 7c6aa31. The final validation checkout has independent physical Git objects and a separate dependency store; rejected nested-graph exploration is excluded from qualification.

Live, queued, yielded, recovering, retained-completion/task, malformed-owner, rebound, shared-store and Incognito controls remain protected. Only canonical status, abortedLastRun and lastRunError change. No registry completion/delivery is synthesized.

Release-note context: Gateway restart no longer leaves truly ownerless prior-process subagent sessions falsely running. Credit vladimirkrdzic / VACInc. CHANGELOG.md remains release-owned and unchanged.

Original contributor description (historical context)

What Problem This Solves

Subagent sessions can remain durably running after the gateway process disappears between a tool result and the terminal assistant/lifecycle event. The persisted row then has no terminal timestamp or reason, so session readers report a dead run as live indefinitely.

Why This Change Was Made

Startup is the first safe boundary where the new process can distinguish prior-process subagent rows from current work. The repair will reconcile only rows that are:

  • subagent-owned;
  • still running from before the current process boundary;
  • not owned by the current in-memory run registry; and
  • safe to mutate only after the live-owner check succeeds.

Recovered rows will become the distinct terminal state interrupted, carrying a persisted reason. They will not be reported as completed.

The lifecycle owner is the existing runStartupSessionMigration path. The missing edge was not a specific tool failure: the four affected transcripts ended after different tool results, but all four missed the terminal assistant/lifecycle event that normally persists a terminal status. The precise process termination trigger remains unknown.

Implementation

  • Run reconciliation after the canonical SQLite import and before transcript-index reconciliation.
  • Require the current process to own the verified gateway lock; any missing, stale, or unreadable lock skips all reconciliation.
  • Embedded or non-gateway-role lock identities also skip with a warning; this startup repair runs only where canonical gateway ownership can be proven.
  • Select only subagent rows with status=running, a finite startedAt older than the current process boundary, no restart-recovery claim, and no current run-registry owner.
  • Recheck current run ownership on the atomic commit edge.
  • Persist status=interrupted, abortedLastRun=true, and the interruption reason without fabricating endedAt, runtimeMs, or activity.
  • Keep interrupted distinct in canonical entry_json; project it through the existing failed SQLite and gateway-wire buckets so this repair does not expand the database or public protocol schema.

User Impact

Stale subagent rows stop appearing live after a gateway replacement. Healthy completed sessions remain unchanged, and current-process runs are never terminalized by startup reconciliation.

Evidence

  • Four affected rows were stamped within 17.855 seconds, ended after different tool results, and never emitted a terminal assistant event.
  • A same-fan-out control session reached stopReason=stop and persisted done, endedAt, and runtimeMs.
  • The four rows are the same rows previously classified as stale BUSY; the age-aware STRANDED probe fix is already on origin/main, so this PR will not modify the probe.
  • Exact termination trigger remains NOT_MEASURED; this patch does not assert that a restart killed the runs.

Boundaries

  • Startup-boundary reconciliation only; no restart-recovery claim.
  • Subagent rows only; prior-process only; fail closed on live-owner uncertainty.
  • No reachability-probe changes or adjacent cleanup.
  • Exactly two behavioral tests: orphaned prior-process interruption and healthy completed control.
  • At most two Athena review cycles.

Diff Estimate / Hard Ceiling

420 changed lines total (git diff --numstat: insertions plus deletions), across at most 12 files. If implementation exceeds either limit, work stops for renewed scope rather than expanding this PR.

Actual: 294 changed lines across 8 files (280 insertions, 14 deletions). Of those, 74 lines are tests and 220 are production changes. The positive production delta is the bounded durable-state edge plus its SQLite/gateway projections and two ownership checks; no schema migration, protocol expansion, probe change, restart-recovery refactor, or adjacent cleanup was added.

Validation Plan

  • Demonstrate the orphaned-row regression test fails before the production fix.
  • Demonstrate the orphaned row persists interrupted with its reason.
  • Demonstrate the healthy Mnemosyne-shaped done row remains unchanged.
  • Run focused lifecycle, protocol, and SQLite schema tests plus the repository type/lint gates selected by changed scope.

Validation Results

  • Red gate before production code: orphaned-row regression failed with the row still running and abortedLastRun=false.
  • Focused regression set: 225/225 tests passed across gateway, session accessor, and session row projection shards.
  • pnpm check:changed: passed, including production and core-test type checks, formatting, changed-file lint, import-cycle, database-first, schema-version, assertion-safety, dependency, boundary, and dead-export guards.
  • pnpm tsgo:core: passed again after rebasing onto current origin/main.
  • git diff --check: passed.

The age-aware reachability classification (STRANDED_AFTER_S) was already merged into origin/main before this branch. This PR intentionally contains no probe work.

Current-main CI fixture follow-up

Consumed Vincent Koc’s canonical auth-fixture correction in #149004 through the verified current-main test merge. The remaining thinking-route fixture omitted the runtime auth-store reader; commit e6fa9fa supplies the same existing fixture store without changing production behavior or assertions.

  • Existing fixture: all six selected-profile cases failed before the one-line fix and passed afterward; formatting and type-aware lint passed.
  • Current-main composition: 249 auth fixture tests and 74 startup tests passed. GitHub merge 529c969351c51a39a82fc325bc5af54e1b13e9b3 exactly matches that qualified source tree.
  • Required exact-head CI: https://github.com/openclaw/openclaw/actions/runs/34962252898 (completed with failures; retained, not waived). Subsequent canonical integration is described below.
  • The earlier package/published-updater/backup-restore proof remains retained at its recorded inputs; it was not rerun or relabeled as a new-head package proof.

Landed Canonical Fix Integration

Signed head 480610e3af00e3341e9fcb47308230412c46f0a0 merges main ed264cc3ca59b51648a366d7ed86df9e58c76390 while preserving contributor and canonical authorship/ancestry. Exact first-run UI and registry bytes match the separately qualified landed #149023/#149016/#149038 fixes; no duplicate repair was made. The thinking fixture is already on main.

All 18 startup files remain byte-identical to the reviewed candidate. The combined tree 6e92b5dd22ecc97a2fa1ec9610214af04e01ac27 passed the affected startup-race and readonly test shards, signature verification and diff checks. The packaged/updater/backup-rollback proof remains retained at its original inputs, with no replay. Required packed hosted CI for this head remains the next landing gate.

ClawSweeper revision6 explicitly found no correctness/security issues and accepted the recorded updater/restore evidence. Its remaining duplicated compatibility checklist is addressed by the proof and supported backup-based rollback contract above; no promise of direct old-reader compatibility is made.

@clawsweeper

clawsweeper Bot commented Aug 19, 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 gateway Gateway runtime agents Agent runtime and tooling size: M labels Aug 19, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 15, 2026, 8:55 AM ET / 12:55 UTC (Revision 7).

ClawSweeper review

What this changes

Marks ownerless subagent sessions from an earlier Gateway process as interrupted, preserves active or recoverable work, and reports interrupted sessions publicly as failed.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR remains necessary: current main lacks the session-only repair, and the merged task-registry fix addresses different ownership. No actionable patch defect remains. The recorded updater and backup-restore evidence resolves the previous compatibility follow-up.

Priority: P2
Reviewed head: 480610e3af00e3341e9fcb47308230412c46f0a0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, ownership-fenced repair with strong retained runtime and rollback evidence and no actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The complete captured body records real Gateway restart and sessions.list observations, SQLite owner/replacement/lease rejection, and successful published-updater plus restored-backup reads. The changed production files match the qualified candidate; later fixture-only changes do not invalidate that retained proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The complete captured body records real Gateway restart and sessions.list observations, SQLite owner/replacement/lease rejection, and successful published-updater plus restored-backup reads. The changed production files match the qualified candidate; later fixture-only changes do not invalidate that retained proof.
Evidence reviewed 10 items Current main still lacks this repair: The fetched main startup owner performs transcript reconciliation but has no session-only orphan settlement. Its startup module and session-types blobs also match the pinned PR base.
Latest release does not contain startup settlement: The supplied latest release, v2026.9.4, contains the same startup handoff without orphan settlement; this PR is not already shipped.
Settlement retains current authority and session identity: Startup requires the process-held Gateway coordinator and current matching live lease, excludes recovery and delivery obligations, and supplies an ownerless assertion to the canonical synchronous commit guard. The accessor independently rejects changed session snapshots before writing.
Findings None None.
Security None None.

How this fits together

Gateway startup maintains persisted session databases before serving session history. This repair checks execution ownership before changing stranded session metadata consumed by session listings.

flowchart TD
  A[Gateway startup] --> B[Existing session databases]
  B --> C[Prior-process running subagents]
  C --> D{Current Gateway authority and no run or task owner?}
  D -->|No| E[Preserve session]
  D -->|Yes| F[Revalidate and persist interruption]
  F --> G[Session listing reports failed]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +292, Tests +490. Total +782 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 13 373 81 +292
Tests 5 490 0 +490
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 863 81 +782

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +292 lines; tests and test support +490 lines Production growth implements ownership-fenced recovery and status projection; coverage exercises process replacement, protected controls, and commit races.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/gateway/server-startup-session-migration.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing startup and session-write owners for truthful orphan settlement, retaining the documented backup-based rollback contract.

Do we have a high-confidence way to reproduce the issue?

Yes: a prior-process running subagent row without any run/task owner reaches current main's startup handoff without settlement. Retained real restart evidence demonstrates that case; this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes: the patch repairs the canonical startup/write boundary, preserves legitimate owners, and avoids fabricated completion or runtime. Supplied upgrade and restored-backup proof covers the stated compatibility contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e00500a65429.

Labels

Label justifications:

  • P2: Repairs persistently misleading subagent activity after restart without changing execution or delivery policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The complete captured body records real Gateway restart and sessions.list observations, SQLite owner/replacement/lease rejection, and successful published-updater plus restored-backup reads. The changed production files match the qualified candidate; later fixture-only changes do not invalidate that retained proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The complete captured body records real Gateway restart and sessions.list observations, SQLite owner/replacement/lease rejection, and successful published-updater plus restored-backup reads. The changed production files match the qualified candidate; later fixture-only changes do not invalidate that retained proof.

Evidence

What I checked:

  • Current main still lacks this repair: The fetched main startup owner performs transcript reconciliation but has no session-only orphan settlement. Its startup module and session-types blobs also match the pinned PR base. (src/gateway/server-startup-session-migration.ts:20, e00500a65429)
  • Latest release does not contain startup settlement: The supplied latest release, v2026.9.4, contains the same startup handoff without orphan settlement; this PR is not already shipped. (src/gateway/server-startup-session-migration.ts:20, 3a9d69db306c)
  • Settlement retains current authority and session identity: Startup requires the process-held Gateway coordinator and current matching live lease, excludes recovery and delivery obligations, and supplies an ownerless assertion to the canonical synchronous commit guard. The accessor independently rejects changed session snapshots before writing. (src/gateway/server-startup-session-migration.ts:64, 480610e3af00)
  • Retained owners and status boundaries: Run/task ownership queries retain malformed durable claims instead of relying on decoded presentation records. Interrupted status remains canonical, maps to the existing failed index/public bucket, and cannot synthesize registry completion. (src/agents/subagents/registry/subagent-session-reconciliation.ts:258, 480610e3af00)
  • Complete captured proof inspected: Read the complete PR body and verified SHA-256 28e350928707b82bbb1d803859433a0aed0d04d399269c1627ed0d76e7ed0520 and 14,962 UTF-16 units against the supplied snapshot. It records a real exited predecessor, built successor Gateway, SQLite interruption, public sessions.list failed status without invented timestamps, protected controls, and owner/lease race rejection. The published 2026.9.4 updater succeeded against the recorded candidate; restored pre-update rows reopened under the published binary. These are retained observations at their stated revisions, not executions performed by this review. (7c6aa315f12d)
  • Re-review continuity verified: Compared Git tree blob identities for all 18 introduced files: none changed since reviewed head e6fa9fa. Against packaged-proof head 7c6aa31, only the subprocess test fixture reference differs. Raw current-head parents match the supplied introduction evidence. Earlier broad historical diff/blame attempts encountered unavailable blobs; tree comparisons and current source inspection succeeded. (480610e3af00)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • VACInc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-02T04:25:56.735Z sha 2141c25 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-03T15:37:47.302Z sha 2141c25 :: needs real behavior proof before merge. :: [P1] Rebuild the startup reconciliation on current main
  • reviewed 2026-09-03T16:31:25.246Z sha 2141c25 :: needs real behavior proof before merge. :: [P1] Rebuild startup reconciliation against the current owner
  • reviewed 2026-09-15T08:36:35.327Z sha 7c6aa31 :: blocked before merge. :: none
  • reviewed 2026-09-15T11:02:59.431Z sha d5e3c19 :: blocked before merge. :: none
  • reviewed 2026-09-15T11:23:47.499Z sha e6fa9fa :: blocked before merge. :: none

@vladimirkrdzic
vladimirkrdzic force-pushed the fix/i011-interrupted-subagent-recovery branch from b8a03f5 to 2141c25 Compare August 19, 2026 13:56
@vladimirkrdzic
vladimirkrdzic marked this pull request as ready for review August 19, 2026 14:04
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper-recovery-stuck and removed P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 2, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 15, 2026
fuller-stack-dev and others added 3 commits September 15, 2026 02:27
Retain vladimirkrdzic / VACInc contributor ancestry while retiring the obsolete startup implementation before supported main integration. The independently reviewed current-flow candidate follows on this same branch.
Integrate startup recovery at the admitted per-database handoff and canonical SQLite commit boundary. Preserve live, durable, malformed, queued and retained-completion owners. Read current durable ownership and the authorizing Gateway lease outside inherited snapshots. Preserve suppressed public lifecycle projections as no-ops. Keep canonical interrupted distinct in canonical list and readonly existence queries; project public failed without invented runtime.

Retained isolated restart/SQLite/CLI and 167 adjacent tests plus 30 static gates; current independent physical validation passed 34 readonly/startup tests, lint, ratchets and both type lanes; the preceding 78-test lease/lifecycle and 42-test registry/startup validations remain retained. Independent P0-P2 security/source review is scoped-clean; current-main integration preserves the exact PR patch ID and passed affected registry/session-list tests plus both type lanes.

Contributor: vladimirkrdzic / VACInc.

Co-authored-by: Vladimir Krdzic <[email protected]>
@fuller-stack-dev fuller-stack-dev changed the title fix(sessions): interrupt orphaned subagent runs on startup fix(gateway): subagent sessions stay running after restart Sep 15, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper review

Review-only for exact head 7c6aa31. Inspect the current per-database startup/SQLite ownership boundary and retained real restart/CLI proof in the updated PR body, including the red-to-green inherited-snapshot owner/lease races, suppressed lifecycle projections and readonly canonical-status probes. No repair, autofix or automerge is requested.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 15, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

Review-only for exact head d5e3c19. The PR body now records the supported backup-based rollback contract and completed published 2026.9.4 updater × exact candidate proof, including pre-update backup verification, installed artifact equality, interrupted/public-failed behavior, and published-binary reopening of the restored pre-update state. The existing Doctor delivery normalization is explicitly accounted for; no updater invocation was replayed.

The only source change since your reviewed head is a module-relative subprocess fixture reference. All three affected process cases, lint and both unused-file scans passed. Production source is unchanged. Duplicate secrets-shard ownership remains an inherited CI issue with canonical repair #148769; no duplicate repair is requested.

No autofix, repair or automerge is requested.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 15, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 1f8e152 into openclaw:main Sep 15, 2026
224 of 225 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…126322)

* fix(sessions): interrupt orphaned subagent runs on startup

* chore: prepare startup recovery for current-main integration

Retain vladimirkrdzic / VACInc contributor ancestry while retiring the obsolete startup implementation before supported main integration. The independently reviewed current-flow candidate follows on this same branch.

* fix(gateway): recover prior-process session-only subagents

Integrate startup recovery at the admitted per-database handoff and canonical SQLite commit boundary. Preserve live, durable, malformed, queued and retained-completion owners. Read current durable ownership and the authorizing Gateway lease outside inherited snapshots. Preserve suppressed public lifecycle projections as no-ops. Keep canonical interrupted distinct in canonical list and readonly existence queries; project public failed without invented runtime.

Retained isolated restart/SQLite/CLI and 167 adjacent tests plus 30 static gates; current independent physical validation passed 34 readonly/startup tests, lint, ratchets and both type lanes; the preceding 78-test lease/lifecycle and 42-test registry/startup validations remain retained. Independent P0-P2 security/source review is scoped-clean; current-main integration preserves the exact PR patch ID and passed affected registry/session-list tests plus both type lanes.

Contributor: vladimirkrdzic / VACInc.

Co-authored-by: Vladimir Krdzic <[email protected]>

* test(gateway): resolve startup orphan fixture by module URL

* test(agents): supply runtime auth store in thinking fixture

---------

Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: Vladimir Krdzic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

3 participants