Skip to content

node:worker_threads: rebind console output sink instead of replacing the global console - #34347

Closed
robobun wants to merge 6 commits into
mainfrom
claude/b711c0ca/worker-console-sink
Closed

node:worker_threads: rebind console output sink instead of replacing the global console#34347
robobun wants to merge 6 commits into
mainfrom
claude/b711c0ca/worker-console-sink

route console.timeEnd/timeLog through the output stream override; fix…

5348bde
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 16, 2026 in 22m 53s

Code review found 3 potential issues

Found 2 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/ConsoleObject.rs:526-537 console.trace() output routed to worker.stdout instead of worker.stderr

Annotations

Check warning on line 537 in src/jsc/ConsoleObject.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

console.trace() output routed to worker.stdout instead of worker.stderr

`console.trace()` in a `node:worker_threads` worker now lands on `worker.stdout` instead of `worker.stderr`: `use_stderr` is false for `(MessageType::Trace, MessageLevel::Log)`, so `override_for(false)` picks `stdout_override`. Pre-PR (and Node.js), the swapped-in `node:console`'s `trace()` did `this.error(err.stack)` → `worker.stderr`, so consumers reading `worker.stderr` for trace output now find nothing there. This does align workers with main-thread Bun's `console.trace` (which already write