Skip to content

fix(update): bound finalization and diagnose stalled phases - #140648

Merged
steipete merged 13 commits into
mainfrom
fix/update-finalize-bounded
Sep 7, 2026
Merged

steipete merged 13 commits into
mainfrom
fix/update-finalize-bounded

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139485

What Problem This Solves

Fixes an issue where externally supervised upgrades could wait indefinitely for openclaw update finalize --json --yes --no-restart while the Gateway remained stopped. A pending phase produced neither a terminal result nor a phase-start receipt, and cleanup could continue waiting after a result had been printed. Reported by @hannesrudolph.

This repairs the bounded-outcome and diagnostic guarantees. The exact operation in the reported macOS configuration remains unconfirmed; #139485 stays open for a reporter rerun.

Why This Change Was Made

Executable finalization now owns deadlines for preflight and the six existing OCM phases, including their config reads and plugin-lease acquisition. Phase starts and finishes stream immediately to stderr. The existing update ledger records them after write admission, including the original preflight start timestamp once the ledger is attached. A deadline fences owned command trees, records failure, synchronously emits one JSON result with status: "failed", stuckPhase, elapsedMs, error, and compatible phaseTimings, then exits nonzero without yielding to abandoned mutations during supervisor rollback.

Unix command scopes stop retained process groups on normal return, rejection, and deadline. Windows executable finalizers retain a non-inheritable Job until OS process exit, which terminates descendants even after their launcher exits; borrowed calls and Gateway execution do not acquire that permanent process ownership. This replaces the weaker Windows taskkill path. A live native child retains PID ownership even if the optional start-time probe fails; after the root exits, the timestamp guard still protects against PID reuse. Phase exits and the post-output watchdog use the same executable ownership boundary. The exported CLI bridge continues awaiting phases and preserves its caller-owned process lifetime.

Shared CLI disposers have individual five-second deadlines and retain their unsettled names. Ten seconds after terminal JSON, a still-running finalizer records active resource types and unsettled disposers, then exits with the recorded outcome. The watchdog is unreferenced, so it does not delay healthy exit. Human-mode repair starts its exit grace only after interactive recovery finishes. The existing terminal ledger outcome remains immutable; exit diagnostics use a separate bounded step.

Phase Default budget Reason
Preflight, config validation, config snapshot, completion cache 30 seconds each Local metadata, backup, and completion work
Doctor 120 seconds Migration subprocess work
Plugins 600 seconds Registry access and package installation
Target config convergence 180 seconds Post-plugin Doctor, validation, and readiness

The existing --timeout overrides each phase budget. OCM v0.2.38's Command::output() and phase parser remain compatible: stdout stays one JSON document, the six phase names and timing fields remain unchanged, the additive preflight timing is ignored by older OCM parsers, and the nonzero exit releases its failure/rollback path.

The audit also found a concrete deadline defect in the managed Codex native --version probe: Node's default timeout sends SIGTERM and can keep waiting for a child that ignores it. That probe now uses SIGKILL at its existing five-second deadline and removes its callback wrapper. This default-disabled candidate check precedes finalization in OCM, so it is not presented as Hannes's identified trigger.

Completion refresh also used a synchronous child wait that could prevent any JavaScript phase timer from firing. It now uses the existing asynchronous command runner with process-tree cleanup and shutdown time reserved inside the unchanged overall phase budget. A child timeout that settles within that budget remains a nonfatal completion-cache failure; an actual phase overrun remains fatal. The manual-refresh hint is preserved.

User Impact

A stalled finalizer now produces a bounded failure naming its phase. A retained cleanup resource cannot turn a recorded result into an indefinite supervisor wait. Operators can preserve the stderr diagnostic and inspect the update ledger; unusually long legitimate phases can use the existing timeout override.

Production LOC: +600/-257 (net +343). Tests/support LOC: +580/-88 (net +492). Docs LOC: +22/-1 (net +21). Tooling/baseline LOC: +2/-2 (net 0). The positive production exception supplies missing deadline, subprocess-cancellation, and diagnostic recovery paths, including Windows kernel ownership that survives an exited launcher. The finalizer owner shrinks by 43 lines, the version probe by 9, and completion refresh by 9; the added ownership machinery is needed because exiting the parent alone does not stop detached package-manager descendants.

Evidence

Final head 72be047a9a57c074f75e9b85f6ab068509dc387c has green CI, a clean full branch review, passing selected checks, and an exact-commit build. Blacksmith Testbox lease tbx_01m1x6w973cm9dpszeh2x6j2m1, run 34088554369, verified all 38,907 tracked source files and the embedded build commit before/after live execution. The lease is stopped and cleanup verified.

The OCM stand-in clears its environment, uses null stdin and piped stdout/stderr, and waits synchronously. All state is synthetic. Official 2026.9.1 runs as an owned Gateway on a free loopback port, then stops before the built 2026.9.2 finalizer runs. Every --no-restart case leaves the Gateway stopped. This proves the command/stdio contract; it does not claim an affected-macOS reproduction or a complete OCM rollback test.

Compact live stand-in transcript (processElapsedMs includes CLI startup; the phase-failure JSON separately reports elapsedMs: 1233):

fresh state, default budgets: exitCode=0 status=ok singleJson=true processElapsedMs=6838
9.1 Gateway -> 9.2 candidate, default budgets: exitCode=0 status=ok processElapsedMs=6755
same upgrade without POST_CORE marker: exitCode=0 status=ok processElapsedMs=8323 completionCache=completed
injected configSnapshot await, --timeout 1: exitCode=1 status=failed stuckPhase=configSnapshot processElapsedMs=1757
SIGTERM-resistant completion child, default budgets: exitCode=0 status=ok processElapsedMs=36336 completionCache=failed childStopped=true
two stuck cleanup owners: exitCode=0 status=ok processElapsedMs=16898
[update finalize] Process still alive after terminal output: {"activeResources":["PipeWrap","Timeout"],"unsettledDisposers":["provider-local-services","mcp-loopback"]}

Before-fix proof used official npm 2026.9.2 and source regressions. On stopped Testbox tbx_01m1wqx05146v0en349a65tb6m, run 34073327915, an unresolved actual snapshot operation still produced no JSON after 15,015 ms. Both source phase/handle regressions reached their 100-second guards; the retained-handle case already had complete success JSON. Healthy official 9.1→9.2 took 4,269 ms. The final Testbox also confirmed that the official completion child ignored SIGTERM and left zero stdout after 45,054 ms before the harness stopped its owned process group.

The PID comparison failed on the previous code because its owned descendant survived, then passed all eight cases after repair. The two borrowed-caller regressions also failed on the old owners (phase exit 1 and missing caller-completion marker after output). After repair, all 14 output-process cases, eight PID cases, and 411 update CLI tests passed on f0d57bfee36511951c21fc6984add3ab9124477c in stopped Testbox tbx_01m1x64e60pbpfy4vyttd73s80, run 34087729930. The final run verified all 28 file hashes, permitting only the exact reviewed Promise-executor block-body correction in the fixture; production, delays, and assertions are unchanged. It reused those 433 passes and two intended failures, then ran the final selected checks, build, and live scenarios. CI caught that fixture lint error; the corrected head passes lint and CI.

An earlier wider run passed 609 tests, full changed-file checks, and a build, with unchanged evidence retained by hashes: run 34082821509, stopped lease tbx_01m1x1kw1jyrdbfvsgr5kecjga. Coverage includes named disposer deadlines, incremental ledger receipts, interactive recovery, completion siblings, and the managed Codex probe. That version probe stops at its five-second deadline (5,086 ms), versus 10,153 ms on the original code. The final selected checks passed core and core-test typechecks, changed-file lint, all three unused-export scans, and the unchanged schema-version guard.

All five native Windows cases passed on final head 72be047a in 2.55 seconds: CI job 101637179316. They cover exit 0/1, inherited Job membership, already-exited launchers, and borrowed/Gateway exclusions on Node 22.23.2 Windows x64. An exact-predecessor native Windows rerun was unavailable; all positive cases and negative ownership controls ran on the final head.

Rejected harness attempts are excluded from passing evidence. Live fault injection verifies the exact built module/function and an entry marker, so an unentered fault or a skipped regression cannot count as a pass.

Audit references:

  • src/cli/update-cli/update-command-finalize.ts:72,89,184,185,195,198,234: preflight, validation, backup, Doctor, plugin phase/lease, and convergence are inside phase ownership.
  • src/cli/update-cli/update-finalization-lifecycle.ts:110,180: terminal deadline and post-output diagnostics. src/process/exec-spawn.ts:22,54: owned Unix command groups and live-child PID authority. src/cli/runtime-cleanup-scope.ts:22,27 and src/process/supervisor/service-child-windows-job-native.ts:15: Windows executable ownership until OS exit.
  • src/cli/runtime-cleanup.ts:12: named disposer bounds. Audited waits include harness disposal (src/agents/harness/registry.ts:153), Codex startup-producer drain (extensions/codex/src/app-server/shared-client.ts:1466), MCP HTTP close (src/gateway/mcp-http.ts:518), and memory idle/watcher/provider drains (extensions/memory-core/src/memory/manager.ts:650,671,682). They are audit candidates, not established incident causes.
  • src/cli/update-cli/shared.ts:443: asynchronous completion refresh replaces the synchronous SIGTERM-only wait. extensions/codex/src/doctor.ts:69: repaired native-version timeout. Codex transport already ends/unreferences its pipes and has forced termination (extensions/codex/src/app-server/transport.ts:112).
  • Managed provider service cleanup already has two two-second TERM/KILL waits and unreferences pipes (src/agents/provider-local-service.ts:493,553); transport dispatchers destroy after a bounded close (src/infra/net/ssrf.ts:770). Proxy stop delegates synchronously, and CLI ownership bounds its lazy cleanup (src/cli/run-main.ts:1692).
  • Skills watchers are persistent (src/skills/runtime/refresh.ts:500); no evidence establishes finalizer activation of that path. Retained watcher types will appear in the exit diagnostic.

ClawSweeper follow-through: preserve interactive recovery and optional completion outcomes; repair initial-null PID custody; provide default-budget fresh/upgrade proof and native Windows controls. Both borrowed-call before/after regressions are proved in the linked functional run. The refusal helper now states its existing always-throwing contract with Promise<never>, removing an unreachable branch rather than adding a fallback. The remaining ClawSweeper budget tradeoff is accepted within the requested per-phase deadline scope: defaults have fresh/upgrade proof and the existing timeout override is documented. There is no new data model; the existing-store upgrade path and schema guard pass. The original macOS trigger remains unknown. That uncertainty is the reason to keep #139485 open for @hannesrudolph's rerun, consistent with the requested containment-and-diagnostics scope. There are no schema, configuration, dependency, or protocol changes.

NO-FOLLOW-UP: the useful owner refactors and dead-path removal are included here; no separate refactor is justified by the remaining evidence.

@clawsweeper

clawsweeper Bot commented Sep 7, 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 extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 02:26
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 7, 2026, 2:15 AM ET / 06:15 UTC.

ClawSweeper review

What this changes

Bounds update finalization and CLI cleanup, reports stalled phases, and terminates owned subprocesses so supervised upgrades receive a terminal result.

Merge readiness

⛔ Blocked before merge - 3 items remain

The containment fix remains useful: current main still lacks these finalization deadlines. The prior findings are addressed, and no additional blocking defect was identified. The related macOS incident remains unresolved independently.

Priority: P1
Reviewed head: 72be047a9a57c074f75e9b85f6ab068509dc387c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful owner-level repair with substantial runtime evidence and resolved prior findings; the shorter-budget compatibility tradeoff is explicit.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The captured terminal transcript exercises built finalization through a supervisor stand-in, showing healthy fresh/upgrade results, bounded snapshot failure, resistant-child termination, and retained-resource exit diagnostics. Wider live proof is pinned to e117a82; later PID and borrowed-lifetime repairs have reported process coverage on f0d57bf. The omitted body tail and unavailable historical comparison are reviewer limitations, not missing contributor proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured terminal transcript exercises built finalization through a supervisor stand-in, showing healthy fresh/upgrade results, bounded snapshot failure, resistant-child termination, and retained-resource exit diagnostics. Wider live proof is pinned to e117a82; later PID and borrowed-lifetime repairs have reported process coverage on f0d57bf. The omitted body tail and unavailable historical comparison are reviewer limitations, not missing contributor proof.
Evidence reviewed 12 items Pinned introduction and current-main necessity: Reviewed the merge-base-to-head production diff. The fetched main finalizer still directly awaits phases and records timings afterward; the new lifecycle file is absent from that main tree. No merged replacement is established by the supplied context.
Latest supplied release retains the unbounded phase await: The v2026.9.2 finalizer uses the 30-minute subprocess default and awaits runTimedFinalizePhase callbacks without an enclosing phase deadline.
Deadline and borrowed-process boundary: Phase deadlines require executable CLI ownership; borrowed invocations continue awaiting their phase. On deadline, the executable stops owned children, records failure, writes terminal JSON synchronously, and exits.
Findings None None.
Security None None.

How this fits together

Update finalization repairs configuration and plugins after a core upgrade. A supervising updater waits for its JSON result and process exit before proceeding with activation or recovery.

flowchart TD
  A[Supervised upgrade or repair] --> B[Admission and configuration checks]
  B --> C[Bounded finalization phases]
  C --> D[Doctor and plugin subprocesses]
  C --> E[Phase diagnostics and update ledger]
  C --> F{Completed or timed out}
  F --> G[Terminal result and owned process cleanup]
  G --> H[Supervisor activation or recovery]
Loading

Before merge

  • Resolve merge risk (P2) - Legitimate migrations or plugin installations exceeding the shorter defaults will now fail finalization and may require the existing --timeout override; successful upgrade proof covers synthetic Linux state.
  • Resolve merge risk (P1) - The affected macOS environment's actual stalled operation remains unidentified, so this patch does not establish that the related incident is fully fixed.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +343, Tests +493, Docs +21, Config 0, Other -1. Total +856 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 13 600 257 +343
Tests 12 581 88 +493
Docs 1 22 1 +21
Config 1 1 1 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 28 1204 348 +856

Review metrics

Metric Value Why it matters
Production versus test growth Production +600/-257; tests and support +580/-88 The body explicitly justifies production growth with phase deadlines, process custody, and exit diagnostics.
Deadline behavior 7 bounded phases; 0 new options The existing --timeout now overrides phase-specific defaults, making the changed upgrade behavior visible.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/codex/src/doctor.ts, migration/backfill/repair: src/cli/update-cli.ts, migration/backfill/repair: src/cli/update-cli/update-command-finalize.ts, migration/backfill/repair: src/cli/update-cli/update-finalization-lifecycle.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the documented phase budgets (recommended)
    Accept the maintainer's explicit deadline tradeoff, supported by fresh-state and upgrade proof, with --timeout available for legitimately longer operations.
  2. Recalibrate from a slow real installation
    If an existing installation demonstrates legitimate work exceeding these budgets, adjust the affected default using that measured evidence before landing.

Technical review

Best possible solution:

Retain bounded finalization with the documented timeout override and demonstrated fresh-state/upgrade behavior, while preserving the separate investigation into the affected macOS stall.

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

Yes for the unbounded-wait mechanism: current main awaits phase callbacks without an enclosing deadline, and the supplied before/after transcript exercises an injected stalled operation. The reporter's exact macOS trigger remains unknown; this review executed no tests.

Is this the best way to solve the issue?

Yes for bounded-outcome containment: deadlines belong to finalization, child cleanup follows process ownership, and borrowed callers retain their lifetime. This does not establish a root-cause fix for the separate macOS incident.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A nonterminal finalizer can leave a supervised upgrade waiting with the Gateway stopped.
  • merge-risk: 🚨 compatibility: Shorter default phase budgets can fail legitimate existing upgrades that previously had longer subprocess allowances.
  • 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 captured terminal transcript exercises built finalization through a supervisor stand-in, showing healthy fresh/upgrade results, bounded snapshot failure, resistant-child termination, and retained-resource exit diagnostics. Wider live proof is pinned to e117a82; later PID and borrowed-lifetime repairs have reported process coverage on f0d57bf. The omitted body tail and unavailable historical comparison are reviewer limitations, not missing contributor proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured terminal transcript exercises built finalization through a supervisor stand-in, showing healthy fresh/upgrade results, bounded snapshot failure, resistant-child termination, and retained-resource exit diagnostics. Wider live proof is pinned to e117a82; later PID and borrowed-lifetime repairs have reported process coverage on f0d57bf. The omitted body tail and unavailable historical comparison are reviewer limitations, not missing contributor proof.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: 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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-07T02:54:32.156Z sha 13e4abc0eba68fad957000a4c6056df38c6e0570 :: blocked before merge. :: [P1] Arm the exit watchdog after failure recovery finishes | [P2] Preserve best-effort completion-cache timeout handling
  • reviewed 2026-09-07T03:13:44.811Z sha 948ed2eee5073577b03aaa41c4a85b0ffb591b60 :: blocked before merge. :: none
  • reviewed 2026-09-07T03:37:35.408Z sha f48bcd706e3665377e647cc5de8c5b41613352f2 :: blocked before merge. :: none
  • reviewed 2026-09-07T03:46:10.491Z sha dc78b37 :: blocked before merge. :: none
  • reviewed 2026-09-07T04:26:32.255Z sha e117a82 :: blocked before merge. :: none
  • reviewed 2026-09-07T04:47:51.318Z sha e117a82 :: blocked before merge. :: [P1] [P1] Preserve child custody when the initial timestamp read fails
  • reviewed 2026-09-07T05:49:35.280Z sha f0d57bf :: blocked before merge. :: none
  • reviewed 2026-09-07T06:01:24.608Z sha 72be047 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 7, 2026
Record phase progress as it happens, retain OCM-compatible terminal timings,
and stop owned subprocess trees before a timed-out finalizer permits rollback.
Bound shared CLI disposers and report resources that outlive terminal output.
Force-kill the managed Codex version probe at its existing deadline.

The missing deadline, child-custody, and diagnostic recovery paths require
production growth; remove duplicated phase bookkeeping and the version probe's
callback wrapper. Keep issue #139485 open for the affected macOS reproduction.
Reported by @hannesrudolph.
@steipete
steipete force-pushed the fix/update-finalize-bounded branch from f48bcd7 to dc78b37 Compare September 7, 2026 03:39
Detach the fixture grandchild from the launcher-owned libuv Job so only the finalizer Job can terminate it after the launcher exits. Keep borrowed and Gateway negative controls.
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 7, 2026
@clawsweeper clawsweeper Bot added 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 status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 7, 2026
@steipete
steipete merged commit bff6c68 into main Sep 7, 2026
201 checks passed
@steipete
steipete deleted the fix/update-finalize-bounded branch September 7, 2026 06:25
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 8, 2026
* fix(update): identify children in stalled finalization diagnostics

Report bounded descendant identities in phase and cleanup diagnostics without argv or environment disclosure. Preserve terminal outcomes and fence children before releasing the supervisor result. Related: #139485; follows #140648. Reporter: @hannesrudolph.

* fix(update): read Linux child executable identities

Use bounded /proc executable lookups because Linux accounting names can contain mutable argument-derived titles. Preserve process IDs with null names when a process disappears. Keeps the native privacy regression that failed in CI.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…#140648)

* fix(update): bound finalization and diagnose stalled phases

Record phase progress as it happens, retain OCM-compatible terminal timings,
and stop owned subprocess trees before a timed-out finalizer permits rollback.
Bound shared CLI disposers and report resources that outlive terminal output.
Force-kill the managed Codex version probe at its existing deadline.

The missing deadline, child-custody, and diagnostic recovery paths require
production growth; remove duplicated phase bookkeeping and the version probe's
callback wrapper. Keep issue openclaw#139485 open for the affected macOS reproduction.
Reported by @hannesrudolph.

* test(update): complete stalled cleanup fixture

* fix(update): keep completion refresh interruptible

* test(update): use supported subprocess IPC option

* fix(update): preserve triage after bounded preflight

* fix(update): preserve recovery and optional completion outcomes

* fix(update): retain process ownership through finalizer exit

* test(update): keep process and budget checks type-safe

* test(update): exercise Windows orphan cleanup ownership

Detach the fixture grandchild from the launcher-owned libuv Job so only the finalizer Job can terminate it after the launcher exits. Keep borrowed and Gateway negative controls.

* style(tests): use pinned planner formatting

* fix(process): preserve live child custody after probe failure

* fix(update): preserve borrowed CLI process lifetime

* test(update): avoid returning the borrowed caller timer
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
)

* fix(update): identify children in stalled finalization diagnostics

Report bounded descendant identities in phase and cleanup diagnostics without argv or environment disclosure. Preserve terminal outcomes and fence children before releasing the supervisor result. Related: openclaw#139485; follows openclaw#140648. Reporter: @hannesrudolph.

* fix(update): read Linux child executable identities

Use bounded /proc executable lookups because Linux accounting names can contain mutable argument-derived titles. Preserve process IDs with null names when a process disappears. Keeps the native privacy regression that failed in CI.
steipete added a commit that referenced this pull request Sep 8, 2026
Keep explicit Codex version checks bounded when descendants retain output pipes, preserve timeout failures, and carry nonfatal repair warnings through the existing Doctor result channel. Routine repair now shares lint default-check selection. Related: #139485; follow-up to #140648 and #141740. The daemonized-child experiment completed on official 2026.9.2 and main; this does not claim the original incident is resolved.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…w#141995)

Keep explicit Codex version checks bounded when descendants retain output pipes, preserve timeout failures, and carry nonfatal repair warnings through the existing Doctor result channel. Routine repair now shares lint default-check selection. Related: openclaw#139485; follow-up to openclaw#140648 and openclaw#141740. The daemonized-child experiment completed on official 2026.9.2 and main; this does not claim the original incident is resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant