Skip to content

Route SDK requests through the API client - #161

Open
Stephen Belanger (Qard) wants to merge 5 commits into
t3/research-openapi-client-generationfrom
refactor/sdk-api-transport
Open

Stephen Belanger (Qard) wants to merge 5 commits into
t3/research-openapi-client-generationfrom
refactor/sdk-api-transport

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.

1 participant