Skip to content

feat(api): support Decisions in Live sessions - #4088

Merged
yoni-oai merged 1 commit into
mainfrom
castiron/promotions/pr-263
Oct 16, 2026
Merged

yoni-oai merged 1 commit into
mainfrom
castiron/promotions/pr-263

Conversation

@yoni-oai

Copy link
Copy Markdown
Contributor

Summary

Adds typed Python parameters for Live Decisions and typed events for their results and input acknowledgments.

Changes

  • Set delegation.type to decisions with a model and questions. To request a Decision explicitly, send decision.create with an event_id unique within the session.
  • Configure input and output transcript triggers independently, including with client or Responses delegation. On update, omit triggers to keep them or send [] to clear them.
  • Send text or inline images with decision.item.create, remove an item with decision.item.delete, and handle decision.item.created and decision.item.deleted.
  • Read the model, ordered answers (predicate, choice, score, or refusal), and token usage at event.decision in a decision.event.
  • Match a result to its delegation or transcript delta using the required, nullable delegation_id, trigger_id, source_event_type, and source_event_id fields.

@yoni-oai
yoni-oai marked this pull request as ready for review October 16, 2026 02:07
@yoni-oai
yoni-oai requested a review from a team as a code owner October 16, 2026 02:07
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 325da45934ddb1c1b6a0bed1681a8cf46c9a8712.

Trusted main policy: 325da45934ddb1c1b6a0bed1681a8cf46c9a8712.

✅ No new custom-code files detected.

36 mixed files remain; 0 existing customizations changed; 3 generated baselines changed.

Compared 325da45934dd → c6c2aeaff513. Generated baselines verified.

File Result Current custom patch
src/openai/resources/live/forks.py Generated baseline changed +15 / −18
src/openai/resources/live/live.py Generated baseline changed +11 / −6
src/openai/resources/live/sideband.py Generated baseline changed +15 / −18
33 existing customizations unchanged
  • api.md
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/environments/files.py
  • src/openai/resources/beta/agents/sessions/artifacts.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/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/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/tool.py
  • src/openai/types/responses/tool_param.py
  • src/openai/types/webhooks/init.py
  • src/openai/types/webhooks/live_call_incoming_webhook_event.py
  • src/openai/types/webhooks/unwrap_webhook_event.py
  • tests/api_resources/test_videos.py

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 38842589702 --repo openai/openai-python \
  --name castiron-custom-code-38842589702-1 --dir /tmp/castiron-custom-code-38842589702-1
git apply --stat /tmp/castiron-custom-code-38842589702-1/custom-code.patch
cat /tmp/castiron-custom-code-38842589702-1/custom-code.patch

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

git fetch --no-tags origin 325da45934ddb1c1b6a0bed1681a8cf46c9a8712 c6c2aeaff513f8b465fd2e5b8becc88b75b07eda
python3 scripts/castiron/custom_code_report.py report \
  --base 325da45934ddb1c1b6a0bed1681a8cf46c9a8712 \
  --head c6c2aeaff513f8b465fd2e5b8becc88b75b07eda --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-c6c2aeaff513
cat /tmp/castiron-custom-code-c6c2aeaff513/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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T02:54:32.715463Z c6c2aea New commits
🔒 Security Review ✅ Completed 2026-10-16T02:56:12.178785Z c6c2aea New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openai-sdks

openai-sdks Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 9.104s for Python SDK PR #4088.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 193ms
tests/chat-completions-create.test.ts ✅ Passed 252ms
tests/chat-completions-stream.test.ts ✅ Passed 264ms
tests/files-content-binary.test.ts ✅ Passed 208ms
tests/files-create-multipart.test.ts ✅ Passed 205ms
tests/files-list-pagination.test.ts ✅ Passed 247ms
tests/initialize-config.test.ts ✅ Passed 193ms
tests/instance-isolation.test.ts ✅ Passed 168ms
tests/models-list.test.ts ✅ Passed 261ms
tests/responses-background-lifecycle.test.ts ✅ Passed 204ms
tests/responses-body-method-errors.test.ts ✅ Passed 275ms
tests/responses-cancel-timeout.test.ts ✅ Passed 237ms
tests/responses-cancel.test.ts ✅ Passed 171ms
tests/responses-compact-retries.test.ts ✅ Passed 342ms
tests/responses-compact.test.ts ✅ Passed 201ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 161ms
tests/responses-create-advanced.test.ts ✅ Passed 229ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.307s
tests/responses-create-errors.test.ts ✅ Passed 184ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 554ms
tests/responses-create-retries.test.ts ✅ Passed 215ms
tests/responses-create-stream-failures.test.ts ✅ Passed 234ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 233ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.052s
tests/responses-create-stream.test.ts ✅ Passed 383ms
tests/responses-create-terminal-states.test.ts ✅ Passed 216ms
tests/responses-create-timeout.test.ts ✅ Passed 230ms
tests/responses-create.test.ts ✅ Passed 281ms
tests/responses-delete.test.ts ✅ Passed 173ms
tests/responses-input-items-errors.test.ts ✅ Passed 467ms
tests/responses-input-items-list.test.ts ✅ Passed 313ms
tests/responses-input-items-options.test.ts ✅ Passed 356ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 283ms
tests/responses-input-tokens-count.test.ts ✅ Passed 216ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.084s
tests/responses-not-found-errors.test.ts ✅ Passed 240ms
tests/responses-parse.test.ts ✅ Passed 250ms
tests/responses-retrieve-retries.test.ts ✅ Passed 213ms
tests/responses-retrieve.test.ts ✅ Passed 199ms
tests/responses-stored-method-errors.test.ts ✅ Passed 463ms
tests/retry-behavior.test.ts ✅ Passed 3.078s
tests/sdk-error-shape.test.ts ✅ Passed 253ms

View OkTest run #38842554051

SDK merge (61cec85d815f) · head (c6c2aeaff513) · base (325da45934dd) · OkTest (04cc09d76e24)

Castiron-Internal-PR: openai/openai-python-internal#263
Castiron-Source-SHA: 2e98884f07a5c944ca3d2a7416e9a402ca4fadcd
Castiron-Public-Base-SHA: 325da45
@yoni-oai
yoni-oai force-pushed the castiron/promotions/pr-263 branch from 792781a to c6c2aea Compare October 16, 2026 02:51

@markstuart-oai markstuart-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.

Reviewed all 44 changed files at c6c2aeaff513f8b465fd2e5b8becc88b75b07eda. I found no blocking issue.

The sync and async helpers use the existing typed send and queue paths on primary, sideband and fork connections. Required evaluation IDs, optional item correlation IDs, sparse delegation updates, and omission versus empty triggers match the schema. Decision results reuse the native model, including distinct string and boolean choices. Existing API declarations remain intact, and the new types stay with their current owners.

Exact-head Python 3.10/3.14 and HTTPX2 tests, build, lint, optional-provider types, dependency checks, CodeQL and Castiron checks passed. I reviewed source and hosted CI only. The new HTTP trigger tests and existing role tests do not directly replay every Decision WebSocket case; no local tests or live service calls ran.

@yoni-oai
yoni-oai added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 230a923 Oct 16, 2026
31 checks passed
@yoni-oai
yoni-oai deleted the castiron/promotions/pr-263 branch October 16, 2026 03:16
@openai-sdks openai-sdks Bot mentioned this pull request Oct 16, 2026
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.

2 participants