Skip to content

chore(api): clarify project API key update requirements - #4125

Draft
jbeckwith-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-272
Draft

jbeckwith-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-272

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Project API-key updates require scopes, an expiration, or both. Record this existing rule with required-only anyOf, and supply a valid scopes body in the generated synchronous and asynchronous update tests.

Regeneration also refreshes shared CI reporting and adds explicit type annotations to WebSocket connection options and reporter tests. Existing request types are preserved. The generated WebSocket code also changes the default receive-size limit when callers omit max_size; that behavior is under review and this draft is not ready to merge.

Validation: internal current-head CI is green; public CI passed; generated ownership verification and the trusted public-main custom-code budget check pass (7,351 / 10,000 lines). Two independent review rounds are clean.

Castiron-Internal-PR: openai/openai-python-internal#272
Castiron-Source-SHA: 89c1b91db57c88f47d988a6955298e021bbb25f2
Castiron-Public-Base-SHA: 0e5794d
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 0e5794dc48b8f8d51f6047f8a0b1814eb1e65850.

Trusted main policy: 0e5794dc48b8f8d51f6047f8a0b1814eb1e65850.

✅ No new custom-code files detected.

39 mixed files remain; 0 existing customizations changed; 7 generated baselines changed.

Compared 0e5794dc48b8 → cdae93b974ab. Generated baselines verified.

File Result Current custom patch
src/openai/resources/beta/responses/responses.py Generated baseline changed +55 / −55
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
src/openai/resources/realtime/realtime.py Generated baseline changed +9 / −3
src/openai/resources/realtime/translations/translations.py Generated baseline changed +18 / −2
src/openai/resources/responses/responses.py Generated baseline changed +920 / −74
32 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/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/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/decision_input_image_param.py
  • src/openai/types/decision_input_text_param.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 39377013723 --repo openai/openai-python \
  --name castiron-custom-code-39377013723-1 --dir /tmp/castiron-custom-code-39377013723-1
git apply --stat /tmp/castiron-custom-code-39377013723-1/custom-code.patch
cat /tmp/castiron-custom-code-39377013723-1/custom-code.patch

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

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

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

  • [P2] Preserve the default WebSocket receive-size limit — src/openai/resources/responses/responses.py:4468–4471 (and the equivalent changes in the other WebSocket managers). Setting max_size=None when the caller omits it disables the transport's existing receive-size limit; this is a runtime change, not merely an annotation refresh. A malformed or unexpectedly large server message can now be buffered without a size bound instead of closing the connection when the limit is exceeded, including when it arrives across many fragments. Disabling compression does not bound that allocation, and callers explicitly selecting compression="deflate" now also lose the previously inherited limit on decompressed messages. Preserve the transport default when max_size is omitted and retain explicit max_size=None as the caller's opt-in for unlimited messages, rather than silently removing the guard across all synchronous and asynchronous WebSocket APIs.

@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 cdae93b. No additional blocking findings.

The schema constraint, valid update-test bodies, shared reporting changes, and synchronous option types look sound. Entry cleanup closes the opened socket and preserves the original failure. Caller-supplied receive-size and compression options still take precedence without mutating the input mapping.

Omitting max_size now permits unlimited messages, and omitted compression is disabled in that case. This is a real behavior change, not just an annotation update. I considered the existing receive-limit review and the large-payload guidance; proportional buffering alone does not establish another blocking defect. The existing review and draft status remain unresolved by this approval.

Nonblocking: update the compression option documentation, which still says permessage-deflate is enabled by default. A focused test for omitted and explicit options would also make this changed contract clearer.

All current hosted checks are successful or skipped. I reviewed source and hosted CI without running the candidate locally.

This branch has not been deployed

No deployments
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