Skip to content

feat(api): add Agents credential and session options - #3967

Merged
markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-163
Sep 27, 2026
Merged

markstuart-oai merged 1 commit into
mainfrom
castiron/promotions/pr-163

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds credential metadata, session options and speech voices, and corrects the file download response description.

Changes

  • Add metadata to Agents vault credential creation and results; allow credential updates without replacing authentication.
  • Support the ultrafast Agents service tier and report misalignment_policy_violation for session turns.
  • Include fable, onyx and nova in speech voice options.
  • Describe file content as binary while preserving legacy retrieve_content() and its Accept header behavior.

Compatibility

When constructing beta Agents Credential models yourself, supply metadata (for example, {}). Exhaustive handlers should account for the new service tier and error code.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Mixed files: 47 → 48

1 newly customized · 0 customizations removed · 0 existing customizations changed · 2 generated baselines changed

Compared 43443d14c5ab → 9670aa55879e. Generated baselines verified.

File Result Current custom patch
src/openai/resources/audio/transcriptions.py Generated baseline changed +144 / −50
tests/api_resources/beta/agents/vaults/test_credentials.py Generated baseline changed +6 / −0
46 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/api.md
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py
  • src/openai/types/realtime/realtime_error_event.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py
  • src/openai/types/responses/tool.py

6 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 36340271400 --repo openai/openai-python \
  --name castiron-custom-code-36340271400-1 --dir /tmp/castiron-custom-code-36340271400-1
git apply --stat /tmp/castiron-custom-code-36340271400-1/custom-code.patch
cat /tmp/castiron-custom-code-36340271400-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 43443d14c5ab8b9bc9d7aaf31263351f071afca2 9670aa55879eccebc1981f8cc2ec74824ac3542a
python3 scripts/castiron/custom_code_report.py report \
  --base 43443d14c5ab8b9bc9d7aaf31263351f071afca2 \
  --head 9670aa55879eccebc1981f8cc2ec74824ac3542a --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-9670aa55879e
cat /tmp/castiron-custom-code-9670aa55879e/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@markstuart-oai
markstuart-oai marked this pull request as ready for review September 26, 2026 21:11
@markstuart-oai
markstuart-oai requested a review from a team as a code owner September 26, 2026 21:11
@openai-sdks

openai-sdks Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 9.885s for Python SDK PR #3967.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 113ms
tests/chat-completions-create.test.ts ✅ Passed 220ms
tests/chat-completions-stream.test.ts ✅ Passed 151ms
tests/files-content-binary.test.ts ✅ Passed 178ms
tests/files-create-multipart.test.ts ✅ Passed 184ms
tests/files-list-pagination.test.ts ✅ Passed 121ms
tests/initialize-config.test.ts ✅ Passed 120ms
tests/instance-isolation.test.ts ✅ Passed 146ms
tests/models-list.test.ts ✅ Passed 195ms
tests/responses-background-lifecycle.test.ts ✅ Passed 130ms
tests/responses-body-method-errors.test.ts ✅ Passed 412ms
tests/responses-cancel-timeout.test.ts ✅ Passed 217ms
tests/responses-cancel.test.ts ✅ Passed 193ms
tests/responses-compact-retries.test.ts ✅ Passed 258ms
tests/responses-compact.test.ts ✅ Passed 178ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 320ms
tests/responses-create-advanced.test.ts ✅ Passed 173ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.127s
tests/responses-create-errors.test.ts ✅ Passed 189ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 394ms
tests/responses-create-retries.test.ts ✅ Passed 182ms
tests/responses-create-stream-failures.test.ts ✅ Passed 166ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 190ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.051s
tests/responses-create-stream.test.ts ✅ Passed 133ms
tests/responses-create-terminal-states.test.ts ✅ Passed 195ms
tests/responses-create-timeout.test.ts ✅ Passed 229ms
tests/responses-create.test.ts ✅ Passed 238ms
tests/responses-delete.test.ts ✅ Passed 160ms
tests/responses-input-items-errors.test.ts ✅ Passed 423ms
tests/responses-input-items-list.test.ts ✅ Passed 280ms
tests/responses-input-items-options.test.ts ✅ Passed 229ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 294ms
tests/responses-input-tokens-count.test.ts ✅ Passed 145ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.215s
tests/responses-not-found-errors.test.ts ✅ Passed 206ms
tests/responses-parse.test.ts ✅ Passed 250ms
tests/responses-retrieve-retries.test.ts ✅ Passed 205ms
tests/responses-retrieve.test.ts ✅ Passed 153ms
tests/responses-stored-method-errors.test.ts ✅ Passed 506ms
tests/retry-behavior.test.ts ✅ Passed 3.155s
tests/sdk-error-shape.test.ts ✅ Passed 316ms

View OkTest run #36340247283

SDK merge (91893f7ab57e) · head (9670aa55879e) · base (43443d14c5ab) · OkTest (f9111d4e2fcd)

@markstuart-oai
markstuart-oai deleted the castiron/promotions/pr-163 branch September 26, 2026 21:29
@markstuart-oai markstuart-oai changed the title feat(api): add Agents credential and session options Closed Sep 26, 2026
@openai openai locked and limited conversation to collaborators Sep 26, 2026
@markstuart-oai
markstuart-oai restored the castiron/promotions/pr-163 branch September 26, 2026 23:22
@markstuart-oai markstuart-oai changed the title Closed feat(api): add Agents credential and session options Sep 26, 2026
@openai openai unlocked this conversation Sep 26, 2026

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes on f896f93d6e337050dfe6d9439562efd7bf38b2bd for one credential-update schema/test contract regression.

Making auth optional is necessary for metadata-only updates, but the generated schema now also accepts an empty update. The new sync/async minimum-parameter, raw-response and streaming-response tests all exercise that invalid empty case as a success. Please restore the at-least-one-field constraint in the authoritative generation input and regenerate valid fixtures, preserving metadata={} as the clear operation. This is a schema/mock-test fidelity issue, not a request to add ad hoc client-side validation.

Validation: reviewed all 21 changed files and the complete parsed schema delta; compiled all 19 changed Python files in memory; verified the transformed-spec hash and all 4,647 local schema references. Twelve positive/negative schema cases pass with an outer minProperties: 1 constraint, including auth-only, metadata-only and metadata clearing. Current-head hosted Python 3.10/3.14, HTTPX2, lint, build, baseline and budget checks are passing. I did not run the full local SDK suite or make live API requests. No additional actionable findings.

Comment thread api_reference/openapi.transformed.yml
@markstuart-oai
markstuart-oai force-pushed the castiron/promotions/pr-163 branch from f896f93 to af8f653 Compare September 27, 2026 18:03
Castiron-Internal-PR: openai/openai-python-internal#163
Castiron-Source-SHA: ac9b80498b71e8e72070ac7ca59f3cf4300f0f7a
Castiron-Public-Base-SHA: 43443d1
@markstuart-oai
markstuart-oai force-pushed the castiron/promotions/pr-163 branch from af8f653 to 9670aa5 Compare September 27, 2026 18:19

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed at 9670aa5. The credential-update blocker from my earlier review is fixed: the bundled schema requires a request body and at least one outer property, while metadata: {} remains valid for clearing metadata. The sync/async normal, raw-response, and streaming-response success fixtures now send that valid body.

I also checked the remaining generated metadata/enums/voice/documentation changes and the shared schema corrections. Thirteen in-memory positive/negative JSON Schema cases passed, all 4,647 local schema references resolve, and all 20 changed Python files compile in memory. Exact-head Python 3.10/3.14, HTTPX2, lint/build, and Castiron checks are green. I did not run the full SDK suite locally or call a live API.

No remaining blocking findings; this approval supersedes my earlier changes-requested review.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit bb68198 Sep 27, 2026
26 checks passed
@markstuart-oai
markstuart-oai deleted the castiron/promotions/pr-163 branch September 27, 2026 19:16
@openai-sdks openai-sdks Bot mentioned this pull request Sep 27, 2026
pull Bot pushed a commit to pdibenedetto/openai-python that referenced this pull request Sep 28, 2026
Automated Release PR
---


##
[3.20.0](openai/openai-python@v3.19.2...v3.20.0)
(2026-09-28)


### Features

* **api:** add Agents credential and session options
([openai#3967](openai#3967))
([bb68198](openai@bb68198))
* **api:** add Cyber access programs to Responses
([openai#3956](openai#3956))
([09c5b6f](openai@09c5b6f))
* **responses:** opt in to incremental WebSocket text and tool snapshots
([openai#3973](openai#3973))
([d0207b4](openai@d0207b4))
* **responses:** preserve detailed WebSocket accumulator snapshots
([openai#3981](openai#3981))
([a380cf2](openai@a380cf2))


### Bug Fixes

* **client:** retry unmapped TLS transport errors
([openai#3982](openai#3982))
([0d35a26](openai@0d35a26))
* **live:** avoid hangs at fractional transcript grouping deadlines
([openai#3970](openai#3970))
([4ef4129](openai@4ef4129))
* **live:** keep query parameters out of WebSocket endpoint paths
([openai#3972](openai#3972))
([f9c458b](openai@f9c458b))
* **live:** preserve caller queues and prevent uncertain WebSocket
replay ([openai#3980](openai#3980))
([80e9686](openai@80e9686))
* **realtime:** preserve base URL queries in WebSocket upgrades
([openai#3971](openai#3971))
([f7bd4a7](openai@f7bd4a7))
* **realtime:** retain configured queues without replaying attempted
sends ([openai#3978](openai#3978))
([a52805c](openai@a52805c))


### Chores

* **api:** clarify documented API error responses
([openai#3965](openai#3965))
([384fee3](openai@384fee3))
* **api:** document batch error responses
([openai#3961](openai#3961))
([6e4a79c](openai@6e4a79c))
* **api:** document files and uploads error responses
([openai#3960](openai#3960))
([a9d727f](openai@a9d727f))
* **api:** document fine-tuning and model errors
([openai#3964](openai#3964))
([5d4003c](openai@5d4003c))
* **api:** document Responses not-found errors
([openai#3959](openai#3959))
([63099e7](openai@63099e7))
* **api:** document stored chat completion errors
([openai#3963](openai#3963))
([a73fe0c](openai@a73fe0c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.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