Repository navigation
feat(api): expand Decisions input and question types - #1268
Conversation
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. |
Castiron custom codeEvaluated main: Trusted main policy: ✅ No new custom-code files detected. 0 mixed files remain; 0 existing customizations changed. Compared 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 39899052790 --repo openai/openai-java \
--name castiron-custom-code-39899052790-1 --dir /tmp/castiron-custom-code-39899052790-1
git apply --stat /tmp/castiron-custom-code-39899052790-1/custom-code.patch
cat /tmp/castiron-custom-code-39899052790-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 1599b41cab0743a3543809cf3644678f570bd44a d0aa87d53b56ed039594d5396b519d3b2a5f623d
python3 scripts/castiron/custom_code_report.py report \
--base 1599b41cab0743a3543809cf3644678f570bd44a \
--head d0aa87d53b56ed039594d5396b519d3b2a5f623d --target-branch main --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-d0aa87d53b56
cat /tmp/castiron-custom-code-d0aa87d53b56/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c8e0a9db5
ℹ️ 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".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Requesting changes for the independently verified public input model disconnection. Referencing the existing finding rather than duplicating an inline comment; I assess it as P2 because the nested request models remain usable.
At the base commit, DecisionCreateParams.Builder.inputOfDecisionInputMessages accepted List. At this commit, the request only accepts List<DecisionCreateParams.Input.UnnamedSchemaWithArrayParent0>, whose factories require separate nested message classes. Following the documented migration to DecisionInputMessage.ofUser(DecisionInputMessage.User.builder()...) therefore produces a model that cannot be passed to the request. Please connect the request item union to the public message models (for example through a named input component) and add a compile/serialization regression covering a public message passed to DecisionCreateParams.
The documented beta constructor/Type/Content removals and instruction accessor changes are accepted; this disconnected migration path is a separate issue. Static review of the message/tool unions, JSON object/array handling, question parts, and Live instruction variants found no additional blockers.
Hosted CI is still in progress; the observed OkTest check is cancelled, not passed. No candidate code or local tests were executed.
4c8e0a9 to
0ee2803
Compare
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed the Java Decisions update at 0ee2803fa0e932c6e939f8a24a68dd8f304b7e07. The explicitly accepted beta builder removal is acknowledged. The existing public message-model P2 remains: the public DecisionInputMessage variants cannot be passed into the request input, which accepts a second set of nested message classes. Generate that request branch from the canonical public union and add a typed request-construction test. This also removes the duplicated role-model trees.
CI / build and OkTest are still running; the other nine current hosted checks succeeded or were skipped. Static source review only; I did not run candidate code, tests, builds, or a compiler.
0ee2803 to
8722d4c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8722d4cc51
ℹ️ 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".
| anyOf: | ||
| - $ref: '#/components/schemas/DecisionInputOutputText' | ||
| - $ref: '#/components/schemas/DecisionInputRefusal' |
There was a problem hiding this comment.
Extract a named assistant content-part union
When callers construct an assistant message whose content is an array of output-text or refusal parts, this anonymous items.anyOf makes Castiron expose DecisionInputMessage.Assistant.Content.UnnamedSchemaWithArrayParent0 and nest OutputText and Refusal beneath that implementation-generated name. This leaves the new typed assistant-content path without stable public part models; extract the item union into a named component referenced by items, then regenerate the SDK.
AGENTS.md reference: AGENTS.md:L5-L8
Useful? React with 👍 / 👎.
| type: | ||
| type: string | ||
| enum: | ||
| - input_json | ||
| default: input_json | ||
| x-stainless-const: true | ||
| data: |
There was a problem hiding this comment.
Expose cache breakpoints on JSON input parts
When prompt_cache_options.mode is explicit and the reusable prefix should end after a user input_json block, this schema offers no typed prompt_cache_breakpoint, although both sibling main-input block types (DecisionInputText and DecisionInputImage) expose one and the prompt-cache option contract places explicit breakpoints on content blocks. Add breakpoint support to the main-input JSON model, splitting out a question-specific JSON type if question instructions must continue to disallow it, then regenerate.
AGENTS.md reference: AGENTS.md:L5-L8
Useful? React with 👍 / 👎.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The public-message adapter finding is fixed: DecisionCreateParams accepts List, and ofDecisionInputMessage connects the public role union to the serialized request. The contract regression exercises that path.
One confirmed P2 remains: #1268 (comment) . DecisionInputJson.Data.ofMaps only freezes the outer list; mutable element maps remain shared and exposed by asMaps(). Mutating a supplied map after build changes serialized request data, while the outer DecisionInputJson caches its hashCode. Copy and freeze each map (or generate immutable object models), and cover mutation of both original and returned maps plus equality/hash stability. Referencing the existing finding without a duplicate inline comment.
The assistant-content naming comment is a usability concern, not a demonstrated correctness blocker. I could not establish the proposed JSON cache-breakpoint field from an independent wire contract, so am not treating that inference as a blocker.
Independent static review of the refresh and relevant model/serialization context; no candidate code/tests executed. Hosted CI has no failures, with two checks still running at publication.
markstuart-oai
left a comment
There was a problem hiding this comment.
Static source review of Java PR #1268 at 8722d4cc51900455e191fa34a78820c4f11b39e0: the previous public message-model connection is fixed. Two existing findings remain: give assistant content a stable named union, and snapshot nested JSON maps. The first would provide a usable public type and a clear boundary for the generated assistant content model. The second prevents callers from mutating a built model through JSON map values. I am referencing these findings without adding duplicate inline comments.
I reviewed the complete 49-file diff and supporting model utilities. Static source review only; I did not run candidate code, tests, builds, or the generator.
Current hosted checks are incomplete: OkTest (IN_PROGRESS).
Castiron-Internal-PR: openai/openai-java-internal#340 Castiron-Source-SHA: af40bc0f3ed1a79df8a94d100b81876c1e54ca66 Castiron-Public-Base-SHA: 1599b41
8722d4c to
d0aa87d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0aa87d53b
ℹ️ 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".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at d0aa87d. The mutable-map finding is fixed: Data's constructor snapshots and freezes each element map and the outer list, covering both factory construction and deserialization. The regression checks source mutation, returned-map mutation, serialization, equality, and cached hash stability. The earlier public-message adapter fix remains intact.
Independently reviewed all ten changed blobs against the previous reviewed head, with a second static review. The policy refresh now compares bootstrap against authenticated main and conservatively retains human review for legacy/unknown checker contracts; the capability marker is read as inert data from the protected previous checker. No new actionable findings. Seven changed owned-file hashes verified.
Hosted CI is still running/queued with no failures observed. No candidate code, tests, builds, or generation were executed.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed Java #1268 at d0aa87d53b56ed039594d5396b519d3b2a5f623d. The JSON map snapshot finding is fixed. The assistant content-part finding remains: the array still exposes DecisionInputMessage.Assistant.Content.UnnamedSchemaWithArrayParent0. Please extract that item union into a named schema component and regenerate a reusable model. No duplicate inline comment added.
I reviewed all 54 changed files, using exact prior source matches where applicable. The generated policy workflow preserves the checked trust boundary. This was a static source review; candidate code, tests and builds were not run. This automated review does not provide human attestation.
Current hosted checks report success or skipped.
Summary
Expand typed Decisions inputs and question instructions, including role-specific messages, tool history, JSON input, and shared Live Decisions types.
DecisionInputMessagecan be passed throughDecisionInputItemto request input. JSON input snapshots each supplied map and exposes immutable maps after construction and deserialization.This generation also updates the trusted custom-code workflow and its policy tooling. Review invalidation reads an inert capability marker from the effective pinned checker; legacy, missing, and unknown checker contracts retain human-review requirements. No candidate checker code is executed by the invalidation handler. Security-focused review is requested for the workflow trust boundary and JSON deserialization.
Accepted beta API changes
DecisionInputMessage.builder(),DecisionInputMessage.Type, andDecisionInputMessage.Contentare removed. Use a role-specific message and wrap it in a request input item:Question
instructions()accessors now return union types.Validation
BEGIN_COMMIT_OVERRIDE
feat(api): Breaking change in a minor release. Live Decisions question
instructions()now returns anInstructionsunion containing a string or a list of text, image, or JSON parts. Code such asquestion.instructions().trim()no longer compiles; checkinstructions.isString()and useinstructions.asString(), or handleinstructions.asDecisionQuestionInputParts(). String inputs still work withinstructions(String). Decisions request inputs also support additional message roles and tool-history items; update code that assumes a fixed set of input types.DecisionInputMessage.builder(),DecisionInputMessage.Type, andDecisionInputMessage.Contentwere removed. Build a role-specific message, wrap it withDecisionInputMessage.ofUser(...)for user messages, and pass it throughDecisionInputItem.ofDecisionInputMessage(...).END_COMMIT_OVERRIDE