Skip to content

fix(update): skip opt-in probes and preserve Doctor warnings - #141995

Merged
steipete merged 1 commit into
mainfrom
steipete/update-finalize-pipes-0908
Sep 8, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/update-finalize-pipes-0908

Conversation

@steipete

@steipete steipete commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139485. Follow-up to #140648 and #141740. This does not close #139485.

What Problem This Solves

Fixes an issue where update finalization runs an opt-in managed Codex version check during ordinary Doctor repair and omits nonfatal Doctor warnings from its JSON report. The probe can also report success after its five-second timeout destroys pipes retained by an already-exited child's descendant.

The daemonized-child experiment did not reproduce an indefinite hang on official 2026.9.2 or current main. This PR takes the investigation's requested narrower scope; it does not claim to identify @hannesrudolph's original failure.

Why This Change Was Made

Doctor repair now shares ordinary lint's default-enabled selection while retaining the existing enabled/configured-plugin policy. Explicit candidate checks remain strict. The managed version probe uses the existing process runner, preserving its five-second deadline, forced process-group termination, bounded capture, immediate stdin EOF, and bounded post-timeout drain. A failed probe invoked in post-core repair is a warning. Routine finalization skips this opt-in check.

Nonfatal repair warnings pass through the existing Doctor result IPC into postUpdate.doctor.warnings, capped at 32 messages of 500 characters. Finalization returns warning/exit 0 when no step fails. Enabling that existing IPC also activates the existing deferred-plugin advisory exit 86; it is accepted only with a validated advisory result and an ordinary exit, never a timeout or output failure.

Mechanism references:

User Impact

Routine finalization avoids unnecessary opt-in version probes, supervisors receive nonfatal Doctor warnings, and explicit candidate validation cannot mistake a timed-out output drain for successful readiness. Codex runtime readiness remains owned by the plugin after restart. No configuration, environment-name, dependency, schema, or protocol change is introduced.

Evidence

All state and probes were synthetic and isolated on macOS 27 arm64. No real OpenClaw state, keychain tooling, launchd mutation, merge, or lock recovery was used.

Case Observed result
Official 2026.9.2 + official installed Codex plugin; direct child exits 0, detached descendant retains pipes Finalizer exit 0 / status ok in 20.714s; orphan remains until harness cleanup. Initial valid run also passed in 31.004s.
Main 1029e3870f23, same probe Exit 0 / status ok in 14.017s; orphan remains until cleanup.
Candidate finalizer, configured Codex, Node 26.7 / 24.19 Exit 0 / status ok in 9.191s / 7.830s; probe correctly not entered.
Candidate explicit lint, orphan, Node 26.7 Timeout finding / exit 1 in 7.893s including startup.
Candidate explicit lint, SIGTERM-resistant child, Node 24.19 Timeout finding / exit 1 in 6.782s including startup; child stopped.
Actual OCM 0.2.41, official 9.2 → candidate, Node 26.7 / 24.19 outcome: switched, exit 0 in 16.737s / 15.862s; source/candidate foreground Gateway health/readiness verified.

The observers verified entry into the native probe, reparenting to PID 1, process trees, per-process lsof, and native samples of the actual finalizer. Official 9.2 showed an idle kevent main thread with pipes/kqueues and no SQLite descriptors but still completed. Main additionally retained its update-ledger descriptors. These observations distinguish a reachable pipe-retention mechanism from the unconfirmed incident.

Validation: 334 focused tests across eight files, then 123 final tests across four files on Node 26.7. Main-red regressions cover silent orphan-timeout success, default-check selection, warning IPC, and terminal JSON. node scripts/check-changed.mjs (the documented equivalent for ready worktree dependencies) and git diff --check pass. Independent P0–P2 review is scoped-clean. A full build and package integrity check pass; the nine changed production files match the tested candidate snapshot byte-for-byte. Later changes only relocated a test into existing support and used the existing tree-cleanup helper.

Limits: the reporter's macOS 26 and actual state remain untested. OCM services stayed disabled because its launchd label is shared; this exercises runtime switching/finalization and foreground verification, not launchd or automatic rollback. The initial Node 26 OCM snapshot returned transient ENOENT before upgrade; an ordinary retry passed. Official 9.1 setup was network-blocked, so this OCM comparison starts at official 9.2. Slow/incomplete dependency installs and unentered probes are excluded from passing evidence. No Windows-native proof was added.

Exact-head CI: run 34200852921 is attached to 4638117477589f9d7875e77f6ce0482f9bb4e5ec. The bounded watcher ended at its deadline; the last successful read was in_progress. Intermittent GitHub read timeouts occurred. CI is not claimed green. The initial draft-skipped run was excluded. This PR remains unmerged.

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.
@clawsweeper

clawsweeper Bot commented Sep 8, 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: M maintainer Maintainer-authored PR labels Sep 8, 2026
@steipete
steipete marked this pull request as ready for review September 8, 2026 07:44
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 8, 2026, 4:03 AM ET / 08:03 UTC.

ClawSweeper review

What this changes

The PR skips opt-in checks during routine Doctor repair, bounds explicit Codex version probes, and includes nonfatal repair warnings in update finalization results.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, scoped fix absent from reviewed main. No actionable findings remain; the previous migration-proof concern is resolved by the existing temporary IPC contract and supplied upgrade evidence.

Priority: P2
Reviewed head: 4638117477589f9d7875e77f6ce0482f9bb4e5ec

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with strong relevant runtime evidence and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Supplied macOS observations exercise candidate finalization, explicit native-probe faults, and actual OCM upgrades on Node 24/26, showing skipped routine probes, bounded explicit failures, and successful switching; focused regressions supplement warning-channel coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Supplied macOS observations exercise candidate finalization, explicit native-probe faults, and actual OCM upgrades on Node 24/26, showing skipped routine probes, bounded explicit failures, and successful switching; focused regressions supplement warning-channel coverage.
Evidence reviewed 10 items Introduced scope and current necessity: The full merge-base-to-head diff was inspected. Current main still runs extension repairs without the default-enabled filter and lacks the warning field in the Doctor result contract. Live REST metadata confirms this PR remains open and unmerged at the reviewed head.
Warning channel and advisory safety: Warnings extend an existing per-invocation temporary result file, written exclusively with mode 0600 and consumed with deletion. They are capped at 32 messages of 500 characters. The fresh Doctor caller accepts exit 86 only with a validated advisory and an ordinary command exit; timeout, cancellation, and output failures remain failures. No persistent schema or migration is introduced.
Selection and unresolved findings: Repair now shares lint's existing default-selection predicate. Explicit lint selection and post-plugin readiness selection remain separate. The repair runner preserves original findings whenever validation did not complete, so detect-only and skipped repairs remain visible to the new warning collector.
Findings None None.
Security None None.

How this fits together

Update finalization runs Doctor and plugin convergence before an update supervisor resumes the Gateway. Doctor findings and child-process outcomes feed the final command status and JSON report.

flowchart TD
  A[Update supervisor] --> B[Update finalization]
  B --> C[Doctor check selection]
  C --> D[Default repair checks]
  E[Explicit candidate lint] --> F[Bounded Codex probe]
  D --> G[Doctor result channel]
  G --> H[Final status and warnings]
  B --> H
Loading

Before merge

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

Security

None.

PR surface

Source +118, Tests +293, Docs +11. Total +422 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 9 151 33 +118
Tests 6 298 5 +293
Docs 1 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 460 38 +422

Review metrics

Metric Value Why it matters
Diagnostic bounds 32 warnings maximum; 500 characters each The new parent-facing diagnostics have explicit payload limits.
Production versus test growth Production +118 net lines; tests/support +293 net lines Production growth implements bounded probing and warning propagation, with focused regression coverage.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/codex/src/doctor.ts, migration/backfill/repair: src/cli/update-cli/update-command-finalize.ts, migration/backfill/repair: src/cli/update-cli/update-command-fresh-doctor.ts, migration/backfill/repair: src/flows/doctor-health-contribution-core.ts, migration/backfill/repair: src/flows/doctor-health-contribution-types.ts, migration/backfill/repair: src/flows/doctor-health.ts, and 5 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep routine repair aligned with opt-in check semantics, preserve explicit candidate validation, and report bounded warnings through the existing finalization channel.

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

Yes—source inspection and supplied before/after observations establish unwanted opt-in probing and timeout-as-success behavior; this review did not execute the reproduction.

Is this the best way to solve the issue?

Yes—the patch reuses existing selection, process-runner, and result-channel owners while preserving explicit validation and fatal failures.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs bounded update diagnostics and optional probe behavior without establishing the cause of the separate production outage.
  • 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 (live_output): Supplied macOS observations exercise candidate finalization, explicit native-probe faults, and actual OCM upgrades on Node 24/26, showing skipped routine probes, bounded explicit failures, and successful switching; focused regressions supplement warning-channel coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. Supplied macOS observations exercise candidate finalization, explicit native-probe faults, and actual OCM upgrades on Node 24/26, showing skipped routine probes, bounded explicit failures, and successful switching; focused regressions supplement warning-channel coverage.

Evidence

What I checked:

  • Introduced scope and current necessity: The full merge-base-to-head diff was inspected. Current main still runs extension repairs without the default-enabled filter and lacks the warning field in the Doctor result contract. Live REST metadata confirms this PR remains open and unmerged at the reviewed head. (src/flows/doctor-health-contribution-core.ts:38, fdd6acecfe91)
  • Warning channel and advisory safety: Warnings extend an existing per-invocation temporary result file, written exclusively with mode 0600 and consumed with deletion. They are capped at 32 messages of 500 characters. The fresh Doctor caller accepts exit 86 only with a validated advisory and an ordinary command exit; timeout, cancellation, and output failures remain failures. No persistent schema or migration is introduced. (src/infra/update-doctor-result.ts:34, 463811747758)
  • Selection and unresolved findings: Repair now shares lint's existing default-selection predicate. Explicit lint selection and post-plugin readiness selection remain separate. The repair runner preserves original findings whenever validation did not complete, so detect-only and skipped repairs remain visible to the new warning collector. (src/flows/doctor-repair-flow.ts:64, 463811747758)
  • Probe ownership and dependency signal: The changed probe directly executes the managed Codex binary with --version, establishing the Codex dependency signal. It reuses the existing SDK process runner, supplies stdin EOF, and rejects timeout or output-limit termination even when the child previously exited successfully. Shared process ownership and cleanup implementations are unchanged. (extensions/codex/src/doctor.ts:72, 463811747758)
  • Personally inspected Codex CLI contract: The sibling checkout's backing repository remote resolves to openai/codex. Its CLI parser enables the version flag; this inspection concerns the version-command contract, not app-server protocol behavior or the package's pinned version. (codex-rs/cli/src/main.rs:105, 3d2ee51ca2d5)
  • Supervisor compatibility: OCM v0.2.41 invokes update finalize with the post-core marker and determines failure from process exit status. Warning/exit-zero results preserve that contract. The inspected functions are run_post_core_update and run_update_mode_openclaw_command_output_with_env. (src/cli/upgrade.rs:3977, 95c63405591d)

Likely related people:

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

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 (1 earlier review cycle)
  • reviewed 2026-09-08T07:51:31.912Z sha 4638117 :: blocked before merge. :: none

@steipete
steipete merged commit 4e3d22e into main Sep 8, 2026
256 checks passed
@steipete
steipete deleted the steipete/update-finalize-pipes-0908 branch September 8, 2026 08:48
@steipete

steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 8, 2026
Record unresolved core contribution warnings and caught optional failures in
Doctor's existing bounded update result. Share core/plugin repair reporting
while preserving display, repair, required-failure and exit semantics.

Related: #141995
Validation: 273 focused cases, 29 changed checks, independent P2 review.
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…2091)

Record unresolved core contribution warnings and caught optional failures in
Doctor's existing bounded update result. Share core/plugin repair reporting
while preserving display, repair, required-failure and exit semantics.

Related: openclaw#141995
Validation: 273 focused cases, 29 changed checks, independent P2 review.
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: Managed upgrade leaves gateway offline while finalization remains nonterminal

1 participant