Repository navigation
feat: add automatic Chat Completions tool runner - #1430
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ 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. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Please validate the full tool argument string before invoking callbacks.
markstuart-oai
left a comment
There was a problem hiding this comment.
The tool runner now validates the entire argument string before invoking any callback. The regression tests cover a malformed later call and confirm that no callbacks run for that turn.
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: b0b1e399e3
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
markstuart-oai
left a comment
There was a problem hiding this comment.
The cumulative callback budget rejects an over-budget turn before dispatch and preserves results from earlier turns. The tests cover exact, zero, and exhausted budgets and reset between runs.
Automated Release PR --- ## [4.112.0](openai/openai-java@v4.111.0...v4.112.0) (2026-11-23) ### Features * add automatic Chat Completions tool runner ([openai#1430](openai#1430)) ([889ce00](openai@889ce00)) * add custom request helper ([openai#1431](openai#1431)) ([4bd4b3c](openai@4bd4b3c)) * add vector-store polling and bulk upload helpers ([openai#1427](openai#1427)) ([a9c8024](openai@a9c8024)) * **api:** add spending limits to agent sessions ([openai#1436](openai#1436)) ([620425d](openai@620425d)) * expose request IDs on service errors ([openai#1429](openai#1429)) ([55c164c](openai@55c164c)) * normalize Responses history for replay ([openai#1428](openai#1428)) ([4f1ad88](openai@4f1ad88)) ### Bug Fixes * **api:** clarify when to omit completion choice count ([openai#1424](openai#1424)) ([2c2e249](openai@2c2e249)) * preserve streamed function calls and unblock stream close ([openai#1432](openai#1432)) ([adc9184](openai@adc9184)) ### Build System * bump actions/setup-java from 6.2.0 to 6.3.0 ([openai#1434](openai#1434)) ([7dc91df](openai@7dc91df)) * bump graalvm/setup-graalvm from 1.6.8 to 1.6.9 ([openai#1435](openai#1435)) ([781ad03](openai@781ad03)) --- 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>
Java callers currently have to dispatch Chat Completions function callbacks and build the follow-up conversation themselves. Add a handwritten
ChatCompletionToolRunnerthat registers typed callbacks, executes them sequentially, appends JSON results with matching tool-call IDs, and continues to a final completion within configurable model-request and cumulative callback limits.The helper preflights each turn before invoking callbacks, preserves partial history and the original cause on failure, and never retries callbacks. Includes a Java example and documentation covering callback authorization, interruption, forced tool choices, and recovery after side effects. Scope is blocking, non-streaming Chat Completions.
Validation: 38 offline runner regression tests and 96 existing structured-output tests pass on both the published and compatibility Jackson runtimes; Java example compiles; Kotlin formatting and diff checks pass. Adversarial review completed with two consecutive clean rounds after correcting stale failed-call ID metadata. The strict-JSON and cumulative-callback-budget review fixes each also passed two consecutive clean adversarial rounds.