Repository navigation
fix: prevent live updater from leaving Gateway offline indefinitely - #119116
fuller-stack-dev merged 14 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 3:17 AM ET / 07:17 UTC. ClawSweeper reviewWhat this changesThis PR gives the live updater phase-specific command deadlines, verified POSIX process-tree cleanup, bounded failure reporting, and fail-closed recovery handling. Merge readinessKeep this PR open for normal maintainer merge handling: current main still runs updater commands without a deadline, while the branch moves timeout and process-tree ownership into the shared command runner. I found no actionable correctness finding; the temporary Windows refusal is an explicitly accepted availability trade-off. Priority: P1 Review scores
Verification
How this fits togetherThe live updater pauses and stops the managed Gateway, updates the checkout, installs and builds dependencies, then restarts and probes the service. Its command runner determines whether a stalled maintenance command can safely recover the Gateway. flowchart LR
A[Updater heartbeat] --> B[Maintenance lock]
B --> C[Pause and stop Gateway]
C --> D[Run bounded update command]
D --> E{Tree cleanup proven?}
E -->|Yes| F[Restart and verify Gateway]
E -->|No| G[Retain lock and report recovery state]
G --> H[Later heartbeat rechecks ownership]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +642, Docs 0, Other +572. Total +1214 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared managed-child runner as the one timeout and cleanup owner, retain the explicit Windows pre-stop refusal until a Job Object-equivalent owner exists, and merge after normal exact-head gates complete. Do we have a high-confidence way to reproduce the issue? Yes—current main's unbounded updater runner is directly visible, and the submitted deterministic child-process harness describes the stalled-command path without requiring a live Gateway. Is this the best way to solve the issue? Yes—the shared managed-child owner is the narrowest maintainable boundary for deadlines and verified cleanup; downstream recovery guards alone would duplicate lifecycle policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8393b37779d9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accept the temporary fail-closed Windows boundary in this PR. Until a Job Object or equivalent verified process-tree owner exists, strict Windows updater commands must refuse before spawning the pre-stop fetch, leaving the Gateway online and releasing the maintenance lock. This availability tradeoff is preferable to recovering alongside an unverified descendant tree. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…and-timeouts # Conflicts: # .agents/skills/openclaw-live-updater/scripts/update-main.mjs # test/scripts/openclaw-live-updater.test.ts
|
Merged via squash.
|
…checkpoint * origin/main: (46 commits) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) fix(scripts): prevent gateway benchmarks from stalling on probes (#119063) test(channels): verify built sanitizer semantics (#119151) fix: prevent live updater from leaving Gateway offline indefinitely (#119116) test(qa): restore memory tools primary ownership (#119142) fix(agents): settle yielded fanout at harness boundary (#118703) fix(codex): cap compaction override warning cache via createDedupeCache (#101745) fix(daemon): skip unlabeled launchd plists (#119091) test(qa): repair QA catalog integrity (#119140) ...
…penclaw#119116) * fix(updater): bound maintenance commands * fix(updater): bound post-kill cleanup * fix(updater): fail closed on unverified Windows cleanup * fix(updater): constrain unverifiable Windows commands * fix(scripts): satisfy managed child return contract
* origin/main: fix: prevent live updater from leaving Gateway offline indefinitely (openclaw#119116) test(qa): restore memory tools primary ownership (openclaw#119142) fix(agents): settle yielded fanout at harness boundary (openclaw#118703) fix(codex): cap compaction override warning cache via createDedupeCache (openclaw#101745) fix(daemon): skip unlabeled launchd plists (openclaw#119091) test(qa): repair QA catalog integrity (openclaw#119140) fix(test): isolate shared state between test files (openclaw#118781) test(xai): cover delayed OAuth connection setup fix(voice): start socket timeout after auth preparation
* origin/main: fix: prevent live updater from leaving Gateway offline indefinitely (openclaw#119116) test(qa): restore memory tools primary ownership (openclaw#119142) fix(agents): settle yielded fanout at harness boundary (openclaw#118703) fix(codex): cap compaction override warning cache via createDedupeCache (openclaw#101745) fix(daemon): skip unlabeled launchd plists (openclaw#119091) test(qa): repair QA catalog integrity (openclaw#119140) fix(test): isolate shared state between test files (openclaw#118781) test(xai): cover delayed OAuth connection setup fix(voice): start socket timeout after auth preparation
Closes #119098
AI-assisted implementation; I reviewed the final behavior and diff.
What Problem This Solves
The live updater previously ran maintenance-owned commands without wall deadlines. A stalled dependency install, build, service action, or probe could therefore keep the Gateway fenced or stopped indefinitely and prevent rollback, lock release, and terminal JSON output.
The August 3, 2026 fleet observation involved
pnpm install --frozen-lockfiledoing cross-platform optional-package resolution/download work, emitting network retries, and later remaining alive without observable progress. That does not establish a pnpm defect. The confirmed OpenClaw issue is the updater robustness gap: it did not bound or clean up any stalled child command.Why This Change Was Made
External phases now use explicit wall budgets and the shared managed-child owner:
Output does not reset these deadlines, so continuous retry/progress logs cannot extend maintenance indefinitely.
On macOS/Linux, commands run in detached process groups. Timeout settlement no longer depends on the child emitting
close; process-group drain starts at the deadline and is bounded to five seconds. Transient DarwinEPERMgroup probes are polled until the same deadline rather than treated as final cleanup failure.If a stopped-state command tree remains live or indeterminate after that bound, recovery fails closed: the previous service is not restarted alongside an uncontrolled updater child, and the maintenance lock is retained against the exact process group. A later heartbeat reclaims the lock after that group is gone. The terminal result is
command_cleanup_failedwith bounded redacted diagnostics.Windows strict process-tree completion is explicitly unsupported because
taskkill /Trequires a live root PID and cannot verify descendants after normal root exit. The updater therefore refuses before spawning the pre-stop Git fetch, leaves the Gateway untouched, releases the maintenance lock, and emitsunsupported_process_tree_verification. A future Windows Job Object owner can lift this constraint without weakening the updater contract.This head also integrates the additive, redacted failure diagnostics merged in #119096. Timeout output retains safe phase, service-state, elapsed-time, timeout, cleanup-state, and lock-retention facts without exposing PIDs, paths, argv, environment, stdout, or stderr.
User Impact
Normal installs and builds keep generous wall budgets. A timeout before service stop releases the lock without changing service state. A timeout after stop cleans the exact child tree before rollback. An unverified live tree produces a bounded fail-closed result and retained ownership instead of either concurrent mutation or an unbounded wait.
Evidence
Canonical investigation base:
12beeb7b29476d0ac96590e51bbc14fff63fbe60.Current canonical base:
ae21f3c00c78403f05137d5e48957b8ceb40910c.PR head:
911f3d4734be3c7891325d7ddfc79c09cd27fdf1.No destructive test used the live Wilfred Gateway.
Focused macOS proof:
Source-blind Darwin harness command:
All clauses passed: silent timeout, active progress without false timeout, parent/descendant cleanup, and timeout settlement when
closelisteners are removed. Anti-cheat variants also passed for a different timeout, stderr retry output, and a SIGTERM-resistant descendant. Every recorded exact PID was dead at settlement.Focused Linux Testbox proof and full changed-surface gate ran in Actions run
30882291207:The gate passed formatting, declaration contracts, all-project typecheck, full lint, policy guards, and runtime import-cycle checks.
Coverage includes silent and active children, network-retry output, descendant cleanup, missing
close, transient indeterminate POSIX state, bounded Windows timeout cleanup, strict Windows refusal before spawn, pre-stop timeout, post-stop recovery, process-group and manual-recovery lock retention, normal under-budget builds, and one machine-readable result.Fresh autoreview after the explicit Windows strict-mode constraint was clean with no accepted/actionable findings; overall correctness 0.99.