feat(api): add Agents API - #992
Conversation
Castiron-Internal-PR: openai/openai-java-internal#60 Castiron-Source-SHA: 66d29c23748ad43c9b6106ba9dce665a36d9fcfc Castiron-Public-Base-SHA: 6cf15d8
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 codeMixed files: 62 → 70 8 newly customized · 0 customizations removed · 1 existing customizations changed · 4 generated baselines changed Compared
57 existing customizations unchanged
17 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 34520605648 --repo openai/openai-java \
--name castiron-custom-code-34520605648-1 --dir /tmp/castiron-custom-code-34520605648-1
git apply --stat /tmp/castiron-custom-code-34520605648-1/custom-code.patch
cat /tmp/castiron-custom-code-34520605648-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 6cf15d835f7cbd1758a83fa39a6f55ac086fbd6d 22b5ef2b1e2802330e65215dac408cd49ed27e87
python3 scripts/castiron/custom_code_report.py report \
--base 6cf15d835f7cbd1758a83fa39a6f55ac086fbd6d \
--head 22b5ef2b1e2802330e65215dac408cd49ed27e87 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-22b5ef2b1e28
cat /tmp/castiron-custom-code-22b5ef2b1e28/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: 22b5ef2b1e
ℹ️ 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".
| override fun toString() = | ||
| "McpOAuth{accessToken=$accessToken, mcpServerUrl=$mcpServerUrl, type=$type, expiresAt=$expiresAt, refresh=$refresh, additionalProperties=$additionalProperties}" |
There was a problem hiding this comment.
Redact secrets from credential string representations
When an application logs or interpolates a credential create parameter, this toString() renders the write-only OAuth access token verbatim; the nested refresh-token and client-secret variants and StaticBearer similarly expose their secrets. Since these objects are likely to appear in diagnostic logs, generate redacted string representations for every credential create/rotate secret and add regression coverage ensuring the raw values never appear.
AGENTS.md reference: AGENTS.md:L29-L33
Useful? React with 👍 / 👎.
| val result = | ||
| try { | ||
| future.get() | ||
| } finally { | ||
| active = null |
There was a problem hiding this comment.
Treat cancellation caused by close as normal termination
When another thread closes a synchronous stream while an asyncToolHandler stage is incomplete, close() cancels this active future and future.get() throws CancellationException; the outer catch then rethrows it to the consuming thread. This makes an intentional close fail the stream operation, unlike closing during a blocked event read and unlike the async helper, both of which complete normally after close. Check closed when the wait is cancelled and end iteration instead of propagating the cancellation.
Useful? React with 👍 / 👎.
| fun create(environmentId: String): EnvironmentFile = | ||
| create(environmentId, FileCreateParams.none()) |
There was a problem hiding this comment.
Require a file source before issuing create requests
create(environmentId) constructs FileCreateParams.none(), and the implementation validates only the environment ID before sending a POST with no body. Because creating an environment file necessarily requires either inline bytes or a Files API file reference, this convenience overload always produces an invalid request instead of a usable operation. Mark the request body as required in the authoritative OpenAPI source so the generated sync and async APIs require a HostedEnvironmentFileParam.
AGENTS.md reference: AGENTS.md:L5-L8
Useful? React with 👍 / 👎.
Automated Release PR --- ## [4.63.0](v4.62.0...v4.63.0) (2026-09-10) ### Features * **api:** add Agents API ([#992](#992)) ([10027a0](10027a0)) --- 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>
Add the
beta.agentsAPI.OpenAI-Beta: agents=v1header.beta().agents().sessions().stream(...): Stream one turn on an idle session; supports sync and async clients.AgentSessionMessages.outputText(message): Join a message’s output-text blocks into one string.