Skip to content

feat(api): expand Decisions input and question types - #1268

Merged
dpiet-oai merged 1 commit into
mainfrom
castiron/promotions/pr-340
Oct 23, 2026
Merged

dpiet-oai merged 1 commit into
mainfrom
castiron/promotions/pr-340

Conversation

@dpiet-oai

@dpiet-oai dpiet-oai commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expand typed Decisions inputs and question instructions, including role-specific messages, tool history, JSON input, and shared Live Decisions types. DecisionInputMessage can be passed through DecisionInputItem to 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, and DecisionInputMessage.Content are removed. Use a role-specific message and wrap it in a request input item:

DecisionInputMessage message = DecisionInputMessage.ofUser(
    DecisionInputMessage.User.builder().content("Review this request").build());
DecisionCreateParams params = DecisionCreateParams.builder()
    .inputOfDecisionInputItems(
        Collections.singletonList(DecisionInputItem.ofDecisionInputMessage(message)))
    .model("model")
    .addPredicateQuestion("Is this a request?")
    .build();

Question instructions() accessors now return union types.

Validation

  • Castiron strict generated-ownership verification passed.
  • Focused Java request-construction, JSON serialization, and map immutability tests passed.
  • 69 custom-code publication tests passed.

BEGIN_COMMIT_OVERRIDE
feat(api): Breaking change in a minor release. Live Decisions question instructions() now returns an Instructions union containing a string or a list of text, image, or JSON parts. Code such as question.instructions().trim() no longer compiles; check instructions.isString() and use instructions.asString(), or handle instructions.asDecisionQuestionInputParts(). String inputs still work with instructions(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, and DecisionInputMessage.Content were removed. Build a role-specific message, wrap it with DecisionInputMessage.ofUser(...) for user messages, and pass it through DecisionInputItem.ofDecisionInputMessage(...).
END_COMMIT_OVERRIDE

@dpiet-oai
dpiet-oai requested a review from a team as a code owner October 22, 2026 19:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-23T04:14:49.628237Z d0aa87d New commits
🔒 Security Review ✅ Completed 2026-10-23T04:14:44.827619Z d0aa87d 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.

@dpiet-oai
dpiet-oai marked this pull request as draft October 22, 2026 19:10
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 1599b41cab0743a3543809cf3644678f570bd44a.

Trusted main policy: 1599b41cab0743a3543809cf3644678f570bd44a.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared 1599b41cab07 → d0aa87d53b56. 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 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.patch

Or 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.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 marked this pull request as ready for review October 22, 2026 19:14

@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: 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".

Comment thread api_reference/openapi.transformed.yml

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

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.

@dpiet-oai
dpiet-oai force-pushed the castiron/promotions/pr-340 branch from 4c8e0a9 to 0ee2803 Compare October 22, 2026 19:34

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

@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: 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".

Comment on lines +107787 to +107789
anyOf:
- $ref: '#/components/schemas/DecisionInputOutputText'
- $ref: '#/components/schemas/DecisionInputRefusal'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread openai-java-core/src/main/kotlin/com/openai/models/DecisionInputJson.kt Outdated
Comment on lines +107568 to +107574
type:
type: string
enum:
- input_json
default: input_json
x-stainless-const: true
data:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 jbeckwith-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.

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

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
@dpiet-oai
dpiet-oai force-pushed the castiron/promotions/pr-340 branch from 8722d4c to d0aa87d Compare October 23, 2026 04:11

@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: 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".

Comment thread api_reference/openapi.transformed.yml

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

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.

@dpiet-oai
dpiet-oai enabled auto-merge October 23, 2026 04:20
@dpiet-oai
dpiet-oai added this pull request to the merge queue Oct 23, 2026

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

Merged via the queue into main with commit f7607c8 Oct 23, 2026
37 checks passed
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