Skip to content

fix(secrets): suppress unhandled stdout/stderr stream errors in exec resolver#100419

Closed
cxbAsDev wants to merge 1 commit into
openclaw:mainfrom
cxbAsDev:fix/secrets-resolve-stream-errors
Closed

fix(secrets): suppress unhandled stdout/stderr stream errors in exec resolver#100419
cxbAsDev wants to merge 1 commit into
openclaw:mainfrom
cxbAsDev:fix/secrets-resolve-stream-errors

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

runExecResolver attaches data listeners to child.stdout and child.stderr, but does not attach error listeners. If either stream emits an error event, the unhandled error can crash the OpenClaw process during secret resolution.

Why This Change Was Made

Add no-op error handlers to both stdout and stderr streams before the data handlers, mirroring the existing stdin error handling pattern. This prevents unhandled stream errors from propagating as uncaught exceptions.

User Impact

More robust exec-based secret resolution: transient stream read errors no longer crash the process.

Evidence

  • Added a regression test in src/secrets/resolve.test.ts that mocks spawn, emits error events on both stdout and stderr, and verifies resolveSecretRefString still resolves successfully.
  • Verified the test fails on main (times out with an unhandled Error: stdout read failed) and passes with this fix.
  • oxlint passes on the changed files.

@cxbAsDev
cxbAsDev requested a review from a team as a code owner July 5, 2026 18:35
@openclaw-barnacle openclaw-barnacle Bot added size: S r: too-many-prs Auto-close: author has more than twenty active PRs. labels Jul 5, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r: too-many-prs Auto-close: author has more than twenty active PRs. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant