feat(api): Add prompt cache diagnostics - #3800
Conversation
Castiron-Internal-PR: openai/openai-python-internal#80 Castiron-Source-SHA: f763d450ff4e6b141a929462aa3c6830f0f0bff3 Castiron-Public-Base-SHA: 3cc8d78
Castiron custom code✅ No new custom-code files detected. 36 mixed files remain; 0 existing customizations changed; 5 generated baselines changed. Compared
31 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 33889316229 --repo openai/openai-python \
--name castiron-custom-code-33889316229-1 --dir /tmp/castiron-custom-code-33889316229-1
git apply --stat /tmp/castiron-custom-code-33889316229-1/custom-code.patch
cat /tmp/castiron-custom-code-33889316229-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 3cc8d784ad05f75a265012ee86638adaf93d8bf2 32697326a51de0c5949b23135f724819b2ac8b88
python3 scripts/castiron/custom_code_report.py report \
--base 3cc8d784ad05f75a265012ee86638adaf93d8bf2 \
--head 32697326a51de0c5949b23135f724819b2ac8b88 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-32697326a51d
cat /tmp/castiron-custom-code-32697326a51d/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32697326a5
ℹ️ 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".
| Completions. For models with a dedicated Fast tier, either value resolves to | ||
| `service_tier=fast`; for other models, either value resolves to | ||
| `service_tier=priority`. - When not set, the default behavior is 'auto'. When |
There was a problem hiding this comment.
Update Fast-tier guidance for response creation
When users call the primary responses.create APIs with a dedicated Fast-tier model, their sync, async, stable, beta, and WebSocket documentation still says either request value is returned as service_tier=priority (for example, this file's lines 320-324), while only the compact endpoint now documents the corrected fast result. This leaves contradictory guidance for the exact behavior this commit intends to clarify; update the shared response service-tier schemas and regenerate all affected SDK surfaces rather than changing only compact.
AGENTS.md reference: AGENTS.md:L5-L6
Useful? React with 👍 / 👎.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed exact head 3269732. The stable and beta request fields, discriminated diagnostic response union, prompt cache option echo, generated tests, and service tier documentation are consistent with the transformed schema. Exact-head CI is green; no blocking findings.
Summary
Expose optional prompt cache comparison diagnostics across the stable and beta Responses APIs. Clarify how Fast and Priority service tier requests resolve for different models.
Changes
comparison_response_idprompt cache option to response creation parameters and client events.prompt_cache_diagnosticsto response models with typed cache hit, cache miss, comparison-not-found, and unavailable outcomes.fastfor models with a dedicated Fast tier and topriorityfor other models.