Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 56 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Set up pinned pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 10.33.0
- name: Build and validate plugins
run: make test

Expand Down Expand Up @@ -76,6 +80,46 @@ jobs:
node -e 'import(process.argv[1]).then((m) => { if (typeof m.default !== "function") process.exit(1) })' \
"$PWD/install-test/node_modules/@braintrust/trace-opencode/dist/index.js"

resolve-pi-compatibility:
name: Resolve Pi compatibility window
runs-on: ubuntu-24.04
timeout-minutes: 10
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- id: versions
name: Resolve latest patch from five Pi minor lines
env:
PI_VERSION_COUNT: 5
run: node src/plugins/pi/content/scripts/resolve-pi-versions.mjs

pi-compatibility:
name: Pi package (${{ matrix.pi-target.version }})
needs: resolve-pi-compatibility
strategy:
fail-fast: false
matrix:
pi-target: ${{ fromJson(needs.resolve-pi-compatibility.outputs.versions) }}
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up pinned pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 10.33.0
- name: Build validated Pi tarball
run: make validate-pi
- name: Test resolved Pi compatibility target
run: |
mkdir pi-install-test
pnpm --dir pi-install-test add --lockfile=false \
"$PWD"/dist/pi/braintrust-pi-extension-*.tgz \
'${{ matrix.pi-target.piCodingAgentSpec }}'
node -e 'import(process.argv[1]).then((m) => { if (typeof m.default !== "function") process.exit(1) })' \
"$PWD/pi-install-test/node_modules/@braintrust/pi-extension/dist/index.mjs"

daemon:
name: Daemon (${{ matrix.os }})
strategy:
Expand All @@ -98,18 +142,27 @@ jobs:
rustup default stable
rustup component add clippy rustfmt
- name: Install latest coding agents
run: npm install --prefix "${{ runner.temp }}/coding-agents" --no-save --no-package-lock --no-audit --no-fund --cache "${{ runner.temp }}/npm-cache" @openai/codex@latest @anthropic-ai/claude-code@latest opencode-ai@latest
run: npm install --prefix "${{ runner.temp }}/coding-agents" --no-save --no-package-lock --no-audit --no-fund --cache "${{ runner.temp }}/npm-cache" @openai/codex@latest @anthropic-ai/claude-code@latest opencode-ai@latest @earendil-works/pi-coding-agent@latest
- name: Set up pinned Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Set up pinned pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 10.33.0
- name: Build OpenCode plugin for integration harness
run: make build-opencode
- name: Build Pi extension for integration harness
run: make build-pi
- name: Install built Pi extension for integration harness
run: npm install --prefix "${{ runner.temp }}/pi-extension" --no-save --no-package-lock --no-audit --no-fund ./dist/pi/braintrust-pi-extension-*.tgz
- name: Report coding-agent versions
run: |
npm exec --prefix "${{ runner.temp }}/coding-agents" -- codex --version
npm exec --prefix "${{ runner.temp }}/coding-agents" -- claude --version
npm exec --prefix "${{ runner.temp }}/coding-agents" -- opencode --version
npm exec --prefix "${{ runner.temp }}/coding-agents" -- pi --version
- name: Check formatting
if: runner.os == 'Linux'
run: cargo fmt --manifest-path bt-daemon/Cargo.toml -- --check
Expand All @@ -124,6 +177,8 @@ jobs:
CODEX_BIN: ${{ runner.temp }}/coding-agents/node_modules/.bin/codex${{ matrix.agent_suffix }}
CLAUDE_BIN: ${{ runner.temp }}/coding-agents/node_modules/.bin/claude${{ matrix.agent_suffix }}
OPENCODE_BIN: ${{ runner.temp }}/coding-agents/node_modules/.bin/opencode${{ matrix.agent_suffix }}
PI_BIN: ${{ runner.temp }}/coding-agents/node_modules/.bin/pi${{ matrix.agent_suffix }}
PI_EXTENSION_PATH: ${{ runner.temp }}/pi-extension/node_modules/@braintrust/pi-extension/dist/index.mjs
run: cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked --test agent_integration -- --ignored --nocapture --test-threads=1
- name: Lint daemon
run: cargo clippy --manifest-path bt-daemon/Cargo.toml --all-targets --all-features --locked -- -D warnings
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ For further instructions, see the instructions for your desired coding agent
| Claude Code | [braintrustdata/braintrust-claude-plugin](https://github.com/braintrustdata/braintrust-claude-plugin) |
| Codex | [braintrustdata/braintrust-codex-plugin](https://github.com/braintrustdata/braintrust-codex-plugin) |
| OpenCode | npm: [`@braintrust/trace-opencode`](https://www.npmjs.com/package/@braintrust/trace-opencode) |
| Pi | npm: [`@braintrust/pi-extension`](https://www.npmjs.com/package/@braintrust/pi-extension) |

## Development & releasing

Expand Down
2 changes: 1 addition & 1 deletion bt-daemon/docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Result:
{
"protocol_version": 1,
"daemon_version": "0.1.0",
"capabilities": { "sources": ["codex", "claude-code", "opencode", "debug"] }
"capabilities": { "sources": ["codex", "claude-code", "opencode", "pi", "debug"] }
}
```
If `protocol_version` is incompatible the daemon returns an application error;
Expand Down
5 changes: 4 additions & 1 deletion bt-daemon/src/translate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ mod codex;
mod debug;
mod git;
mod opencode;
mod pi;

pub use claude::ClaudeTranslatorFactory;
pub use codex::CodexTranslatorFactory;
pub use debug::DebugTranslatorFactory;
pub use opencode::OpenCodeTranslatorFactory;
pub use pi::PiTranslatorFactory;

use crate::wire::{Envelope, SessionConfig};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -125,7 +127,8 @@ impl Registry {
let git = Arc::new(git::GitMetadataCache::default());
r.register(Box::new(ClaudeTranslatorFactory::new(git.clone())));
r.register(Box::new(CodexTranslatorFactory::new(git.clone())));
r.register(Box::new(OpenCodeTranslatorFactory::new(git)));
r.register(Box::new(OpenCodeTranslatorFactory::new(git.clone())));
r.register(Box::new(PiTranslatorFactory::new(git)));
r
}

Expand Down
Loading
Loading