Add typed trace destinations for session imports - #5
Merged
Conversation
Stephen Belanger (Qard)
force-pushed
the
agent/trace-import-destinations
branch
from
August 4, 2026 15:40
85816df to
26aa3b8
Compare
Stephen Belanger (Qard)
changed the base branch from
agent/git-metadata-all-spans
to
main
August 4, 2026 15:40
Stephen Belanger (Qard)
requested review from
Abhijeet Prasad (AbhiPrasad) and
Andrew Kent (realark)
and
a lite review from Copilot
August 4, 2026 16:46
There was a problem hiding this comment.
Pull request overview
Adds a typed destination field to the bt-daemon wire SessionConfig so session imports (and other front-ends) can route traces explicitly to project logs, an experiment, or under an exported parent span, while keeping legacy routing fields as a fallback.
Changes:
- Introduce
TraceDestinationin the wire contract and plumb it through redaction/journaling. - Update translators + Braintrust sink routing so exported-parent destinations preserve object routing, external roots, and propagated events.
- Extend tests/docs to validate typed destinations and precedence over legacy metadata.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bt-daemon/tests/pipeline.rs | Updates SessionConfig literals for the new destination field. |
| bt-daemon/tests/codex_translator.rs | Updates configured test context to include destination. |
| bt-daemon/tests/braintrust_sink.rs | Adds coverage for exported-parent propagation and typed experiment routing precedence. |
| bt-daemon/src/wire/mod.rs | Re-exports TraceDestination from the wire module. |
| bt-daemon/src/wire/envelope.rs | Adds SessionConfig.destination, defines TraceDestination, implements parsing + attached-span helpers, includes in redaction. |
| bt-daemon/src/translate/codex.rs | Shapes emitted root rows to attach under an external parent span when provided. |
| bt-daemon/src/translate/claude.rs | Uses typed destination-derived parent/root ids via attached_span_ids(). |
| bt-daemon/src/sink/braintrust.rs | Implements typed destination routing (project logs / experiment / parent span), including propagated event handling. |
| bt-daemon/src/main.rs | Updates standalone CLI config construction to include destination: None. |
| bt-daemon/src/lib.rs | Extends import CLI args with typed destination / --parent and applies them to session config. |
| bt-daemon/src/journal.rs | Restores destination when reconstructing config from redacted journal entries. |
| bt-daemon/docs/protocol.md | Documents the new destination field and import CLI syntax. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Abhijeet Prasad (AbhiPrasad)
approved these changes
Aug 4, 2026
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
project_logs:<project-id>,experiment:<experiment-id>, or--parent <SpanComponents>on importsCovers SDK-130.
Validation
cargo test --manifest-path bt-daemon/Cargo.toml --all-features --lockedcargo clippy --manifest-path bt-daemon/Cargo.toml --all-targets --all-features --locked -- -D warnings