Skip to content

Support bulk transcript imports - #13

Merged
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/multi-session-import
Aug 14, 2026
Merged

Support bulk transcript imports#13
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/multi-session-import

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • accept any number of positional session IDs for transcript import
  • add --all to discover and import every valid local parent session for the selected agent
  • automatically discover and replay subagent transcripts beneath each selected parent
  • split native transcript importing into dedicated Claude and Codex source modules
  • move destination selection to unambiguous --destination <DESTINATION> syntax
  • keep --attach limited to exactly one explicit session
  • process completed bulk imports through one importer while isolating translator and sink state per parent session

Behavior

bt trace import codex SESSION_A SESSION_B
bt trace import claude --all
bt trace import codex SESSION_A --destination project_logs:PROJECT_ID

Explicit multiple IDs let users select a safe subset rather than importing every local session. --all validates native transcript identity, skips symlinks, ignores unrelated JSONL, reports duplicate parent transcripts, and imports sessions in stable order.

Subagent transcripts are related content rather than independent top-level selections. Selecting a Claude or Codex parent explicitly, or through --all, discovers its subagent transcripts and replays them through the existing subagent lifecycle so their task, LLM, and tool spans remain in the parent's trace under the spawning turn. Codex subagent rollouts are excluded from the independent --all session list, preventing duplicate root traces.

transcript_import/claude.rs and transcript_import/codex.rs now own each source's native roots, identity and filename rules, event synthesis, subagent discovery, and incremental tailing. The shared module is limited to selection orchestration, safe JSONL reading, dispatch, and format-independent helpers, matching the existing translator organization.

Because session IDs are variadic, destination can no longer remain an optional trailing positional without ambiguity. This CLI has not been released, so the PR establishes --destination before compatibility constraints exist.

Validation

  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked
  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked transcript_import::tests
  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked --test replay
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --all-features --all-targets --locked -- -D warnings
  • cargo fmt --manifest-path bt-daemon/Cargo.toml -- --check
  • git diff --check

The bt embedding will need to update its import argument access and pin this daemon revision after merge.

Signed-off-by: Stephen Belanger <stephen.belanger@braintrustdata.com>
@Qard
Stephen Belanger (Qard) merged commit 2bb3baf into main Aug 14, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the agent/multi-session-import branch August 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants