Skip to content

fix(update): Gateway stays stopped after the updater process dies mid-update - #188497

Merged
steipete merged 4 commits into
mainfrom
codex/issue-164800-dead-updater
Nov 2, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/issue-164800-dead-updater

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #164800. Supersedes #186328 and #186341 (two earlier drafts, consolidated and rebased onto current main).

What Problem This Solves

Fixes: if the openclaw update process dies during a managed update (SIGKILL, OOM, a killed process group), the managed Gateway stays stopped until the host reboots.

User Impact

User impact:

  • Killed before the package swap: the still-running handoff helper restores the original Gateway with no manual step.
  • Killed during or after the package swap: the helper finishes the swap, so the install and the openclaw launcher stay intact. It then records the failure and names openclaw update repair.
  • Repair works right away: openclaw update repair no longer waits out a 45-minute grace when both update processes are proven dead. It starts and verifies the Gateway that the update stopped. This also covers the case where the helper died too.

The Gateway still stays stopped, with the next step named, when:

  • the operator stopped it,
  • a named data risk was recorded,
  • update ownership was lost, or
  • the runtime cannot be verified.

Why This Change Was Made

On main today, four things go wrong:

  • When the updater exits on a signal, the helper treats it as "no verified recovery result" and leaves the Gateway stopped.
  • The helper's final bookkeeping loads the installed package, which is missing in the middle of the swap.
  • Repair waits out a 45-minute grace period even when both owners are proven dead.
  • Repair finalizes with restart: false, so it never starts the Gateway.

What changed:

  • Helper recovery. The helper now owns recovery after an updater signal or a missing result, and keeps its bookkeeping in its staged runtime. If publication had not started, it retires the untouched publication and restores the original Gateway. If publication was interrupted, it completes it forward through the sealed publication owner and finalizes the same run.
    • Post-core repair may migrate the state schema beyond what the staged reader understands. So after repair, every ledger read and write goes through a fresh process of the installed runtime, the same rule the terminal writer already follows.
  • Repair. Repair reclaims a handoff immediately when every recorded owner is proven dead; unknown custody still keeps the grace. It identifies an orphaned child lease by its owning run, because adoption drops a dead updater from the run's drivers. It restores a Gateway only when update history records an update-owned stop with no later start. Doctor keeps reporting other stopped services, as on main. An unmanaged service, such as one with a non-default state dir, gets a named next step instead of a failed repair.
  • Shared stop evidence. The helper and repair read the same stop evidence (update-run-gateway-stop.ts). There is no new stop protocol and no schema change.

Rejected:

  • Treating a signal as unrecoverable.
  • Inferring restart permission from an inactive unit.
  • Importing bookkeeping from the package that is being swapped.
  • A second stop policy for repair.

Rebased onto 632dced4aff. That base now keeps restoreGatewayService in update-managed-service-handoff-recovery-source.ts; the helper's updater-stopped branch was ported into it.

LOC against 632dced4aff: production +670/−44, tests +827/−75, docs +82/−14.

Evidence

Live Linux proof on an AWS Crabbox lease, now stopped. Setup:

  • Gateway as a systemd user service on an npm-global install.
  • Update started through the Gateway's update.run, with targets served by a loopback registry.
  • SIGKILL sent to the openclaw update tree at each kill point.
  • The "this PR" column runs a build of this head labelled 2026.10.111, updating to the same head labelled 2026.10.112.
Kill point Published 2026.10.9 helper This PR (b81f7e965a9)
Before package publication (not run) Gateway restored on the original version after 135 s, no manual step
Mid publication Gateway stopped; installed package and openclaw launcher missing; helper crashed with Cannot find module '@openclaw/fs-safe/secure-temp-root' Publication completed, launcher intact. Gateway stopped, with the run recorded as managed-service-handoff-interrupted and next step openclaw update repair. That repair then exited 0 and the Gateway was ready
During post-swap Doctor Gateway stopped Gateway stopped, openclaw update repair named
Helper and updater killed — Gateway stops (no live owner left). An immediate openclaw update repair --yes exited 0 with the Gateway ready

The table shows two different behaviors for kills during or after the swap:

  • On the pre-rebase head (1c4cb1cd151): the same mid-publication and Doctor kills recovered automatically in 175–185 s.
  • On current main: they stop at a named repair step. fix: restore npm plugins when core updates roll back #188978 now records a pending plugin-cohort recovery for the run, and its admission rule is that this recovery "requires a fresh update repair invocation". So the helper's same-run continuation is refused, and the explicit repair settles it instead.

Letting the helper's own continuation settle its run's cohort would need that rule relaxed. That is a follow-up for the #188978 owner, not part of this PR.

Tests:

  • 31 of 32 update test files pass locally on this head. This includes every file that failed in the first CI run.
  • The one failure is doctor-maintenance.settlement.test.ts > settles interrupted original-state capture (restart fails: false). It also fails on unmodified main.
  • New cases fail on main:
  • Core typecheck, oxlint (core shard), oxfmt and the line-cap ratchet pass.
  • $autoreview (Codex, P0–P1) came back scoped-clean on this head.

An independent Codex review on the pre-rebase head raised two P1s:

  1. Post-repair reads through the staged runtime fail after a schema migration. Fixed in this PR, as described above.
  2. Repair could restart a Gateway the operator manually started and stopped after a crashed update had already been reconciled. Accepted as an edge case. It needs an explicit openclaw update repair after that manual cycle, and the result is a running Gateway the operator can stop again. Avoiding it would need a new startup receipt on terminal runs.

Known gaps:

@clawsweeper

clawsweeper Bot commented Oct 30, 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 cli CLI command changes commands Command implementations size: XL labels Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR restores managed Gateways after updater death through the surviving helper or explicit update repair.

Example: SIGKILL interrupts an npm-global update during package publication on Linux/systemd.

  • Before: The installed package and launcher can be missing, and the Gateway remains stopped.
  • After: The helper completes publication, finalizes the update, and verifies the restarted Gateway.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction and owner reuse are sound, but a blocking upgrade-path defect remains.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A managed update can leave the Gateway unavailable after its updater dies, and successful repair can leave it stopped.
Reason: Automatic restoration has clear user value and explicit maintainer direction, but the linked issue also contains stalled-but-live updater behavior that this PR excludes.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this maintainer-authored PR addresses a verified Gateway outage, but recovery still fails when the interrupted candidate has already advanced the shared-state schema.

Priority: P0
Reviewed head: dc9ebf080c9163815ff73189f5fa778c4db4c2da

Before merge

  • Read migrated history through the verified candidate runtime (P1) - When candidate Doctor advances the shared-state schema and the updater is then killed, this reader still opens history through the staged helper's older database admission. That admission rejects newer schema versions before returning the run. The stop-history reader has the same problem, while createInstalledRuntimeLedger is initialized only after recovery finalization succeeds, which is never reached. The Gateway therefore remains parked on precisely this upgrade boundary. Select the verified installed candidate's ledger before these initial reads when state has advanced, retain the staged reader for the missing-installation case, and cover the differing-schema interruption.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Read migrated history through the verified candidate runtime — src/infra/update-managed-service-handoff-interrupted.ts:22-23

Tests

  • Missing end-to-end proof: Supply a latest-stable upgrade with settings and data intact, followed by patched-helper recovery against a schema-advancing candidate killed after Doctor migration.
Agent review details

How this fits together

Gateway update requests hand installation custody to a detached helper, which coordinates package publication, update history, Doctor finalization, and native service recovery.

flowchart TD
 A[Gateway update request] --> B[Detached handoff helper]
 B --> C[Updater process]
 C --> D[Package publication owner]
 C --> E[Doctor finalization]
 B --> F[Update history]
 F --> G[Explicit update repair]
 B --> H[Native Gateway service]
 G --> H
Loading

Technical review

Best possible solution:

Recover across schema upgrades through the existing helper and service owners, preserve operator stops, and provide a visible recovery action when automatic restoration is refused.

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

Source confirms current main's signal-exit recovery refusal, and the linked discussion records real Linux reproductions; no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Reusing publication, custody, and service owners is appropriate, but initial history reads must also survive a candidate-side schema migration.

Full review comments:

  • [P1] Read migrated history through the verified candidate runtime — src/infra/update-managed-service-handoff-interrupted.ts:22-23
    When candidate Doctor advances the shared-state schema and the updater is then killed, this reader still opens history through the staged helper's older database admission. That admission rejects newer schema versions before returning the run. The stop-history reader has the same problem, while createInstalledRuntimeLedger is initialized only after recovery finalization succeeds, which is never reached. The Gateway therefore remains parked on precisely this upgrade boundary. Select the verified installed candidate's ledger before these initial reads when state has advanced, retain the staged reader for the missing-installation case, and cover the differing-schema interruption.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Managed successor and publication ownership keeps the original intent (e1a7008: Keep the detached helper as the sole successor after exact native-service parking.)
  • Repair recovery grace changes intended behavior with a stated reason (9680e57: Reclaim abandoned custody only with original-run correlation, process evidence, census exclusion, and a recovery grace.)
  • Already-stopped Gateway handling changes intended behavior with a stated reason (ff2d589: Preserve earlier and operator stops while making the manual start command visible.)
  • Fresh installed-runtime bookkeeping keeps the original intent (61ef2a4: Preserve child refusal details and finalize through the installed runtime after candidate-side changes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/infra/update-managed-service-handoff-interrupted.test.ts --maxWorkers=1
  • pnpm test src/cli/update-cli/update-repair-service.test.ts --maxWorkers=1
  • pnpm test src/infra/update-managed-service-handoff-recovery.test.ts --maxWorkers=1
  • Show the differing-schema interruption regression failing before the repair and passing afterward.
  • Verify latest-stable upgrade preservation and patched-helper recovery after schema-advancing Doctor through the shipped managed-update entry point.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ff2d589 adds src/commands/doctor-maintenance-restoration.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff2d58950bf7; files: src/commands/doctor-maintenance-restoration.ts)
  • Jason (Json): Raw commit 73858ce adds src/infra/update-managed-service-handoff-cleanup.ts:101 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 73858ce2e11f; files: src/infra/update-managed-service-handoff-cleanup.ts)

PR surface

Source +603, Tests +732, Docs +68. Total +1403 across 46 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 25 854 251 +603
Tests 19 827 95 +732
Docs 2 82 14 +68
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 46 1763 360 +1403

Labels

Label changes:

  • add P0: The reported managed-update failure strands the Gateway and Control UI, leaving community users dependent on terminal recovery or reboot.
  • add merge-risk: 🚨 availability: A schema-changing interrupted update can still terminate recovery before service restoration, leaving the Gateway parked.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P0: The reported managed-update failure strands the Gateway and Control UI, leaving community users dependent on terminal recovery or reboot.
  • merge-risk: 🚨 availability: A schema-changing interrupted update can still terminate recovery before service restoration, leaving the Gateway parked.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • 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 30, 2026, 12:47 PM ET / 16:47 UTC.

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

chatgpt-codex-connector Bot commented Oct 30, 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-11-02T03:59:06.619742Z b81f7e9 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.

@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: dc9ebf080c

ℹ️ 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 on lines +84 to +86
const state = await readGatewayServiceStateForUpdate(service, env, params.timeoutMs);
assertDoctorServiceSelection(env, state.env);
const verdict = await inspectManagedGatewayServiceBeforeUpdate({ root: params.root, state });

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 Preserve service-management skips during ordinary repair

For openclaw update repair using a non-default state/config directory or OPENCLAW_SUPERVISOR_MODE=external, this inspection throws even when no update-owned Gateway stop exists. readGatewayServiceStateForUpdate installs assertGatewayServiceManagementAllowedForUpdate as its environment validator, which rejects these configurations before the !originalRunId return below. Previously, beginDoctorMaintenance explicitly skipped native service management for these cases, allowing offline finalization to succeed. Since gatewayRestoration now runs for every owned repair invocation, otherwise successful maintenance becomes a failed repair. Preserve the existing service-management eligibility checks before entering this inspection when there is no Gateway to restore.

AGENTS.md reference: AGENTS.md:L78-L78

Useful? React with 👍 / 👎.

A managed update whose updater process died (SIGKILL, OOM, a killed group)
left the Gateway stopped until reboot: the helper skipped recovery on a
signal exit, its final bookkeeping imported the installed package that was
missing mid-swap, and update repair waited 45 minutes even after both
processes were proven dead, then finished without starting the Gateway.

The handoff helper now owns recovery after an updater signal or missing
result: it keeps bookkeeping in its staged runtime, retires an untouched
publication and restores the original Gateway, or completes an interrupted
publication, finalizes the same run and restarts the managed Gateway. After
post-core repair, ledger access goes through a fresh installed-runtime
process because repair may have migrated the state schema.

update repair is the backstop when the helper is dead too: it reclaims a
handoff immediately when both owners are proven dead (unknown custody keeps
the grace), identifies an orphaned child lease by its owning run, and
restarts the Gateway only when update history shows the update itself
stopped it. Operator stops and named data risk still keep the Gateway
stopped; an unmanaged service yields a named next step.

Refs #164800.
@steipete
steipete force-pushed the codex/issue-164800-dead-updater branch from 3fdb26e to d26f046 Compare November 2, 2026 03:10

@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: d26f046397

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

appendLog("update triage could not complete: " + String(error) + "; " + params.triageHint);
}
}

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 Restore the handoff's failure-triage function

Every non-terminated managed update still calls collectUpdateFailureTriage() in the helper's finally block, but this change deletes its only definition; a repository-wide search finds only that remaining call. Because this code is embedded in a generated JavaScript string, TypeScript will not catch the missing function. Even a successful update therefore throws a ReferenceError, skips releaseManagedUpdateLease() and the remaining completion signaling, and reaches the outer catch that exits with code 1. This reports successful updates as failures and leaves recovery custody behind. Restore the function or remove its call while preserving lease release and completion behavior.

AGENTS.md reference: AGENTS.md:L78-L78

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 2, 2026
@steipete
steipete merged commit 29503e1 into main Nov 2, 2026
240 of 242 checks passed
@steipete
steipete deleted the codex/issue-164800-dead-updater branch November 2, 2026 06:28
@steipete

steipete commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…-update (openclaw#188497)

* fix(update): restore the managed Gateway when the updater dies

A managed update whose updater process died (SIGKILL, OOM, a killed group)
left the Gateway stopped until reboot: the helper skipped recovery on a
signal exit, its final bookkeeping imported the installed package that was
missing mid-swap, and update repair waited 45 minutes even after both
processes were proven dead, then finished without starting the Gateway.

The handoff helper now owns recovery after an updater signal or missing
result: it keeps bookkeeping in its staged runtime, retires an untouched
publication and restores the original Gateway, or completes an interrupted
publication, finalizes the same run and restarts the managed Gateway. After
post-core repair, ledger access goes through a fresh installed-runtime
process because repair may have migrated the state schema.

update repair is the backstop when the helper is dead too: it reclaims a
handoff immediately when both owners are proven dead (unknown custody keeps
the grace), identifies an orphaned child lease by its owning run, and
restarts the Gateway only when update history shows the update itself
stopped it. Operator stops and named data risk still keep the Gateway
stopped; an unmanaged service yields a named next step.

Refs openclaw#164800.

* fix(update): follow main's update-run read admission module after rebase

* fix(update): keep triage collection in the helper and align repair tests with main's failure recovery

* fix(ci): list the new update-run modules in the PR wrapper inventory
RomneyDa added a commit that referenced this pull request Nov 10, 2026
Adapt #172784, #175890, and #188497 to release/2026.11.2 while retaining the current-core recovery owner and release-line custody grace. Preserve operator stops, named data-risk refusals, and same-run interrupted helper bookkeeping.

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 10, 2026
* fix(update): backport managed recovery to 2026.11.2

Adapt #172784, #175890, and #188497 to release/2026.11.2 while retaining the current-core recovery owner and release-line custody grace. Preserve operator stops, named data-risk refusals, and same-run interrupted helper bookkeeping.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): retain manual guidance for nonowned services

Complete safe post-core repair with a warning when service inspection returns a nonowned verdict. Keep automatic startup disabled and retain live-authority and data-risk checks. Exercise unavailable and absent services through the repair command; align retained-handoff fixtures with the preserved release-line grace period.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): retain terminal outcomes after post-core failure

Select the verified installed ledger and terminal writer before post-core repair can migrate state. Retain staged fallback before candidate verification and cover finalizer failure and post-finalize data-risk refusal.

Co-authored-by: RomneyDa <[email protected]>

* test(update): keep the raw-recovery guidance fixture off the legacy migration reason

The release-line run reader maps a legacy "state-migration-started" reason to legacy-state-migration data risk, so the saved fixture correctly kept the Gateway stopped. Use a non-migration reason so the test still proves stale history does not leak into immediate guidance.

* fix(update): read interrupted-update history after a candidate schema advance

The staged managed-update helper is a copy of the old updater's build. When the
candidate's Doctor advances the shared state schema and the updater is then
killed, the helper's first history reads (the Gateway stop and this run) hit
the newer-schema refusal, so recovery never starts and the Gateway stays
stopped.

On a newer-schema refusal, read and record through the installed runtime,
which already owns post-core repair. Other read errors still fail recovery.
The boundary test advances the schema past the staged helper before SIGKILL
and fails without this change.

* test(update): port recovery expectations for the managed recovery backport

The backport took #172784's restart-after-failure behavior without its test
updates, and the release line still expected verified readiness where recovery
now only observes an untouched service. Apply #172784's already-current,
candidate-activation and node-runtime changes, port main's observation
expectations for the Windows triage and foreground-failure cases, and give the
package-swap risk fixture the dataAtRisk field release writers set.

* fix(update): report unrestored Gateways as repair warnings

Repair maintenance has already finished when the Gateway fails to start or
verify, so report that as a warning naming `openclaw gateway start` and
`openclaw gateway status --deep` instead of failing the repair. Named data
risk and process-cleanup failures still fail.

Inspect the service and check recovery admission once, right before the
start, instead of repeating the full inspection inside the start callback.

An unreadable update history no longer skips the helper's existing failure
handling when the updater exits without a result.

* fix(update): recheck stop authority before recovery startup

Require the current helper lease and unretired stop intent after native inspection and before recovery start, launchd bootstrap retries, and kickstart. Keep publication recovery on its existing lease-only authority check.

Exercise late stop retirement, replaced helper leases, and reassigned native service identity through the generated helper boundary.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): retain repair stop authority through native startup

Check the pending recovery stop at native dispatch without revoking post-start authority. Carry the existing effect-only callback through launchd activation retries and Windows task startup, preserving repair warning semantics.

Prove late stop retirement through the repair CLI and native preparation boundaries, including successful-start self-retirement.

Co-authored-by: RomneyDa <[email protected]>

* test(update): preserve native authority mock exports

Keep the real launchd-system and exec-file export surfaces while overriding only native ownership and command effects in the stop-authority regressions.

Co-authored-by: RomneyDa <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
)

* fix(plugins): portable plugin-state keys for PostgreSQL

Use an exclusive SQL lower bound for Doctor pagination instead of a NUL-suffixed cursor. Reject new NUL keys in test-only plugin-state fixtures while retaining legacy SQLite adoption reads.

Add real PostgreSQL Doctor regression coverage and register it in conformance and database-worker lanes. Refs openclaw#184862 openclaw#188642.

* test: account for rebased plugin-state coverage

* test(clickclack): import legacy revocations before adoption

(cherry picked from commit 395cac7)

Release adaptation: Only exclusive SQL lower bound in kernel and Doctor pagination; preserve legacy SQLite keys and public validation. Regression exercises real Doctor paging and inspected executed SQL bindings; no NUL-key fixture policy, schema or unrelated tests.

Follow-up dispositions: 8253356 fix: preserve child results after source lifecycle changes (openclaw#202708); f3f89c7 fix: show saved child results when completion delivery fails (openclaw#202664); c45faa8 fix: align CI tests with admitted tool calls (openclaw#202655); 5c9389a fix: make channels add report required plugin install failures (openclaw#202091); 52b9188 fix: show hosted model details in `models list` without a Gateway (openclaw#202490); d248a76 fix: show an outcome when kept child chats return no answer (openclaw#202423); 5148804 fix(discord): check a queued message's access again when its turn starts (openclaw#202330); 2470d62 fix: let setup use account models with a fresh catalog (openclaw#202019); 9fa0b92 fix: let PostgreSQL Gateways start with plugin-backed secrets (openclaw#201063); c180824 fix(plugins): Talk and plugin-loading requests fail on PostgreSQL Gateways (openclaw#201976); cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 17c5fb0 fix(state): PostgreSQL state created before Template bootstrap deferral is refused as schema drift (openclaw#197425); b5c1277 fix: let resumed parents collect children stopped by restart (openclaw#201460); f920a7e chore(postgres): qualify cron completion during graceful shutdown (openclaw#201246); 1680f54 fix(openai): new ChatGPT subscription models missing until an OpenClaw release (openclaw#201130); 0d8820a fix(media): image descriptions use the ChatGPT OAuth route when OpenAI has no API key (openclaw#199299); ee3e16e test(agents): trim and fold low-value regression suites (openclaw#198916); b8029b4 test(agents): qualify PostgreSQL simple-completion acquisition (openclaw#200956); 703c82d fix(sessions): record queued input end causes and recover them across crashes (openclaw#200533); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); d565e17 fix(ci): retire deleted session fork test from inventory (openclaw#200611); 4cf12c6 chore(postgres): qualify prompt refresh and rebalance CI (openclaw#200488); d460273 fix(templates): release earlier Template-managed agents (openclaw#200303); ff75829 fix(update): --no-restart update fails when the Gateway restarts itself during Doctor's stop (openclaw#200181); 0b2ad60 chore(postgres): cover compaction watched-session prompts (openclaw#200117); b90c573 test: consolidate redundant coverage (198795 recut) (openclaw#198943); a042363 test: consolidate redundant coverage (198793, part 2) (openclaw#198936); 9bfad2b test: consolidate suites while retaining recovery owners (openclaw#198933); 4e9812c test: consolidate redundant coverage (198789, part 2) (openclaw#198932); 90814f5 fix(subagents): stops a finished sub-agent's chat being deleted before its parent reads the result; 799bc0b fix(ci): stabilize hourly fixtures and retire unused exports (openclaw#199851); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); a4cc2ad fix: undo cold-session compaction CPU and latency regressions (openclaw#199561); 55fec79 fix(agents): stop divergent mid-turn overflow recovery (openclaw#199636); 2c4413a fix: reduce Gateway stalls under filesystem pressure (openclaw#197510); 37d977f fix: output reducers are skipped in headless and Code Mode runs (openclaw#199434); c9ee264 fix(compaction): concurrent sessions wait for each other's summaries during compaction (openclaw#196550); 2471ddc feat: let agents review generated images before delivery (openclaw#198227); 21f7dc6 fix(github): publication fails with PostgreSQL session or state stores (openclaw#193749); 63d9e57 fix(ci): new PostgreSQL suites are omitted from conformance (openclaw#198390); 466a4b6 fix(telegram): steered answers quote the wrong input (openclaw#178124); 87b6f52 fix(delivery): resend routed Telegram finals after an ambiguous network failure (openclaw#192779); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); cff99b2 fix(agents): keep provider history append-only across runs (openclaw#197874); 8a328bf feat: add an opt-in usage-ranked tool index (openclaw#197128); 097e648 fix(ci): plan only executable infra tests (openclaw#197911); 76385fd fix(models): discovered models become "Unknown model" after restart or an ended sign-in (openclaw#197784); 89d4177 fix(plugin-state): guarded calls fail until Gateway restart after an unknown write outcome (openclaw#197790); baca36e fix(sessions): commit selected invitations with original messages (openclaw#184512); 699e538 fix(sessions): drain passive notices on sessions_send resumes; d6ded18 chore(ci): drop retired test-lines allocation records (2/3) (openclaw#197656); e0dd020 fix(agents): collect process results at suspended-run capacity; 4897740 feat(auth): preserve delegated OCE user profiles and permissions (openclaw#196856); 7197ce1 feat(templates): install bundled plugins through native management (openclaw#196349); 9c6ee9b feat: let Template automations start paused for onboarding (openclaw#196323); 79a6214 fix(message): retain local final replies in conversation history (openclaw#187795); caa978c feat(templates): open durable chat before verified setup (openclaw#196392); 78e73aa fix(sessions): cold PostgreSQL conversations fail after idle readers close (openclaw#189991); b6ed907 perf(sessions): persist active transcript facts for hydration (openclaw#193682); 1595dd2 feat(plugins): reauthorize accepted session work (openclaw#176886); b43ad0a fix(models): avoid reloading plugins on catalog refresh (openclaw#193903); 0947d02 fix(ci): avoid unrelated PostgreSQL runs and admit owned tests (openclaw#193870); 428ca7d feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag (openclaw#192335); c718583 fix(update): repair refuses forever after a verified update fails a later step (openclaw#193132); 3f64174 fix: deliver background replies after a reload retires the turn registry (openclaw#193130); 982f3b1 fix(imessage): report Automation failures after Gateway updates (openclaw#186117); 31b28e9 fix(agents): wait for a peer OAuth refresh before failing request auth (openclaw#192906); cf50d4a feat(storage): support read-only PostgreSQL standby inspection (openclaw#192645); 82fd4e6 fix(agents): retain stale session target refusal reasons (openclaw#192681); 8ac4e19 fix(worktrees): reserve capacity on PostgreSQL (openclaw#192537); 718b349 fix: reduce session startup stalls under storage contention; 08f4a19 refactor(skills): move Skill Workshop into its bundled plugin (openclaw#192471); 837402a fix(clawrouter): keep upstream credit failures off the shared key (openclaw#192575); f38495f fix(plugins): reject late routing from canceled runs (openclaw#192492); dc5d61a improve(sessions): reduce unnecessary maintenance query rows (openclaw#192023); c4bf0dc fix(sessions): avoid extra maintenance scans for embedded archives (openclaw#184507); e44b3d6 fix(team-reports): recover after database connection loss (openclaw#192020); 991fb33 fix(logbook): recover after database connection loss (openclaw#192011); e6d0d2e fix(test): include omitted PostgreSQL conformance suites (openclaw#191962); da5ff0f fix(codex): reject native hooks from a previous run (openclaw#191788); 09f0b0b feat(plugins): add skill usage runtime for plugins (openclaw#191661); 00b2ff4 fix: parent sessions miss child approvals with a custom session store (openclaw#189827); be44b10 fix: stop completed session writes retaining request data (openclaw#191197); d40aa7c fix(sessions): replay creation requests across Gateway restarts (openclaw#190862); d894035 fix: await Doctor shared-state repair preparation (openclaw#190875); b515cc7 feat: fork threaded conversations with Telegram support (openclaw#190783); def6349 feat(plugins): plugins can run a hidden forked turn of a session with their own tools (openclaw#190950); d983e34 feat(plugins): plugin commands can continue the agent with a replacement prompt, on every channel (openclaw#190908); ea3f0b8 fix(ci): provision Node test prerequisites and retain Baseten routing (openclaw#191050); 29503e1 fix(update): Gateway stays stopped after the updater process dies mid-update (openclaw#188497); fc8c2d0 fix(update): preserve unfinished handoff artifacts (openclaw#190571); 7c26e8c fix(ci): cover PostgreSQL managed update handoffs (openclaw#190336); 4913d41 fix(ci): prevent truncated PostgreSQL target listings (openclaw#189509); 8925f62 fix(gateway): start restored PostgreSQL homes on the first attempt (openclaw#190291); 177fe32 feat(models): preserve inference capabilities in opt-in catalog v3 (openclaw#189678); 7faf32d feat: retain repository disk authority through recovery (openclaw#189106); a658df3 feat(database): capture externally quiesced SQLite migrations; 0f9e7f7 feat(database): capture exact SQLite migration capsules; 4fb684e feat(backup): add PostgreSQL local companion checkpoints; c89a101 fix(doctor): migrate auth profiles on PostgreSQL stores (openclaw#189639); 799de09 fix(ci): split oversized workspace and setup files (openclaw#189356); 21ee847 fix(acp): keep completed run conversations resumable (openclaw#189273); fce0e56 perf(sessions): open cold history without restoring archives (schema 39) (openclaw#188397)

Validation: Baseline1 NUL-binding assertion failure/21passing; candidate22/22passes (188693-green.log). Real SQLite Doctor path and generated SQL proved; no native PostgreSQL server execution claimed.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 0895146d8c1493146f5c6461eee0b10c329bdd1e)
(cherry picked from commit f8ccaa70bc9773d6bbb569bc0e275eee0c544ead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL 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.

1 participant