Skip to content

Own trace command runtime in plugin repository - #20

Merged
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/own-trace-setup-commands
Aug 12, 2026
Merged

Own trace command runtime in plugin repository#20
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/own-trace-setup-commands

Conversation

@Qard

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

Copy link
Copy Markdown
Collaborator

Summary

  • export the complete bt trace Clap command tree and runtime from bt-daemon
  • own dispatch for setup, daemon, hook, status, stop, import, and managed run in the plugin repository
  • expose a narrow host-service interface for Braintrust credential leases and destination selection
  • keep Codex, Claude Code, OpenCode, and Pi installation and settings reconciliation beside their integrations
  • refresh published marketplaces and installed plugins on repeated setup, replacing stale same-name local marketplaces

Ownership boundary

The plugin repository now owns the entire coding-agent trace namespace after the host mounts it. It derives internal daemon and hook invocations from the mount prefix supplied by the host, preserves fail-open hook behavior, initializes the daemon, resolves command-specific routing requirements, and renders shared command results.

Embedding CLIs do not interpret trace subcommands. They supply only a version/output context, the mounted command prefix, and host services that resolve Braintrust credentials and destination choices. Credentials remain outside plugin settings, journals, and command arguments.

This fixes repeated setup accepting stale local marketplace installations such as trace-codex 0.2.0, while placing the fix and all other coding-agent command responsibilities in their source-of-truth repository.

Validation

  • cargo fmt --manifest-path bt-daemon/Cargo.toml --all --check
  • cargo test --manifest-path bt-daemon/Cargo.toml --locked --all-features (97 passed, 4 live-agent tests ignored)
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --locked --all-targets --all-features -- -D warnings
  • isolated Claude marketplace install/update smoke test reached trace-claude-code 2.0.1
  • isolated stale Claude directory marketplace removal confirmed its installed plugin is removed before replacement
  • git diff --check

@Qard
Stephen Belanger (Qard) force-pushed the agent/own-trace-setup-commands branch from 3d114a2 to b6441c5 Compare August 12, 2026 20:27
@Qard Stephen Belanger (Qard) changed the title Move trace setup commands into plugin runtime Own trace command runtime in plugin repository Aug 12, 2026
@Qard
Stephen Belanger (Qard) marked this pull request as ready for review August 12, 2026 20:42
@Qard
Stephen Belanger (Qard) merged commit fdc3c14 into main Aug 12, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the agent/own-trace-setup-commands branch August 12, 2026 20:54
Stephen Belanger (Qard) added a commit to braintrustdata/bt that referenced this pull request Aug 12, 2026
## Summary

- pin the plugin runtime from `braintrust-coding-agent-plugins#20`
- mount the exported `bt_daemon::TraceArgs` tree under the top-level `bt
trace` namespace
- delete `src/agents.rs` and delegate the complete trace command to
`bt_daemon::run_trace`
- retain only a small host adapter for Braintrust credential leases and
destination selection

## Ownership boundary

`bt` no longer matches or interprets any coding-agent trace subcommand.
It hands the parsed trace command to the plugin runtime with the current
executable mount prefix and an implementation of the host-service
interface.

The plugin repository owns setup, daemon lifecycle, hooks, status, stop,
imports, managed runs, output rendering, agent package identities,
marketplace behavior, and settings reconciliation. `bt` continues to own
its profile store, OAuth/API-key handling, project picker, and top-level
Clap mount.

This PR depends on `braintrustdata/braintrust-coding-agent-plugins#20`
and pins its exact commit.

## Validation

- `cargo fmt --all --check`
- `cargo check --locked`
- `cargo test --locked --test cli trace_` (13 passed)
- `cargo test --locked --quiet -- --test-threads=1` (803 passed)
- `cargo clippy --locked --all-targets --all-features -- -D warnings -A
clippy::collapsible_match`
- `git diff --check`

Strict Clippy without the targeted allowance remains blocked by 12
existing `collapsible_match` findings in unrelated files.
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