feat(api): Add prompt cache diagnostics - #975
Conversation
Castiron-Internal-PR: openai/openai-java-internal#65 Castiron-Source-SHA: d1c02da027a59e48ed83c65b35cffa0bfaa35182 Castiron-Public-Base-SHA: 1992a4a
Castiron custom code✅ No new custom-code files detected. 55 mixed files remain; 0 existing customizations changed; 7 generated baselines changed. Compared
48 existing customizations unchanged
8 more in the full report. 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 33890414274 --repo openai/openai-java \
--name castiron-custom-code-33890414274-1 --dir /tmp/castiron-custom-code-33890414274-1
git apply --stat /tmp/castiron-custom-code-33890414274-1/custom-code.patch
cat /tmp/castiron-custom-code-33890414274-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 1992a4a8517bb6d9d1c7e99e0641ef85c562bc4e de17a7b87552bae3043d9d18090c328298a638d3
python3 scripts/castiron/custom_code_report.py report \
--base 1992a4a8517bb6d9d1c7e99e0641ef85c562bc4e \
--head de17a7b87552bae3043d9d18090c328298a638d3 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-de17a7b87552
cat /tmp/castiron-custom-code-de17a7b87552/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Good layering: prompt-cache diagnostics stay on the generated Response model, while StructuredResponse exposes both the typed optional and raw JsonField without duplicating decoding logic. Carrying comparison_response_id through the request and returned cache options also keeps the comparison identity inspectable. One thing I would verify before merge is that the broad regenerated OpenAPI delta is intentional for this spec revision, since it also changes inference error responses outside prompt caching.
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. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed exact head de17a7b. The stable and beta request builders, optional comparison response IDs, diagnostic union models, serialization paths, structured response delegation, and generated tests are consistent. Exact-head CI is green; no blocking findings.
Summary
Add prompt cache comparison requests and typed diagnostics to the Responses API. The new capabilities are available in both stable and beta response models.
Changes
comparisonResponseIdprompt cache option to response creation and client event inputs.StructuredResponsewrapper, including raw JSON-field access.PromptCacheDiagnosticsresponse data for cache hits, cache misses, missing comparison responses, and unavailable diagnostics.Validation
StructuredResponseTesttests passed against the Jackson compatibility runtime.