Skip to content

Add shared span attachment uploads and delivery-bound blob storage - #293

Merged
Stephen Belanger (Qard) merged 7 commits into
mainfrom
feat/implement-sdk-834
Nov 17, 2026
Merged

Stephen Belanger (Qard) merged 7 commits into
mainfrom
feat/implement-sdk-834

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T19:03:47.385649Z deb1e29 Draft marked ready
ℹ️ About Codex in GitHub

Your 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread bt-daemon/src/translate/opencode.rs Resolved
Comment thread bt-daemon/src/attachments.rs Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also need to add attachment uploading in pi, codex, and claude

Comment thread bt-daemon/src/sink/braintrust.rs Resolved
Stephen Belanger (Qard) added a commit to braintrustdata/braintrust-sdk-rust that referenced this pull request Nov 17, 2026
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.
@Qard
Stephen Belanger (Qard) merged commit 15ea15e into main Nov 17, 2026
29 checks passed
@Qard
Stephen Belanger (Qard) deleted the feat/implement-sdk-834 branch November 17, 2026 12:23
Stephen Belanger (Qard) added a commit that referenced this pull request Nov 17, 2026
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>
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.

3 participants