Skip to content

fix: unblock Gateway after a killed Doctor launcher - #174268

Merged
steipete merged 2 commits into
mainfrom
upd/upd-l1644
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-l1644

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Gateway startup remaining blocked by offline maintenance after the launcher of doctor --fix is killed, while preserving update drivers that intentionally outlive their launchers.

Fixes #174219

User Impact

Launcher-bound Doctor work cancels and releases maintenance ownership when its launcher dies. Detached update, managed-handoff, and finalization drivers retain independent lifetimes. No new configuration, CLI/environment options, dependencies, or SQLite schema changes are required.

Why This Change Was Made

The launcher forwards ordinary signals but cannot forward SIGKILL, leaving its respawned CLI alive and renewing ownership indefinitely. Detached update drivers intentionally outlive their launchers, so parent-loss cancellation must be an explicit producer contract rather than a default for maintenance ownership.

Only CLI respawn producers install a private preload that records the launcher PID. The preload removes itself from process.execArgv, so later detached workers cannot inherit the contract. Independent owners record no launcher dependency. The existing maintenance heartbeat worker detects loss only for a recorded launcher.

Parent loss now requests the main thread's normal SIGTERM cancellation path. Ownership continues renewing while rollback, lease release, and service restoration settle. A ten-second backstop terminates a process that remains stuck. Merely losing a launcher does not let another process reclaim a still-live writer: that would permit overlapping native work. Peers recover the claim after the owner exits.

Evidence

  • Real process/SQLite regressions: a detached driver inherits launch arguments from a parent-bound launcher, survives launcher exit, renews custody, and commits; a bound child rolls back its transaction, releases its lease, and permits successor ownership.
  • Existing Doctor interruption tests pass for SIGTERM during progress, approval, and restoration, including restarting the stopped service. Heartbeat tests verify continued renewal during cancellation and force termination only after the grace period.
  • Live macOS package proof, after Doctor retained its pre-repair backup: SIGKILL launcher → owner exited in 0.22 seconds, zero surviving descendants, maintenance lock released, next Gateway HTTP 200 on the same state. Native SQLite quick_check returned ok. No lock or database deletion was needed. An earlier admission-phase kill also released its lock and started the next Gateway.
  • Doctor still reports its existing cancellation diagnostics when interrupted; the live run's database remained intact and startup succeeded.
  • Completed the 130-file sibling selection. Fixed the trusted-wrapper dependency inventory (35-test rerun passed) and updated shutdown-budget argv expectations (11-test rerun passed); no timeouts, retries, or assertions were weakened. The separate Node and pinned Bun bootstrap checks passed.
  • Final review: no actionable P0/P1 findings.
  • Overall PR size against its merge base: production and packaging +111/−7 (net +104), tests +240/−17 (net +223), documentation +1/−0.
  • Pre-existing slow coverage was retained: the Doctor schema-guard file used 120.74 seconds of test time, and the cold authentication integration case used 59.36 seconds; the campaign permits recording these without stopping.
  • Runtime package build, core TypeScript check, touched-file lint/format, and import-cycle check passed. The full check:changed SQLite inventory remains omitted under the campaign's local time budget; PR CI supplies broad proof.
  • The separate zero-output Doctor hang was not reproduced. Commit 910b54b1ffa9 (fix(update): return partial status when inspections stall #174060) already bounds stalled SQLite admission waits. The original pristine-main orphan reproduction and failing parent-loss regressions remain applicable to the initial defect.
Live commands and isolation

Each process received a separate HOME, OPENCLAW_HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, and profile in a task-local artifact directory. The proof waited for Doctor's pre-repair backup, killed only its task-owned launcher, inspected descendants and lock release, and started the Gateway on an available loopback port.

pnpm exec node openclaw.mjs --profile l1644-graceful-settled doctor --fix --non-interactive --no-workspace-suggestions
kill -KILL "$doctor_launcher_pid"
pnpm exec node openclaw.mjs --profile l1644-graceful-settled gateway run --bind loopback --port "$free_port" --allow-unconfigured

The task-owned Gateway was stopped after proof.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@steipete
steipete marked this pull request as ready for review October 16, 2026 13:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T15:25:07.723649Z 74576be New commits
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7528c0cd84

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/infra/gateway-state-owner-record.ts Outdated
Comment on lines +138 to +139
parentPid: process.ppid,
...(parentStartTime === null ? {} : { parentStartTime }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Record parent custody only for actual respawns

When maintenance runs without a CLI respawn—for example, OPENCLAW_NO_RESPAWN=1 openclaw doctor --fix or an invocation that already has the required Node flags—process.ppid is the shell or embedding process, not an OpenClaw launcher. Recording it unconditionally causes the heartbeat to send SIGKILL to the maintenance process if that caller exits, so a deliberately backgrounded/no-respawn Doctor or update can be terminated mid-repair. Populate these fields only when the process was launched through the new owned IPC respawn path, or pass the launcher identity explicitly.

AGENTS.md reference: AGENTS.md:L81-L82

Useful? React with 👍 / 👎.

@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. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Bind CLI respawns and maintenance heartbeats to their parent process so killing a Doctor launcher does not leave maintenance ownership alive indefinitely.

Example: Kill the launcher running openclaw doctor --fix --non-interactive on macOS.

  • Before: The orphaned Doctor continues renewing maintenance ownership and blocks Gateway startup.
  • After: The reported patched run ends the orphan and its descendants, then starts a Gateway whose health endpoint returns HTTP 200.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Concrete maintainer-reported production verification supports the repair, but parent-custody scope and a diff-caused CI failure prevent a clean verdict.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports the packaged macOS Doctor launcher-kill flow ending all descendants and allowing the same state's Gateway to return HTTP 200.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: After a Doctor launcher is killed, surviving maintenance processes can indefinitely prevent Gateway startup.
Reason: The maintainer-authored direction addresses a concrete availability defect through existing lifecycle owners, while the linked report's initial Doctor hang remains unconfirmed.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: this maintainer-authored PR addresses a concrete Gateway outage, but two focused corrections are needed before merge.

Priority: P1
Reviewed head: 7528c0cd84e9e5550e1902918faca1a89691b558

Before merge

  • Record launcher custody only for owned respawns (P2) - defaultPayload runs for maintenance even when OPENCLAW_NO_RESPAWN=1 or the required startup flags already avoid respawning. In those cases process.ppid identifies the shell or embedding caller. A backgrounded Doctor that should continue after that caller exits now receives SIGKILL from the heartbeat, interrupting repair and bypassing normal settlement. Populate these fields only when the process belongs to the owned launcher-respawn path.
  • Preserve real exports in the new census mock (P2) - This new first-party closed mock has neither importOriginal pass-through nor an adjacent mock-isolation annotation. It is absent from the grandfathered baseline, so check:test-mock-exports rejects it; the exact-head baseline job reports that failure. Spread the real module before overriding readDarwinBunProcessCensus, or document a concrete isolation requirement using the supported annotation.

Findings

  • [P2] Record launcher custody only for owned respawns — src/infra/gateway-state-owner-record.ts:138-139
  • [P2] Preserve real exports in the new census mock — src/flows/doctor-plugin-source-captures.test.ts:32-34

Tests

  • Missing end-to-end proof: The reported live scenario covers launcher SIGKILL recovery, but does not cover a backgrounded no-respawn maintenance command whose ordinary caller exits.
Agent review details

How this fits together

CLI launchers supervise respawned commands, while the state-owner heartbeat maintains exclusive database custody until its owning process exits.

flowchart TD
  A[CLI launcher] --> B[Respawned Doctor]
  B --> C[Maintenance state owner]
  C --> D[Heartbeat worker]
  D --> E[Ownership lock files]
  E --> F[Gateway admission]
Loading

Technical review

Best possible solution:

Attach parent-loss termination only to owned launcher respawns while preserving ordinary maintenance callers and live-owner exclusion.

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

Current-main source permits a respawned Doctor to outlive a killed launcher, and the PR reports a matching isolated macOS reproduction; this read-only review ran no target code.

Is this the best way to solve the issue?

Using existing respawn and heartbeat owners addresses the orphan's cause, but parent-loss termination must distinguish an owned launcher from an ordinary caller.

Full review comments:

  • [P2] Record launcher custody only for owned respawns — src/infra/gateway-state-owner-record.ts:138-139
    defaultPayload runs for maintenance even when OPENCLAW_NO_RESPAWN=1 or the required startup flags already avoid respawning. In those cases process.ppid identifies the shell or embedding caller. A backgrounded Doctor that should continue after that caller exits now receives SIGKILL from the heartbeat, interrupting repair and bypassing normal settlement. Populate these fields only when the process belongs to the owned launcher-respawn path.
    Confidence: 0.98
  • [P2] Preserve real exports in the new census mock — src/flows/doctor-plugin-source-captures.test.ts:32-34
    This new first-party closed mock has neither importOriginal pass-through nor an adjacent mock-isolation annotation. It is absent from the grandfathered baseline, so check:test-mock-exports rejects it; the exact-head baseline job reports that failure. Spread the real module before overriding readDarwinBunProcessCensus, or document a concrete isolation requirement using the supported annotation.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Process-owned maintenance custody keeps the original intent (8b16e53: Replace separate SQLite coordination machinery with one process owner retained through maintenance, rollback, and resource drainage.)
  • Namespace-qualified live-owner protection keeps the original intent (99fccf4: Prevent separate Docker PID namespaces from reclaiming a serving Gateway's live ownership.)
  • Launcher child supervision keeps the original intent (592998a: Forward launcher termination to respawned children instead of leaving orphaned work running.)
  • Heartbeat clock compatibility keeps the original intent (e98a15b: Preserve custody when an older updater starts a newer heartbeat worker using a different clock contract.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/process/respawn-child-runner.process.test.ts src/infra/gateway-state-owner.heartbeat.test.ts src/infra/gateway-state-owner.test.ts src/flows/doctor-plugin-source-captures.test.ts --maxWorkers=1
  • pnpm check:test-mock-exports --base 0c5039c
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8d66187 adds src/infra/gateway-state-owner-record.ts:103 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8d66187f090f; files: src/infra/gateway-state-owner-record.ts)
  • Vincent Koc: Raw commit e98a15b adds src/infra/gateway-state-owner-heartbeat.runtime.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: e98a15b7d695; files: src/infra/gateway-state-owner-heartbeat.runtime.ts)

PR surface

Source +39, Tests +113, Docs +1, Other +19. Total +172 across 20 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 42 3 +39
Tests 10 130 17 +113
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 3 20 1 +19
Total 20 193 21 +172

Review metrics

Metric Value Why it matters
Production versus test LOC Production +62/−4; tests +130/−17; documentation +1/−0 Growth adds lifecycle wiring to existing owners and regression coverage; the parent-custody scope needs correction.

Labels

Label changes:

  • add P1: The reported official-release failure leaves Gateway startup unavailable after an interrupted Doctor command.
  • add merge-risk: 🚨 availability: Unconditional parent custody can terminate legitimate no-respawn maintenance when its shell or embedding caller exits.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P1: The reported official-release failure leaves Gateway startup unavailable after an interrupted Doctor command.
  • merge-risk: 🚨 availability: Unconditional parent custody can terminate legitimate no-respawn maintenance when its shell or embedding caller exits.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 16, 2026, 10:07 AM ET / 14:07 UTC.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 16, 2026
Bind CLI respawns to launcher IPC and let the existing maintenance heartbeat
worker terminate its owner after parent loss, even when its main thread is
blocked. Preserve foreign live custody until process exit before recovery.

Cover parent loss and natural respawn completion, and keep platform-simulated
fixtures consistent with their real host workers.

Fixes #174219
Bind CLI respawns to their launcher explicitly and consume that private
preload before it can reach detached update and finalization workers.

Request normal cancellation before force termination, and keep renewing
custody while rollback, service restoration, and lease release settle.
Preserve live-writer exclusion until the owner actually exits.

Ship the lifetime helper in package and trusted wrapper inventories, and
cover detached commits, graceful rollback, and subsequent ownership.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74576be415

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

params.detachForProcessTree === true && process.platform !== "win32" && !stdioIsTerminal;
const child = runtime.spawn(command, args, {
stdio: "inherit",
const child = runtime.spawn(command, ["--import", CLI_PARENT_BOUND_PRELOAD, ...args], {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid passing preload flags to standalone executables

When a compiled standalone Bun executable needs the normal startup respawn for warning suppression or CA setup, this unconditional prefix becomes application argv rather than a runtime preload, so OpenClaw receives --import <data URL> as a root CLI option and rejects or misroutes the command. buildCliRespawnPlan explicitly supports this standalone path, and Bun's executable documentation confirms that compiled executables do not interpret their command line as Bun flags. Use a standalone-compatible preload mechanism or add these arguments only when spawning Node.

AGENTS.md reference: AGENTS.md:L64-L64

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 75d827b into main Oct 16, 2026
235 of 240 checks passed
@steipete
steipete deleted the upd/upd-l1644 branch October 16, 2026 15:39
steipete added a commit that referenced this pull request Oct 16, 2026
#174268 added the root cli-parent-lifetime.mjs launcher helper without
listing it in the duplicate-scan targets, so the target-coverage guard in
dup:check fails on every PR and on the next main run. List it beside the
other root launcher modules.

Proof: pnpm dup:check on current main a0ac309 fails only on the
coverage guard; with the target added it passes (target coverage ok,
existing clone findings unchanged).
steipete added a commit that referenced this pull request Oct 16, 2026
…74480)

node-runtime-recovery.mjs imports cli-parent-lifetime.mjs after #174268.
Ship that dependency in both Docker launcher stages, cleanup smoke, and
the remote-node bootstrap artifact, and keep copied runtime fixtures in
sync. Require the module in the bootstrap archive regression.

Preserve existing launcher and detached update lifetimes. No new closure
framework, dependency, configuration, or timeout changes.
steipete added a commit that referenced this pull request Oct 16, 2026
Keep Discord processing at its live owner while replacing namespace
spies with the named module spy and deleting the preflight re-export
used only by tests. Preserve every assertion and exercise all importers
of the changed helper.

Expose existing memory CLI registration through the public runtime
barrel for the PostgreSQL core test, retaining the plugin boundary.
Add shipped cli-parent-lifetime.mjs to both focused guard commands.

Causes: d49ea0f (#174322), 8955750 (#174374), and
75d827b (#174268). No runtime policy or timeout changes.

Proof: 165 focused tests passed with --maxWorkers=1 (444.35s), 12 plugin
boundary tests passed (19.14s) after the old-import negative control,
core/extension/test types, source contracts, focused guard, and P2 review.
Remaining independent audit finding: ORIGINAL_REVISION in an unchanged
Gateway fixture. Standalone package types report unchanged memory-core
connection/tableHasColumn errors; canonical source/type lanes pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…eir launcher dies (openclaw#174268)

Killing a hung openclaw doctor --fix left its respawned child alive (reparented to PID 1) and renewing sqlite-maintenance ownership, so every later Gateway start failed with 'undergoing offline maintenance' and stale-owner recovery never fired because the recorded owner was still alive. CLI respawns now carry an explicit launcher-bound lifetime marker; when the launcher disappears the owner is asked to cancel, rolls back and releases its lease while keeping custody during cleanup, and is escalated only after ten seconds. Detached update and handoff drivers stay independent by default and are never terminated because their launcher exited. Live on macOS: launcher killed → owner exits in 0.22 s, lock released, zero orphans, next Gateway HTTP 200, SQLite integrity ok. The separate zero-output Doctor hang is addressed by the bounded SQLite admission wait (openclaw#174060).

Fixes openclaw#174219
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
openclaw#174268 added the root cli-parent-lifetime.mjs launcher helper without
listing it in the duplicate-scan targets, so the target-coverage guard in
dup:check fails on every PR and on the next main run. List it beside the
other root launcher modules.

Proof: pnpm dup:check on current main 8be8fd6 fails only on the
coverage guard; with the target added it passes (target coverage ok,
existing clone findings unchanged).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…enclaw#174480)

node-runtime-recovery.mjs imports cli-parent-lifetime.mjs after openclaw#174268.
Ship that dependency in both Docker launcher stages, cleanup smoke, and
the remote-node bootstrap artifact, and keep copied runtime fixtures in
sync. Require the module in the bootstrap archive regression.

Preserve existing launcher and detached update lifetimes. No new closure
framework, dependency, configuration, or timeout changes.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…74482)

Keep Discord processing at its live owner while replacing namespace
spies with the named module spy and deleting the preflight re-export
used only by tests. Preserve every assertion and exercise all importers
of the changed helper.

Expose existing memory CLI registration through the public runtime
barrel for the PostgreSQL core test, retaining the plugin boundary.
Add shipped cli-parent-lifetime.mjs to both focused guard commands.

Causes: b5c5a99 (openclaw#174322), 9409878 (openclaw#174374), and
963fbbd (openclaw#174268). No runtime policy or timeout changes.

Proof: 165 focused tests passed with --maxWorkers=1 (444.35s), 12 plugin
boundary tests passed (19.14s) after the old-import negative control,
core/extension/test types, source contracts, focused guard, and P2 review.
Remaining independent audit finding: ORIGINAL_REVISION in an unchanged
Gateway fixture. Standalone package types report unchanged memory-core
connection/tableHasColumn errors; canonical source/type lanes pass.
steipete added a commit that referenced this pull request Oct 19, 2026
The built-CLI runtime recovery suite only runs in CI when the shared test
instance helper changes, so two of its cases kept asserting behavior that
main retired:

- Runtime-recovery respawns now carry the launcher-bound parent-lifetime
  preload and an IPC channel (#174268, #174545); the Doctor recovery case
  still expected bare argv and plain inherited stdio.
- Compiled entries keep the build-scoped compile cache and no longer take
  the compile-cache-disable respawn, which is source-entry only (#170514);
  the compile-cache case still expected that respawn's marker.

Assert the current respawn shape and that compiled entries keep caching
while still keeping workspace roots out of the startup respawn.
steipete added a commit that referenced this pull request Oct 19, 2026
…wns (#177503)

The built-CLI runtime recovery suite only runs in CI when the shared test
instance helper changes, so two of its cases kept asserting behavior that
main retired:

- Runtime-recovery respawns now carry the launcher-bound parent-lifetime
  preload and an IPC channel (#174268, #174545); the Doctor recovery case
  still expected bare argv and plain inherited stdio.
- Compiled entries keep the build-scoped compile cache and no longer take
  the compile-cache-disable respawn, which is source-entry only (#170514);
  the compile-cache case still expected that respawn's marker.

Assert the current respawn shape and that compiled entries keep caching
while still keeping workspace roots out of the startup respawn.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…wns (openclaw#177503)

The built-CLI runtime recovery suite only runs in CI when the shared test
instance helper changes, so two of its cases kept asserting behavior that
main retired:

- Runtime-recovery respawns now carry the launcher-bound parent-lifetime
  preload and an IPC channel (openclaw#174268, openclaw#174545); the Doctor recovery case
  still expected bare argv and plain inherited stdio.
- Compiled entries keep the build-scoped compile cache and no longer take
  the compile-cache-disable respawn, which is source-entry only (openclaw#170514);
  the compile-cache case still expected that respawn's marker.

Assert the current respawn shape and that compiled entries keep caching
while still keeping workspace roots out of the startup respawn.
RomneyDa pushed a commit that referenced this pull request Oct 26, 2026
…1695)

After publication-complete, a delegated maintenance worker could keep renewing the state database's offline-maintenance claim after its update executor died, so every CLI command and Gateway start was refused ('undergoing offline maintenance') until manual recovery; reported as a ~53-minute outage on a Raspberry Pi after a Control UI update from 2026.10.5 to 2026.10.6. The worker now watches its recorded parent process identities and exits through the existing bounded shutdown path when they are dead or replaced; normal startup then reclaims the dead claim through canonical recovery, and live-owner messages point to update progress. Fixes #181649, reported by @PonySlayer28.

Release adaptation: stable lacks requestCliParentTermination (cli-parent-lifetime.mjs, #174268), so the parent watch calls a local equivalent built on the stable gateway-shutdown-budget reserve: emit SIGTERM to the process's own signal owners (or self-signal when none listen) and escalate to SIGKILL after GATEWAY_SHUTDOWN_RESERVE_MS. Stable's delegated executor has no terminal-preparation wrapper or finally-time identity flush, so only the interval cleanup was added there. The refusal message now carries role/PID plus the update-status hint. The orphaned-worker integration test was ported onto stable's createInterruptedPackagePublication/preparePreview fixtures.

(cherry picked from commit 3a1d3dd)
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] doctor --fix hangs with Gateway stopped; SIGKILL leaves live-orphan sqlite-maintenance lock permanently blocking Gateway startup

1 participant