Repository navigation
fix: don't take over the host's global tracing subscriber - #813
Merged
Merged
Conversation
module_init now installs the OXC_LOG subscriber only when OXC_LOG is set, and uses try_init() so it never panics or replaces a subscriber that an embedding Node-API addon already installed. Closes #805 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TH57sBMq1RCCJVrbVkL6FC
Brooooooklyn
marked this pull request as ready for review
October 9, 2026 16:10
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Requested by Brooklyn · project thread
Before: loading the addon always installed a global tracing subscriber with
init(). When oxc-node is linked into another Node-API addon that sets up its own tracing (Vite+), it either panicked at load or became the global default and filtered the host's events throughOXC_LOG(dropping them when unset).After: the subscriber is installed only when
OXC_LOGis set, and withtry_init(), so an existing subscriber is left alone and nothing panics.OXC_LOG=debugwith@oxc-node/corelogs exactly as before; withOXC_LOGunset nothing was printed before either, since an emptyTargetsfilters everything.How:
init()returns early whenOXC_LOGis unset or doesn't parse, then callstry_init()and ignores the error. One behavior change: an unparseableOXC_LOGis now ignored instead of panicking at load.Closes #805
Tested:
cargo test,cargo clippy --all-targets --all-features -D warnings,pnpm test(all packages green), plus a manualOXC_LOG=debug node --import @oxc-node/core/registerrun.🤖 Generated with Claude Code
https://claude.ai/code/session_01TH57sBMq1RCCJVrbVkL6FC
Generated by Claude Code