Uh oh!
There was an error while loading. Please reload this page.
Deduplicate managed JavaScript tracing adapters - #41
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:0c293afe7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What this changes
A managed OpenCode or Pi process can load both its persistently installed Braintrust adapter and the adapter injected by
bt trace run. Before this change, both instances could forward the same native events and create duplicate trace operations.This PR gives the shared JavaScript daemon client one managed-instance claim keyed by agent source and managed-run ID. OpenCode and Pi use that common claim, so exactly one forwarding adapter remains active inside a managed process while ordinary plugin instances remain unaffected.
For OpenCode, managed runs now inject a dedicated
@braintrust/trace-opencode/tracingexport. It registers only tracing hooks, leaving the package root responsible for optional Braintrust data tools. Both entrypoints share config loading and tracing registration.This is intentionally limited to invocation-local adapter injection and duplicate-capture suppression. It does not change translator lifecycle, daemon session identity, transcript import, or persistent setup.
Validation
make testcargo test --manifest-path bt-daemon/Cargo.toml --all-featurescargo clippy --manifest-path bt-daemon/Cargo.toml --all-targets --all-features -- -D warningsgit diff --checkReal-agent tests remain ignored by the default Rust suite; deterministic adapter tests cover installed-plus-injected deduplication directly.