Skip to content

[2026.9.36] preserve buffered cleanup uncertainty - #187273

Merged
RomneyDa merged 4 commits into
extended-stable/2026.9.33from
backport/exec-extended-20261029
Oct 29, 2026
Merged

RomneyDa merged 4 commits into
extended-stable/2026.9.33from
backport/exec-extended-20261029

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Source and scope

  • Upstream fix: preserve uncertain cleanup in buffered command results #184270, exact source commit: 95adab3; original author: Shakker.
  • Target: extended-stable/2026.9.33. Source is on main; actual release code was inspected and the fix is absent (not merely an ancestry check).
  • Independently backported the cohesive source fix, not the aggregate scope-reduction proof commit.
  • Preserve uncertain cleanup errors, canonical identity/cause, captured output, and termination details. Adapt regression placement to the release-local harness; add ordinary nonzero exit coverage.
  • No lockfile, dependency manifest, toolchain, release workflow, or release-validation source changes.

Validation

PASS: node scripts/test-projects.mts src/process/exec-buffered-cleanup.test.ts (5/5) on this exact release base. Covers ordinary/uncertain completed results, buffered output and exit metadata, tagged startup failures, canonical error identity, and cause retention.
NEGATIVE CONTROL: replacing only exec.ts with exact unpatched release-base source produces 2 failures with 3 controls passing; patched bytes restored and verified clean.
PASS: scoped formatting check and git diff --check.
Broader exec/settlement suites were attempted, but are not accepted as green: early attempts failed shared subprocess-worker compilation with unavailable/mismatched local dependencies; corrected broader builds were interrupted before a terminal verdict and remain a gate.
Validation used own local node_modules link directories, release-pinned TypeScript (and fs-safe for rollback), and borrowed installed tools (Vitest 5.0.5); no dependency or toolchain source was changed.

Remaining gates — draft only

  • Real Windows acceptance (Linux injected-denial tests do not replace it).
  • Full independent/context-aware review: unresolved reviewer capacity is not bypassed.
  • Hosted checks and normal release-owner approval.

Not ready for review, merge, or release. No release shipped.

Preserve canonical cleanup uncertainty in buffered command errors while retaining command output and termination status.

Fixes #184237.

Adapt regression placement to the release branch test harness and add ordinary nonzero-exit coverage; preserve only buffered command cleanup semantics.

Upstream-source: 95adab3
(cherry picked from commit 95adab3)

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

clawsweeper Bot commented Oct 29, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserves canonical cleanup uncertainty in buffered command results while retaining output, termination details, and original error causes.

Example: A Linux command writes stdout and stderr, then terminates itself with SIGTERM.

  • Before: The buffered result retains output and SIGTERM but omits the runner’s uncertain-cleanup classification.
  • After: The same result also exposes CommandProcessCleanupError through its existing error field.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The production repair is focused and source-correct, but release-specific execution evidence is limited and some added controls duplicate existing coverage.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; upstream supplies Linux Gateway runtime output, while this release carry supplies only mocked adapter results and explicitly reserves native Windows acceptance.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Buffered command consumers lose the distinction between an ordinary failure and cleanup that could not be confirmed.
Reason: The maintainer-authored backport restores an existing contract on an affected release branch without adding policy, configuration, or a new API.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored backport open: the release branch still needs the upstream repair, and no introduced production defect was found; the author explicitly keeps it draft.

Priority: P2
Reviewed head: b68fbad259ae961b1acc9093fdfbc4d9deaaa57c

Before merge

None.

Findings

None.

Tests

  • Low-value test src/process/exec.test.ts: Consolidate the added ordinary-nonzero subprocess case into the adjacent existing binary-output/nonzero-exit test by adding its missing no-error assertion.
  • Low-value test src/process/exec-buffered-cleanup.test.ts: Remove or consolidate the mocked startup cause and canonical-identity cases already exercised through the real runner by the added exec-scope-settlement startup group; retain distinct completed-exit coverage.
  • Missing end-to-end proof: The release backport has no supplied runtime capture of the changed path, and its author explicitly leaves native Windows acceptance and broader exec/settlement validation unfinished.
Agent review details

How this fits together

The shared buffered process adapter accepts argv and execution options, delegates lifecycle decisions to the command runner, and returns captured bytes, status, and errors to core and plugin callers.

flowchart LR
 A[Core or plugin caller] --> B[Buffered command adapter]
 B --> C[Command runner]
 C --> D[Spawn and cleanup owners]
 D --> E[Child process]
 C --> B
 B --> F[Output status and canonical error]
Loading

Technical review

Best possible solution:

Retain the focused shared-adapter repair and finish the author’s selected release validation before advancing the draft.

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

The release runner supplies uncertainty that its buffered adapter drops, and the linked report documents a real Linux self-SIGTERM trigger; this read-only review executed no target code.

Is this the best way to solve the issue?

The production patch is the smallest complete repair: translate the existing runner-owned fact at the existing adapter boundary while retaining canonical identity and original causes.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Buffered result and rejection mapping keeps the original intent (db02a96: The canonical Execa adapter centralized bounded execution while retaining OpenClaw output, cancellation, and process-tree contracts.)
  • Cleanup classification and settlement keeps the original intent (220578b: Command completion and cleanup certainty are separate facts; unconfirmed cleanup must remain available to callers managing owned work.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

PR surface

Source +10, Tests +116. Total +126 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 12 2 +10
Tests 3 120 4 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 132 6 +126

Labels

Label changes:

  • add P2: This restores meaningful cleanup classification without evidence of an urgent outage, escaped process, or actual data loss.
  • add merge-risk: 🚨 compatibility: The plugin-exposed buffered API now populates its existing optional error field for uncertain cleanup; the maintainer-authored narrow repair preserves types, output, status, and ordinary failures.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This restores meaningful cleanup classification without evidence of an urgent outage, escaped process, or actual data loss.
  • merge-risk: 🚨 compatibility: The plugin-exposed buffered API now populates its existing optional error field for uncertain cleanup; the maintainer-authored narrow repair preserves types, output, status, and ordinary failures.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Complete the already-declared release validation, including native Windows acceptance and the broader exec/settlement suites.
  • Consolidate the duplicate controls into their existing owner-boundary tests.

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 29, 2026, 12:29 AM ET / 04:29 UTC.

@RomneyDa
RomneyDa marked this pull request as ready for review October 29, 2026 04:32
@RomneyDa RomneyDa changed the title [backport extended-stable/2026.9.33] preserve buffered cleanup uncertainty [2026.9.36] preserve buffered cleanup uncertainty Oct 29, 2026
Retain real runner and spawn exports while overriding process execution seams. Fixes the new closed-mock ratchet entries without changing assertions or baseline allowances.

Co-authored-by: RomneyDa <[email protected]>
@RomneyDa
RomneyDa merged commit 24812e4 into extended-stable/2026.9.33 Oct 29, 2026
232 checks passed
@RomneyDa
RomneyDa deleted the backport/exec-extended-20261029 branch October 29, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

3 participants