Skip to content

fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher#100414

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

fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher#100414
cxbAsDev wants to merge 1 commit into
openclaw:mainfrom
cxbAsDev:fix/gmail-watcher-stream-errors

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

spawnGogServe 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 even though the watcher startup itself would otherwise succeed.

Why This Change Was Made

Add error handlers to both stdout and stderr streams before the data handlers. The handlers log the error and continue, mirroring the existing child.on("error", ...) logging pattern.

User Impact

More robust Gmail watcher startup: transient stream read errors no longer crash the process.

Evidence

  • Added a regression test in src/hooks/gmail-watcher.test.ts that mocks spawn to return a fake child with stdout/stderr EventEmitters, emits error events on both streams, and verifies startGmailWatcher still resolves successfully.
  • Verified that without this fix, the test run reports an uncaught Error: stdout read failed; with the fix, no unhandled error is reported.
  • oxlint passes on the changed files.

@openclaw-barnacle openclaw-barnacle Bot added size: XS 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: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant