Repository navigation
Add shared span attachment uploads and delivery-bound blob storage - #293
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: deb1e29611
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Abhijeet Prasad (AbhiPrasad)
left a comment
There was a problem hiding this comment.
we also need to add attachment uploading in pi, codex, and claude
Add `upload_attachment` to the API client's non-generated backend operations so callers can upload files without implementing the signed-upload protocol themselves. The method requests a slot, sends bytes with only the returned storage headers, and marks the attachment ready after upload succeeds. Tests cover credential isolation and retry after a failed upload. All 12 backend operation tests and strict Clippy for the API client passed. Supports SDK-834 and braintrustdata/braintrust-coding-agent-plugins#293.
Main's #293 stored attachments in the SpanOp journal that this branch replaces, so they are ported into session storage: - The translation handoff captures inline media as attachments. Routes receive their bytes live; storage keeps one copy per digest, counted per op and deleted with the last op that references it. - Reads load each op's attachments and count their bytes toward the batch size. - Main's attachment tables are schema 7. Session storage becomes schema 8, so databases written by main upgrade through both. - Main's attachment tests use the session storage API, and a new test upgrades a schema-7 database with an attachment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coding-agent traces upload available files as Braintrust attachments and reference them from turn inputs, LLM inputs, and tool outputs. This includes Pi prompt/context/tool images, Codex inline files and image tool results, Claude prompt documents and Read images, and OpenCode files. Shared bytes are deduplicated and released when all linked routes finish delivery.
Uses the attachment upload operation merged in braintrustdata/braintrust-sdk-rust#168. Depends on braintrustdata/braintrust-sdk-rust#169 to reuse storage connections across uploads.
Repeated attachment keys skip completed uploads through a bounded cache. Failed uploads remain retryable, and configuration changes reset the cached client and keys.
Capture-boundary snapshots, removal of redundant bytes from raw journals/checkpoints, and full native format verification for Grok, Antigravity and non-image Muse assets remain unfinished.
Validation includes installed Codex 0.167.0, Claude Code 2.1.323 and Pi 1.5.2 image uploads against mock inference and ingestion, checking uploaded bytes and span references. Fixture tests exercise all three translators through durable capture and the Braintrust sink, including PDF documents, JSON tool results, late Claude transcript data, and MIME/filename preservation. OpenCode 2.0.0 compatibility and upload retry/credential isolation checks also passed locally. No real backend attachment validation has run.
Related: https://linear.app/braintrustdata/issue/SDK-834