Skip to content

fix: prevent refused update children from proceeding on EOF - #154289

Merged
vincentkoc merged 1 commit into
mainfrom
ci-burden/f55-update-executor-auxiliary
Sep 21, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
ci-burden/f55-update-executor-auxiliary

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a child-process race during openclaw update: an installer refused at input admission could still execute its EOF-triggered work while cancellation was starting.

Sighting: main run 35551129586, job 106186821184, checks-node-compact-small-24, agentic-cli / cli, head 4c63f0046ad5d63104c2b7ca6252fb685e39e0c1. The failing case was refuses Node provisioning after options-replaced at at-input in update-command-executor-auxiliary.test.ts.

User Impact

Refused child input remains withheld while the existing process owner terminates and joins the child. The refusal, process-tree cleanup, update recovery behavior, and existing time budgets remain intact. No public contract, state schema, durability, retention, or permission changes.

Why This Change Was Made

The refusal assertion already passed. The failed assertion expected fs.existsSync(effect) to be false but received true. The process runner destroyed stdin before requesting cancellation; EOF released the fake installer's synchronous stdin read, allowing its effect to race termination.

Remove that premature destruction at the process owner. A real-process regression waits for the child's ready output before rejecting admission, then verifies the original refusal, absence of the effect, forced cleanup, and process death. The original auxiliary assertions and CLI fixtures are unchanged; no retries, sleeps, timeout increases, or planner changes.

This is the focused extraction of the same EOF repair independently identified in the unpublished ci-burden/h7-cli-workers work. H7's broader process and CLI fixture changes remain outside this PR.

Evidence

  • Linux Blacksmith Testbox tbx_01m30v2qq3k9xk71hj11xazdbp, environment run: deterministic regression fails on original production code at the no-effect assertion, then passes with this repair. Original auxiliary file before and after the fix: 0 failures / 20 standalone runs each at OPENCLAW_VITEST_MAX_WORKERS=8.
  • Local regression: passed; pnpm test src/process/exec-input-admission.test.ts --maxWorkers=1 took 107.87 s wall, including shared subprocess-build preparation; the test itself took 424 ms.
  • Targeted type-aware oxlint passed; independent canary correctly reported typescript/no-floating-promises. node scripts/check-changed.mjs, formatting, and git diff --check passed. Pre-commit and final branch reviews: no actionable P0–P2 findings.
  • Linux owner/sibling proof: 151 passed, one existing skip across the process runner, termination owner, executor, and settlement tests. The deterministic Linux regression took 344 ms after the fix (9.76 s wrapper wall). Hosted CI also passed the new regression in 344 ms in checks-node-compact-small-17 / core-runtime-infra-process.
  • Full Linux agentic-cli group at its captured two-worker policy: 382 files passed, one skipped, one failed; all 24 auxiliary cases passed. The single failure is the unchanged artifact-cleanup case in update-command-artifact.test.ts, receiving FsSafeError instead of AggregateError. The Testbox reports umask 0002; H7 has a controlled reproducer and an unpublished repair at the shared src/test-helpers/temp-dir.ts producer. The failure occurs during workspace creation, before the mocked staging callback, and does not execute the changed admission path. Three clean group runs remain blocked; no failed shard was retried to obtain green.
  • Hosted CI run 35553596459 is red: job 106192938591, checks-node-compact-small-45, timed out after 120 seconds in test/scripts/release-check.test.ts → loads sparse release tooling and checks the target worker contract. The release-tooling runtime closure contains neither changed file. This matches the unresolved F52 investigation; no owning repair PR exists yet. No hosted rerun was requested.
  • Original-code baseline with the historical log’s reconstructed file order: all 24 auxiliary cases passed; the same artifact-fixture failure was the only failure across 384 files (534.24 s). Native post-fix group run: 556.68 s. These use Blacksmith Testbox tbx_01m30w0qp370n38ps7v0fw4jky, environment run. Both task leases are stopped. Initial shard-launch/config-routing attempts that did not exercise the CLI group are excluded from these results.
  • Validation remains incomplete because the two owning failures above are unresolved. This PR is not landed, and no failing test was hidden with retries, timeout increases, or weaker assertions.

@clawsweeper

clawsweeper Bot commented Sep 21, 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 size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 20, 2026, 11:04 PM ET / September 21, 2026, 03:04 UTC (Revision 2).

ClawSweeper review

What this changes

The process runner keeps rejected child input open during termination so EOF cannot trigger refused installer work, and adds a synchronized real-process regression.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: the repair addresses a race still present on current main and the latest release, with no introduced correctness finding. The updated evidence explains the outstanding validation failures but does not yet supply their owning fixes.

Priority: P2
Reviewed head: 942134c029a6d0cbdd9ca48f500f72728c8b8884

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with a meaningful regression and no identified patch defect; unresolved validation still prevents landing.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary contributor proof gate is exempt under the supplied MEMBER classification. Reported Linux runs exercise the actual process runner with a ready, blocked child and verify withheld effects plus termination; broader validation remains separately incomplete.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor proof gate is exempt under the supplied MEMBER classification. Reported Linux runs exercise the actual process runner with a ready, blocked child and verify withheld effects plus termination; broader validation remains separately incomplete.
Evidence reviewed 9 items Verified introduced change: The pinned merge-base-to-head diff removes premature stdin destruction from the admission-error catch and adds a real-child regression. The verified test merge has the recorded base and head parents and preserves this same production change.
Repair remains necessary on main: Fetched main still calls stdin.destroy() before cancel("signal") when admission throws. The admitted-input path and cleanup settlement remain unchanged by this PR.
Latest release retains the race: The source at the supplied v2026.9.5 release commit also destroys stdin before cancellation at line 524; this repair is not already present there.
Findings None None.
Security None None.

How this fits together

OpenClaw's process runner starts update helpers and releases their input after an admission check. When admission fails, its termination owner stops and joins the child before returning the refusal.

flowchart TD
  A[Update helper request] --> B[Spawn child with input withheld]
  B --> C{Admission allowed?}
  C -->|Yes| D[Deliver input and EOF]
  C -->|No| E[Keep input withheld]
  E --> F[Terminate and join child]
  F --> G[Return original refusal]
Loading

Before merge

  • Complete next step (P2) - Document and link the owning fixes for the artifact-fixture failure and sparse-release timeout, then complete the outstanding validation without rerunning merely to obtain green.
Agent review details

Security

None.

PR surface

Source 0, Tests +81. Total +81 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 81 0 +81
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 82 1 +81

Review metrics

Metric Value Why it matters
Reported regression cost 344 ms in CI; 424 ms local test; 107.87 s local wrapper The regression itself is bounded; the reported local wall time includes shared subprocess-build preparation.

Technical review

Best possible solution:

Keep refused input withheld through the existing termination owner, preserve admitted EOF behavior, and consolidate the overlapping repair into one landing path.

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

Yes: source identifies premature EOF before cancellation, and the synchronized child regression targets that schedule. The PR reports before/after Linux results; this review did not execute them.

Is this the best way to solve the issue?

Yes: removing the premature close repairs the existing input owner without adding cancellation machinery or changing successful input delivery.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a focused repair for an update-child admission race; failing validation does not independently raise its priority.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor proof gate is exempt under the supplied MEMBER classification. Reported Linux runs exercise the actual process runner with a ready, blocked child and verify withheld effects plus termination; broader validation remains separately incomplete.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff removes premature stdin destruction from the admission-error catch and adds a real-child regression. The verified test merge has the recorded base and head parents and preserves this same production change. (src/process/exec-runner.ts:535, 942134c029a6)
  • Repair remains necessary on main: Fetched main still calls stdin.destroy() before cancel("signal") when admission throws. The admitted-input path and cleanup settlement remain unchanged by this PR. (src/process/exec-runner.ts:535, 6bb897a7231a)
  • Latest release retains the race: The source at the supplied v2026.9.5 release commit also destroys stdin before cancellation at line 524; this repair is not already present there. (src/process/exec-runner.ts:524, ec9c1a13db89)
  • Regression exercises the missing schedule: The new case waits for an actual child's ready output before refusing admission. Its synchronous stdin read blocks SIGTERM handling; assertions check no filesystem effect, the original error, forced cleanup, and child death. Existing admission tests cover allowed input and other refusal/error cases. (src/process/exec-input-admission.test.ts:44, 942134c029a6)
  • Authority and cleanup boundaries: Runtime provisioning rechecks requester authority immediately before binding the child and releasing input. The repair preserves that check, process-tree ownership, force escalation, and settlement; it introduces no grant, permission, persisted-state, or dependency change. (src/cli/update-cli/update-command-node-runtime.ts:48, 942134c029a6)
  • Updated validation and review continuity: Captured sourceRevision ad74b48a63dc1058e58d716c7ec5fe50435c7032fd273b4b93fb6e58819bb820 reports deterministic Linux failure before the repair and success afterward, 151 passing owner/sibling tests, and passing auxiliary cases. It also explicitly leaves the artifact-fixture failure and 120-second sparse-release timeout unresolved, with no published owning repairs. The previous review's owning-fix request therefore remains outstanding. No tests were executed during this read-only review. (942134c029a6)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Cite the owning repairs for the artifact-fixture failure and sparse-release timeout, then complete the outstanding affected-shard validation.

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-21T02:33:52.985Z sha 942134c :: needs changes before merge. :: none

@vincentkoc vincentkoc self-assigned this Sep 21, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer validation update for unchanged head 942134c029a6d0cbdd9ca48f500f72728c8b8884:

  • The artifact-fixture owner was repaired in #154235. The original failed CI tested merge 643b73da39b24ebcbed7c2d12011ae31f38d99d1, which already contained the repaired helper. The older PR-head helper was not that job's input.
  • The unchanged sparse-release case passed in 12.041s in the Blacksmith control. Seven release owners, relevant fixtures/configuration, lock/workspace and toolchain inputs match the failed merge. That execution path uses native managed spawn/execFileSync and does not traverse this PR's changed input-admission catch.
  • One targeted qualification rerun tested the same merge: all 14 release cases passed, including the original sparse case in 21.775s; the group passed 933 tests with 3 existing skips across 31 files. Attempt 2 and its CI gate passed. This rerun used the existing ubuntu-24.04 fallback; the original and control used Blacksmith. No source, timeout, assertion or runner policy changed.
  • Fresh independent full-PR P2 review is clean on this exact head, and current-main composition was checked without rebasing.

Review disposition: the artifact-fix request is resolved, and the validation request is satisfied by the exact-head runtime, control and qualification evidence. A speculative sparse-release code repair is skipped because no owning defect has been established and that path bypasses this PR's changed catch.

Named follow-up: diagnose the original 120-second sparse release-tooling timeout in test/scripts/release-check.test.ts. Its cause remains unexplained; a passing qualification run does not prove it was fixed, and no Blacksmith cause or performance improvement is claimed.

@vincentkoc
vincentkoc merged commit 72cb749 into main Sep 21, 2026
395 of 397 checks passed
@vincentkoc
vincentkoc deleted the ci-burden/f55-update-executor-auxiliary branch September 21, 2026 03:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants