Skip to content

fix(agents): handle find subprocess stream failures - #101158

Merged
steipete merged 1 commit into
mainfrom
codex/fix-find-stream-errors
Jul 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-find-stream-errors

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Related: #101020

What Problem This Solves

Fixes an issue where agent runs using the find tool could crash and leave fd running when its stdout or stderr stream failed.

The contributor PR carrying this fix was automatically closed only because its author exceeded the repository's open-PR limit. This maintainer-owned replacement preserves the contributor's authorship and reviewed implementation.

Why This Change Was Made

The fd subprocess now has one idempotent stream-failure path shared by readline, stdout, and stderr. That path stops the child, closes readline, removes abort handling through the existing settle owner, and rejects exactly once even though Node forwards an input error through both readline and the raw stream.

User Impact

The find tool now fails the individual tool call cleanly on an OS-level pipe/read failure instead of risking an agent-process crash or orphaned search process. Successful searches, cancellation, result limits, and existing fd exit handling are unchanged.

Evidence

  • Node behavior probe confirmed an input-stream failure is emitted first by readline and then by the raw stream; the settled guard keeps cleanup one-shot.
  • Focused type-aware oxlint: passed.
  • Focused oxfmt --check: passed.
  • git diff --check: passed.
  • Fresh high-reasoning autoreview: no actionable findings (correctness confidence 0.87).
  • Exact-head CI run 28818145434: passed.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 101158: passed at cf5000f1de7042a9a0aa8cc7a9344b840aeaa0f6.

AI-assisted maintainer repair. I reviewed the full find subprocess lifecycle, its registration callers, the sibling grep implementation, adjacent tests, and Node's readline error contract.

Co-authored-by: 陈宪彪0668000387 <chen.xianbiao@xydigit.com>
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at cf5000f1de7042a9a0aa8cc7a9344b840aeaa0f6.

What I reviewed and improved:

  • rebuilt the auto-closed contributor change as a focused maintainer replacement with @cxbAsDev preserved as co-author;
  • centralized stdout, stderr, and readline failures in the existing one-shot settlement owner;
  • removed the committed proof harness and corrected the test mock typing;
  • verified the caller, abort/close lifecycle, sibling grep surface, and Node readline error contract.

Evidence:

  • focused type-aware oxlint: passed;
  • focused oxfmt and git diff --check: passed;
  • Node readline/raw-stream behavior probe: passed;
  • fresh autoreview: clean, correctness confidence 0.87;
  • exact-head CI: passed, run 28818145434;
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 101158: passed at the exact head.

No known proof gaps remain for this changed-file set.

@steipete
steipete merged commit 3accc99 into main Jul 6, 2026
123 of 126 checks passed
@steipete
steipete deleted the codex/fix-find-stream-errors branch July 6, 2026 19:56
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
Co-authored-by: 陈宪彪0668000387 <chen.xianbiao@xydigit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant