chore(api): update pinned OpenAPI spec - #809
Merged
Merged
Conversation
Abhijeet Prasad (AbhiPrasad)
approved these changes
Sep 28, 2026
Abhijeet Prasad (AbhiPrasad)
enabled auto-merge (squash)
September 28, 2026 15:26
Merged
7 tasks
Abhijeet Prasad (AbhiPrasad)
added a commit
that referenced
this pull request
Sep 28, 2026
…tlp-proto-http 1.45 (#811) ## Summary `opentelemetry-exporter-otlp-proto-http` 1.45.0 (released 2026-09-25) moved the exporter's request headers off `_headers` / `_session` and onto an internal HTTP client. When `OtelExporter` resolved the Braintrust API key after construction, for example from `.env.braintrust` or an env var set later, it wrote the `Authorization` header to attributes the exporter no longer reads. **Spans were exported without authentication.** The key-at-construction path still worked. `test_otel` installs otel unpinned, so it started failing in CI on every PR (e.g. #809, shard 2 on all Pythons and OSes). ### 1. Fix - **What changed:** `OtelExporter` stores the kwargs it passes to `OTLPSpanExporter.__init__`. When the key is resolved lazily, it re-runs that public constructor with the `Authorization` header added, instead of writing into private upstream state. The constructor is the only public way to set headers across 1.16–1.45. - **Shutdown guard:** `OtelExporter.shutdown()` now records the shutdown, so resolving a key can't revive an exporter that was already shut down. Re-running the constructor resets upstream's shutdown flag. - **Unchanged:** a user-supplied `Authorization` header still takes precedence, and `.env.braintrust` is still only read on first export. ### 2. Tests - **Wire-level assertions:** header tests that asserted on `exporter._headers` now export a span to a local OTLP collector (the shared `braintrust.api._test_server.scripted_server`) and assert on the headers it receives. The old `.env.braintrust` test passed on 1.45 while no header was actually sent. - **New tests:** a key resolved after construction is sent on every export; a lazy key doesn't override an explicit `Authorization` header; resolving a key doesn't revive a shut-down exporter. ### 3. OpenTelemetry nox matrix - **Versions:** `test_otel` is now parametrized over `latest` (1.45.0), 1.44.0 (the last version before the change) and 1.16.0, pinned in `[tool.braintrust.matrix]` as separate `opentelemetry-api` / `-sdk` / `-exporter-otlp-proto-http` tables. They are kept separate because older exporters pin the SDK only loosely, e.g. 1.12.0 accepts `opentelemetry-sdk~=1.11`. - **Why 1.16.0:** it's the oldest release that imports without `pkg_resources`. - **Python 3.14:** versions below 1.28 require `protobuf<5`, which crashes on 3.14, so `test_otel` skips them there. 1.44.0 still covers the pre-1.45 layout on 3.14. - **Other files:** `session-weights.json` gets the parametrized session names. - **Dependency updates:** the weekly `update-matrix-latest.py` will bump these pins. It classifies them as provider packages, so otel bumps are labeled `needs-cassette-rerecord` for human review and are not auto-merged. ## Test plan - [x] Red: before the fix, on 1.45.0 the two lazy-key tests fail and all other tests pass. On 1.44.0 everything passes. - [x] Red: the shutdown test fails with the re-init change until the shutdown guard is added. - [x] Green: `nox -s "test_otel(latest)"`, `"test_otel(1.44.0)"` and `"test_otel(1.16.0)"` pass on Python 3.10 and 3.13. On 3.14, `latest` and 1.44.0 pass and 1.16.0 is skipped. - [x] `test_otel_not_installed` passes. The `src/braintrust/otel/` tests (which CI only runs without otel installed) pass on every matrix version. - [x] End to end: an exporter created without a key, with the key set before the first export, sends `Authorization: Bearer …` to a local HTTP server on 1.16.0, 1.44.0 and 1.45.0. Before the fix, 1.45.0 sent no `Authorization` header. - [x] `pre-commit` and `nox -s pylint` - [ ] Windows: covered by CI only ## Notes - Once this merges, #809 should pass on a re-run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- sfk:bot-coauthor --> Co-authored by @starfolkai[bot] --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis 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. |
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.
Automated update of the pinned Braintrust OpenAPI specification.
d1f9de36c2fa→128468e1d349Operation changes
Component schema changes
ChatCompletionContentPartInputAudioWithTitleAutomated validation
The update workflow regenerates committed sources and public API reference sections, then runs:
make -C py test-api-codegenmake -C py test-corecd py && nox -s test_typesThis pull request is never auto-merged. Review the upstream and generated diffs, retry-policy classifications, public type changes, and any intentionally unsupported tags before merging.
Workflow results
successsuccesssuccesssuccess