Skip to content

Add structured trace command output - #12

Merged
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/trace-json-output
Aug 11, 2026
Merged

Add structured trace command output#12
Stephen Belanger (Qard) merged 1 commit into
mainfrom
agent/trace-json-output

Conversation

@Qard

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

Copy link
Copy Markdown
Collaborator

Summary

  • add shared structured output contracts for trace status, setup, and stop commands
  • render either stable JSON or the existing human-readable messages from one implementation
  • make the standalone daemon respect global --json for status, including when no daemon is running
  • expose shared status/setup/stop constructors for the bt embedding
  • wire all three real bt trace command boundaries in companion bt#287

Why

bt trace status --json previously printed human prose when the daemon was absent, while setup and stop assembled prose directly in the host. Centralizing these output shapes in bt-daemon keeps every embedding consistent and prevents JSON mode from silently producing non-JSON output.

The standalone daemon only implements status; setup and stop are host commands. The companion bt integration consumes this PR for bt trace status, bt trace setup, and bt trace stop, and tests JSON output at each actual command boundary.

Validation

  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked
  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked --test command_output
  • 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

Companion validation in bt:

  • cargo test --test cli (40 tests)
  • JSON regression coverage for absent status, idempotent stop, and OpenCode setup

Signed-off-by: Stephen Belanger <stephen.belanger@braintrustdata.com>
@Qard
Stephen Belanger (Qard) merged commit 30e4b53 into main Aug 11, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the agent/trace-json-output branch August 11, 2026 18:31
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