Skip to content

feat(api): add prompt cache breakpoint TTL options - #4188

Merged
jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-309
Oct 27, 2026
Merged

jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-309

Conversation

@jbeckwith-oai

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

Copy link
Copy Markdown
Contributor

Summary

Clarifies how Responses cache breakpoints inherit the request TTL when no override is supplied. This refresh also includes the compiler-generated workflow and validation repairs described below.

Changes

  • Clarify the optional 30m and 12h Responses breakpoint TTL overrides and request-level inheritance.

Generated workflow repairs

Authenticate source workflows and read policy from trusted main; serialize status writes; invalidate stale queue checks when main advances; and skip unprepared queue entries with null heads while rejecting malformed non-null SHAs. Invalidation sets pending status and requests reevaluation; it does not grant success or execute candidate code. Main-push invalidation is event-driven.

Approval recovery requires an eligible approving human on the current head. Revocation rereads authoritative reviews and invalidates stale success when no valid approval remains, including dismissal and edit-away events. For ordinary SDK code reviews, unrelated comments preserve valid approval.

Validation

Generated tooling tests, formatting, strict Pyright and Mypy pass. Existing customization budgets and compatibility rules remain intact.

Python: locked Mypy 2.3.1 passes 13 files; all 167 focused websocket/translation transport tests pass. The websocket resources preserve the released runtime-owned query fix.

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 27, 2026 01:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T03:13:14.358897Z 2b8b80d New commits
🔒 Security Review ✅ Completed 2026-10-27T03:13:01.827728Z 2b8b80d 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.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: a3f430241c4a2e3e25bf79cc7d0148e51795a292.

Trusted main policy: a3f430241c4a2e3e25bf79cc7d0148e51795a292.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared a3f430241c4a → 2b8b80d85d0e. Generated baselines verified.

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

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

git fetch --no-tags origin a3f430241c4a2e3e25bf79cc7d0148e51795a292 2b8b80d85d0e857489eabb420379605fcae5fb41
python3 scripts/castiron/custom_code_report.py report \
  --base a3f430241c4a2e3e25bf79cc7d0148e51795a292 \
  --head 2b8b80d85d0e857489eabb420379605fcae5fb41 --target-branch main --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-2b8b80d85d0e
cat /tmp/castiron-custom-code-2b8b80d85d0e/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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27fcdfaffa

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/castiron-custom-code-comment.yml

@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 27fcdfaffa6d789639b15e47c5904c8e4cd1cbb1. The existing stale-publisher finding is supported by the current source. Your reproduction and planned compiler fix address the right boundary; that fix is not yet in this reviewed head. The shared workflow still needs to make main-change invalidation supersede older computations. Its [main ...] pending marker is ignored by the evaluation-order check, so an already-computed ordinary pinned-next publisher can overwrite it before reevaluation completes. Preserve the intentional pinned-policy semantics while fixing that ordering.

The changed public Python type definitions preserve their non-documentation structure; the ratchet adjustment retains the authenticated policy rather than dropping its ratchet field.

Source-only review with an independent pass; no candidate tests, builds or generation ran here. Hosted CI and the required human policy/release approvals remain separate gates.

Castiron-Internal-PR: openai/openai-python-internal#309
Castiron-Source-SHA: 6fb8900e028afe83cfad6670097bc290b097236f
Castiron-Public-Base-SHA: a3f4302
@jbeckwith-oai
jbeckwith-oai force-pushed the castiron/promotions/pr-309 branch from 27fcdfa to 2b8b80d Compare October 27, 2026 03:09
@jbeckwith-oai
jbeckwith-oai requested review from a team, dpiet-oai and markstuart-oai October 27, 2026 03:18

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

LGTM 👍 No changes requested.


Reviewed: 2b8b80d · Base: a3f4302 · sdk-pr-review

@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 2b8b80d85d0e857489eabb420379605fcae5fb41. The TTL documentation preserves the public type declarations and wire shapes. The stale-main status issue and duplicate status suite are fixed. No blocking findings; one nonblocking test-structure follow-up is inline.

Source-only review with an independent pass; no candidate tests or generation ran here. Hosted CI and the required human SDK CODEOWNER/policy reviews remain separate gates.

Comment thread scripts/castiron/test_custom_code_strict.py
@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 3596d18 Oct 27, 2026
48 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the castiron/promotions/pr-309 branch October 27, 2026 03:50
@openai-sdks openai-sdks Bot mentioned this pull request Oct 27, 2026
gh-actions-shared Bot pushed a commit to xf-qubit/openai-python that referenced this pull request Oct 27, 2026
Automated Release PR
---


##
[3.40.0](openai/openai-python@v3.39.0...v3.40.0)
(2026-10-27)


### Features

* **api:** add prompt cache breakpoint TTL options
([openai#4188](openai#4188))
([3596d18](openai@3596d18))


### Bug Fixes

* **ci:** use an explicit browser demo dependency
([openai#4185](openai#4185))
([a3f4302](openai@a3f4302))


### Chores

* **api:** record completed generated-code separation
([openai#4190](openai#4190))
([d7ab5ee](openai@d7ab5ee))
* **deps-dev:** bump griffe from 1.14.0 to 2.3.0
([openai#4069](openai#4069))
([766b849](openai@766b849))
* **deps:** bump actions/create-github-app-token from 3.2.0 to 3.3.0
([openai#4178](openai#4178))
([06dbb5d](openai@06dbb5d))
* **deps:** bump actions/download-artifact from 8.0.1 to 8.0.2
([openai#4110](openai#4110))
([2404d04](openai@2404d04))
* **deps:** bump actions/upload-artifact from 7.0.1 to 7.0.2
([openai#4107](openai#4107))
([0adf711](openai@0adf711))
* **deps:** bump github/codeql-action/analyze from 4.38.2 to 4.39.0
([openai#4177](openai#4177))
([1e42321](openai@1e42321))
* **deps:** bump openai/codex-action from 1.12 to 1.13
([openai#4070](openai#4070))
([904ed3f](openai@904ed3f))
* update generated-code verification and preserve SDK helpers
([openai#4186](openai#4186))
([9412200](openai@9412200))

---
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.

4 participants