fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher#100519
Conversation
|
Rebased onto latest Combined test run covering all five re-submitted stream-error fixes: Results:
Total: 49 tests passed across 4 Vitest shards in ~45s. |
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 2:07 AM ET / 06:07 UTC. Summary PR surface: Source +6, Tests +27, Other +102. Total +135 across 3 files. Reproducibility: yes. source-reproducible: current main pipes Gmail watcher stdout/stderr and only listens for data plus child process errors; the PR test/proof emit stream error events through that path. I did not execute the proof locally in this read-only review. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the narrow stream error handlers with the regression test and proof script after maintainer approval; no broader Gmail watcher refactor is needed for this failure mode. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main pipes Gmail watcher stdout/stderr and only listens for data plus child process errors; the PR test/proof emit stream error events through that path. I did not execute the proof locally in this read-only review. Is this the best way to solve the issue? Yes, this is the best narrow fix: handle the stream error at the AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 241c761d0036. Label changesLabel justifications:
Evidence reviewedPR surface: Source +6, Tests +27, Other +102. Total +135 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (5 earlier review cycles)
|
|
@clawsweeper re-review Added a real behavior proof script per the review feedback:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review All CI checks are now green:
Proof script and regression tests are included in the PR body. Ready for another look. |
|
@clawsweeper re-review Replaced the proof scripts with real behavior proofs that exercise actual production code paths and emit real stream error events (or trigger a real EISDIR filesystem error for transcripts). All proofs pass locally; PR bodies are updated with commands and output. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
3f23e71 to
a309b46
Compare
2181688 to
87b0201
Compare
1270ffa to
f1f53f2
Compare
f1f53f2 to
f49f135
Compare
|
No description provided. |
* origin/main: (1287 commits) fix(android): block loopback canvas navigation (openclaw#99874) fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher (openclaw#100519) fix(memory-core): guard qmd mcporter JSON.parse against non-JSON stdout (openclaw#98381) fix(build): fall back to tsx for build TypeScript scripts (openclaw#91262) feat(skills): suggest saving detected reusable workflows by default (openclaw#95477) (openclaw#100692) docs(changelog): remove generated release-note entries feat(telegram): offer BotFather web app flow in setup help and docs (openclaw#100540) fix(ios): unify Talk and Settings row typography on one branded detail row (openclaw#100515) feat(gateway): add persisted crash-loop breaker and fatal-config exit contract refactor(macos): lock and unify PortGuardian tunnel record persistence so concurrent app instances cannot lose orphan records (openclaw#100601) fix: stop reconnecting on protocol mismatch (openclaw#98414) fix(maint): reuse recent hosted gates after rebase (openclaw#100663) fix(ui): reopen web terminals without stale content (openclaw#100665) fix(browser): diagnose empty WSL2 Chrome replies (openclaw#100590) fix(ios): chat snaps back to bottom when scrolling to top via status-bar tap (openclaw#100502) Treat already-compacted CLI compaction as no-op (openclaw#99136) docs(changelog): remove direct main fix entry fix(feishu): strip internal tool-trace banners from outbound text (openclaw#98705) fix(message): thread --limit through to CLI formatter and surface provider pagination hints (openclaw#99089) fix(voyage): close response body stream when batch output JSONL parsing throws (openclaw#98840) ... # Conflicts: # extensions/memory-wiki/package.json
…atcher (openclaw#100519) * fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher * proof(gmail-watcher): add real behavior proof script for stream error catch * proof(gmail-watcher): replace wrapper with real stream error proof * style: apply oxfmt to changed files
…atcher (openclaw#100519) * fix(hooks): suppress unhandled stdout/stderr stream errors in gmail watcher * proof(gmail-watcher): add real behavior proof script for stream error catch * proof(gmail-watcher): replace wrapper with real stream error proof * style: apply oxfmt to changed files
Re-submission of #100414, which was closed automatically when the active PR queue was limited. The branch has been rebased onto the latest
main.What Problem This Solves
spawnGogServeattachesdatalisteners tochild.stdoutandchild.stderr, but does not attacherrorlisteners. If either stream emits anerrorevent, the unhandled error can crash the OpenClaw process even though the watcher startup itself would otherwise succeed.Why This Change Was Made
Add
errorhandlers to both stdout and stderr streams before the data handlers. The handlers log the error and continue, mirroring the existingchild.on("error", ...)logging pattern.User Impact
More robust Gmail watcher startup: transient stream read errors no longer crash the process.
Evidence
Regression test:
Real behavior proof:
The proof prepends a fake
gogbinary to PATH, starts the realstartGmailWatcher, then emits realerrorevents on the serve child's stdout and stderr streams. With the fix the watcher still starts and the errors are logged: