Skip to content

chore(api): update pinned OpenAPI spec - #809

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
auto/update-openapi-spec
Sep 28, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
auto/update-openapi-spec

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated update of the pinned Braintrust OpenAPI specification.

  • Upstream commit: d1f9de36c2fa → 128468e1d349
  • Upstream spec diff
  • Reviewed generated surface: 149 selected operations, 234 reachable schemas → 149 selected operations, 235 reachable schemas
  • All upstream operations: 234 → 234
  • All upstream component schemas: 254 → 255

Operation changes

  • No names added or removed.

Component schema changes

  • Added: ChatCompletionContentPartInputAudioWithTitle

Automated validation

The update workflow regenerates committed sources and public API reference sections, then runs:

  • make -C py test-api-codegen
  • make -C py test-core
  • cd py && nox -s test_types

This 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

Check Result
Regeneration success
Codegen tests success
Runtime tests success
Type tests success

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T18:52:36.122819Z da91d74 New commits
ℹ️ 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.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 599a375 into main Sep 28, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the auto/update-openapi-spec branch September 28, 2026 18:57
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