Repository navigation
Route SDK requests through the API client - #161
Open
Stephen Belanger (Qard) wants to merge 5 commits into
Open
Stephen Belanger (Qard) wants to merge 5 commits into
Stephen Belanger (Qard) wants to merge 5 commits into
Conversation
Stephen Belanger (Qard)
force-pushed
the
refactor/sdk-api-transport
branch
from
October 30, 2026 15:29
528b0db to
b52eff6
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/sdk-api-transport
branch
6 times, most recently
from
October 30, 2026 17:43
9da810b to
5faeb89
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/sdk-api-transport
branch
from
October 30, 2026 17:55
5faeb89 to
fd589c5
Compare
Stephen Belanger (Qard)
requested review from
Abhijeet Prasad (AbhiPrasad) and
Andrew Kent (realark)
October 30, 2026 19:23
Stephen Belanger (Qard)
marked this pull request as ready for review
October 30, 2026 19:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #160.
Routes SDK HTTP requests through the API client, covering login, registration, queries, summaries, logging, and storage uploads while removing duplicate upload code. Resource calls honor the endpoint discovered at login; experiment comparisons use the API host.
Per-request credentials, custom certificates and User-Agent settings, background delivery, and retries remain supported. Organization headers retain their previous scope: version checks, logs3 submissions, and standalone uploader overflow requests. Login, resource operations, queries, summaries, queued overflow requests, and signed storage uploads omit them.
Compatibility: the main crate's 108 compiled exports and stable public signatures are unchanged. Runtime differences to review: uploader constructors reject invalid keys earlier, and some transport failures now return BraintrustError::Http instead of Network. Ordinary call sites need no edits; callers matching exact error variants or relying on deferred validation may need adjustment.
Parity audit restores overflow payload sizes, preserves HTTP status through body/decoding failures so retry decisions stay correct, and retains failed-payload debug files on early configuration errors. API client fixes are included in #160.
Validation: full workspace tests, strict Clippy on Rust 1.99.1, Rust 1.88 checks, formatting, and compiled API comparison pass. All 108 main-crate exports and their stable signatures/traits match the pre-migration snapshot. Regressions cover endpoint selection, pagination, organization headers, custom TLS, overflow sizes and staged retries, malformed responses, and payload diagnostics. New parity tests were verified to fail before their fixes.
Automatic CI currently targets main, so this stacked draft relies on local checks until retargeted or the workflow base filter is expanded.