feat: support capture stderr when 'Worker exited unexpectedly' error#949
Closed
feat: support capture stderr when 'Worker exited unexpectedly' error#949
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to capture stderr output from worker processes and attach it to "Worker exited unexpectedly" errors, improving debugging experience when workers crash unexpectedly.
Changes:
- Adds stderr capture mechanism that intercepts
process.stderr.writeto collect recent stderr output - Prefixes worker stderr with
[Worker:stderr]tag for identification - Integrates stderr capture into the pool error handling to enhance worker crash errors
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/core/src/pool/stderrCapture.ts | New file implementing stderr capture with EventEmitter-based communication and error enhancement logic |
| packages/core/src/runtime/worker/setup.ts | Adds stderr interception in worker processes to prefix output with [Worker:stderr] tag |
| packages/core/src/reporter/windowedRenderer.ts | Integrates with stderr capture by emitting events when error stream data is intercepted |
| packages/core/src/pool/index.ts | Integrates stderr capture into pool creation, enhances worker errors, and ensures cleanup on close |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fi3ework
reviewed
Feb 6, 2026
Collaborator
Author
There was a problem hiding this comment.
tinypool pipes the child process stderr directly to the parent process, so we need some extra handling here. 😢
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Captures related stderr output from child processes so that it can be attached to "Worker exited unexpectedly" errors.
Related Links
Checklist