Repository navigation
feat(api): add delegation controls and prompt cache lifetimes - #3029
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. |
|
@codex review |
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 40052511874 --repo openai/openai-node \
--name castiron-custom-code-40052511874-1 --dir /tmp/castiron-custom-code-40052511874-1
git apply --stat /tmp/castiron-custom-code-40052511874-1/custom-code.patch
cat /tmp/castiron-custom-code-40052511874-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 8e32d2df55d99fdcd5be8862d4815007f7ad076f 3caafc6a986cb9e87e535a2e88fe178f914d6938
python3 scripts/castiron/custom_code_report.py report \
--base 8e32d2df55d99fdcd5be8862d4815007f7ad076f \
--head 3caafc6a986cb9e87e535a2e88fe178f914d6938 --target-branch main --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-3caafc6a986c
cat /tmp/castiron-custom-code-3caafc6a986c/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab1b82d688
ℹ️ 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".
| /** | ||
| * Inline agent configuration. Provide exactly one of agent and agent_id. | ||
| */ | ||
| agent?: AutomationTargetParamNewSession.Agent; |
There was a problem hiding this comment.
Enforce the required agent choice for new-session targets
For a new_session target, both agent and agent_id are optional even though the contract says exactly one must be provided. TypeScript callers can therefore omit both—as the generated required-only test does—or provide both and still compile, only to have the real endpoint reject the request; model this target as an exclusive union between the inline agent and saved-agent forms.
AGENTS.md reference: AGENTS.md:L52-L57
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The latest review approves this head, but this older thread remains open. @jbeckwith-oai could you explicitly confirm whether the new-session agent/agent_id exclusivity is a release blocker? The generated type follows the optional fields in the supplied API schema; enforcing an exclusive union would need a schema/config contract change rather than a handwritten SDK edit. I am separately addressing the workflow-policy helper finding.
marcuswood-oai
left a comment
There was a problem hiding this comment.
Not approving yet: the existing one-time automation finding reproduces in a focused TypeScript probe through the public client entrypoint. The schema has the correct once branch, so please fix generation and regenerate. The existing review-policy feedback also remains unresolved.
The green CI run skipped build, lint, and the Node test matrix.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed ab1b82d68895a280c615f209364c2ab838cf5a1e. Requesting changes. Confirmed the existing one-time automation parameter-shape and review-revocation race findings:
[P2] Preserve the newly accepted breakpoint TTL in handwritten helpers. src/helpers/responses-tool-runner.ts:540 validates cache breakpoints with outputRecord(cache, ['mode']), and src/helpers/browser.ts:576-582 likewise only permits mode. Thus a typed tool result or screenshot/zoom result containing the newly declared ttl: '30m' | '12h' is rejected; both paths also reconstruct a mode-only object. Accept and validate the optional TTL, preserve it in the snapshot/output, and cover these integration paths.
Hosted checks are successful or skipped. Independently cross-checked the findings; no candidate code or local tests executed.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed ab1b82d68895a280c615f209364c2ab838cf5a1e. I confirmed the existing review-revocation finding: if main advances between getRef and the helper fetch, the uncaught stale-main error exits before prior successful PR and queue policy statuses are invalidated. Retry that specific stale snapshot or safely invalidate the affected statuses before exiting. I have not duplicated the existing comment. The existing one-time creation finding is also confirmed: both variants require the periodic fields, so a valid once request cannot satisfy the public type. I also confirmed the existing helper TTL finding: the Responses runner and browser output helpers reject the newly accepted TTL field and rebuild mode-only breakpoints. Update both validation and copying.
Source-only review; I did not run candidate code or tests. Completed hosted checks passed or were skipped. Build, lint and the Node test matrix were skipped.
ab1b82d to
c4d5a8a
Compare
|
@codex review Updated the candidate to retry review-policy evaluation when main advances during evaluation. Added the regression covering invalidation of existing successful statuses. One-time automation requests now have their own fields. Browser and tool-output helpers preserve valid prompt-cache TTLs; 1,083 focused tests, lint, typecheck, and build passed. Please review the current head again. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4d5a8ada1
ℹ️ 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".
There was a problem hiding this comment.
Re-reviewed c4d5a8a. The prior main-ref race, once-automation shape, and TTL helper findings are fixed.
[P2] Restore the required periodic fields in the generated test (tests/api-resources/beta/agents/automations/automations.test.ts:13–20). The request still uses type: "periodic" but now omits expression and timezone, both required by AutomationCreateParamsBase. This request cannot type-check and does not satisfy the periodic API schema. Restore those fields, or make this a valid once request with run_at, as already done in the latest internal counterpart.
Static review only; no local tests run. Hosted test/lint/breaking-change checks have failures. Log downloads timed out, so I am not attributing every CI failure to this source finding.
Additional P2 in the shared generated fixtures: tests/api-resources/audio/voices.test.ts:13,27 uses a name-only voice payload, then mixes Prompt-only model/script_hint into the audio_sample Consent variant. Generate fixtures from one valid union branch with its required fields. The identical internal fixture was confirmed by hosted compiler annotations: https://github.com/openai/openai-node-internal/actions/runs/40025433273/job/120660311782 . The internal follow-up b8e1e96 restores audio fields and separates the prompt test.
The same inline-file typing regression is also present here at src/resources/beta/agents/environments/files.ts:156–166: data/path/type became optional although the inline-file schema requires all three. Restore required members so empty/incomplete upload bodies are rejected by TypeScript. Existing related finding in the internal counterpart: https://github.com/openai/openai-node-internal/pull/370#discussion_r4364319562 .
[P2] Preserve reporter dispatch for retained dirty targets after a retry (.github/workflows/castiron-custom-code-comment.yml:135–143). An iteration can mark the current PR statuses pending, then retry when the protected base advances before reporter dispatch. If that advancement makes the same pin-only PR no longer require review, the next iteration returns here without dispatching the reporters for retained dirtyTargets, stranding its statuses pending. Continue authenticated discovery/dispatch for affected current targets even when requiresReview becomes false; add a same-head/base-advance true-to-false regression. This is a liveness issue, not an authorization bypass. Related existing findings: openai/openai-python#4169 (comment) and #3029 (comment) .
|
@codex review Please re-review the current PR head, including any unresolved findings from the previous round. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
marcuswood-oai
left a comment
There was a problem hiding this comment.
The earlier once request and main-ref retry issues are fixed. The existing periodic/voice test-payload findings and inline-file requiredness finding still reproduce in a focused TypeScript probe. Please regenerate valid test payloads and restore the required inline-file fields before approval.
The breaking-change job currently stops on formatting in scripts/castiron/fixtures/github_publisher.cjs; build, lint, and the Node test matrix are skipped.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed c4d5a8ada1f589cec1466137e9ac426502b6675f. The earlier once-automation type, TTL helper, and stale-main retry issues are fixed. Three P2 issues remain, already covered by the fixture feedback and inline-file finding:
- Restore
expressionandtimezonein the periodic creation fixture. - Generate voice fixtures from a single valid request variant: the name-only call satisfies neither, and the audio-sample call includes prompt-only fields.
- Restore required
data,path, andtypefor inline environment uploads. The schema still requires all three.
Please correct the generator and regenerate these types and fixtures. I have not duplicated the existing inline comments. I also confirmed a retained policy issue in the dirty-target thread: a next-base pin change after pending writes can make a retry return without restarting the still-current checks. That path already exists in this PR's base.
Source-only review; no candidate code or tests run. Hosted checks currently show 26 successful, 31 skipped, and six failed. I have not attributed every CI failure to these findings.
c4d5a8a to
e5a8a3e
Compare
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5a8a3e3e7
ℹ️ 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".
There was a problem hiding this comment.
Correction after comparing the exact PR base: the dirtyTargets pending-status race is already present in the base branch, including the target-pin decision changing from true to false. I withdraw it as a blocker introduced by this PR. My earlier attribution was incorrect.
Changes remain requested for the existing P2 inline-upload typing regression: src/resources/beta/agents/environments/files.ts:156–166 makes data/path/type optional even though the schema requires them, and the generated fixture sends {}. Restore required fields and a valid fixture. Existing finding. Public periodic and voice fixtures are fixed.
Static source and exact-base review only; no local candidate execution.
marcuswood-oai
left a comment
There was a problem hiding this comment.
The periodic and voice fixture issues are fixed. The existing inline-file requiredness finding still reproduces: an empty upload request compiles, and the required-only test now sends {} even though the schema requires type, data, and path. Please restore those required fields in generation and regenerate a valid fixture before approval.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed e5a8a3e3e7e7e15f9b39c3ee820b89147e4a1af1. The periodic and voice fixture issues are fixed. The existing inline-file P2 remains: data, path, and type are optional, although the API schema requires all three. The required-only test now sends {}, which exposes the same invalid request shape. Please restore the required fields in the generator and regenerate the type and fixture together. I have not duplicated the inline comment.
The reporter can still leave pending statuses after a target-base change makes human review unnecessary. That early-return path already exists in this PR's base, so I am keeping it separate from the introduced P2.
Source-only review; I did not run candidate code or tests. Hosted checks: 23 skipped, 28 success.
e5a8a3e to
8be505f
Compare
|
@codex review |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after static re-review of this exact head. The remaining inline-upload blocker is fixed: data/path/type are required again, and both generated fixtures send a valid inline payload. Manifest hashes match the restored files. The collector change matches the separately reviewed Node #3028 implementation. No remaining introduced findings; the previously withdrawn dirtyTargets issue predates these PRs. Hosted CI is still running without observed failures; follow-up retained. No candidate code or tests executed locally.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Castiron-Internal-PR: openai/openai-node-internal#370 Castiron-Source-SHA: 009299ab1845d480a1f6d5eed828d41d0f54742e Castiron-Public-Base-SHA: 8e32d2d
8be505f to
3caafc6
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Updated head 3caafc6 has clean hosted CI: 26 successful checks, 19 intentional skips, no pending or failed checks. The follow-up changes only workflow tooling, regression tests, and generation metadata. All 34 generated workflow tests and SDK lint also passed locally. Fresh Codex and SDK reviewer passes have been requested. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed 3caafc6a986cb9e87e535a2e88fe178f914d6938. No new blocking findings.
The workflow now reloads both policy helpers from the authenticated main commit on each retry. The regression checks that a changed main policy invalidates prior statuses and schedules reevaluation. Required inline-file fields and their fixture are restored; the earlier automation, voice-fixture and TTL fixes remain intact.
The open agent/agent_id comment remains an upstream schema question: its prose requires exactly one, but the formal schema makes both optional. The SDK follows that schema. I have not verified server behavior for those ambiguous inputs.
Source-only review; I did not run candidate code or tests. Hosted checks: 35 skipped, 32 success.
Automated Release PR --- ## [7.44.0](openai/openai-node@v7.43.0...v7.44.0) (2026-10-25) ### Features * **api:** add delegation controls and prompt cache lifetimes and scheduled automations via `client.beta.agents.automations`, including invocation endpoints and the `automations` agent-tool variant ([openai#3029](openai#3029)) ([d8931e7](openai@d8931e7)) * **api:** expand Live Decision item and question types. **Breaking change in a minor release.** Live Decision item events now include messages and function/custom-tool calls and outputs. `DecisionItemCreatedEvent.item` and `DecisionItemCreateEvent.item` are unions, so callers that directly access `item.content` or `item.role` may no longer compile. For both event types, use `if ('content' in event.item)` before accessing message fields, and handle tool-item variants separately. Message items may omit `type`, so checking only `item.type === 'message'` can skip valid messages. This release also updates image-model documentation: `gpt-image-1` was shut down on October 23, 2026; replace explicit selections with `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare`. The documented default for Responses image-generation tools is now `gpt-image-2`; specify a supported model explicitly when you need a particular model. ([openai#3034](openai#3034)) ([7562cd2](openai@7562cd2)) ### Performance Improvements * **agents:** reuse action checks between stream events ([openai#3028](openai#3028)) ([8e32d2d](openai@8e32d2d)) ### Chores * **api:** clarify contribution review requirements ([openai#3027](openai#3027)) ([4c11b87](openai@4c11b87)) * **api:** fix links in API reference documentation ([openai#3026](openai#3026)) ([d342603](openai@d342603)) * refresh customization checks ([openai#3024](openai#3024)) ([3538a74](openai@3538a74)) --- 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> Co-authored-by: Dan Piet <dp@openai.com>
Public openai#3029 already landed the generated `30m`/`12h` prompt-cache TTL declarations and the handwritten Responses/browser validators. This PR now adds the remaining regression coverage on top of current `main`. The tests cover inline text/image/file blocks passed through the public `ResponsesRunnerTurn.supplyOutputs` signature without payload casts; omitted TTLs; detached breakpoint snapshots after caller mutation; screenshot TTLs reaching a serialized Responses request; and rejection of invalid TTLs/accessors before pending calls are consumed. No generated declarations or runtime implementations differ from `main`. Validation: - 1,088 focused tests pass on Node 22.22.3 and 24.22.1. - The inline compile regression produces the original three TS2353 errors against this PR's old generated declarations and passes against current declarations. - TypeScript checking (`tsc --noEmit --module preserve`), repository lint, and build pass. - Local canonical test startup is blocked by SWC rejecting this devbox's filesystem ownership while preparing unrelated example fixtures. Focused tests used a temporary local Vitest configuration omitting that global fixture setup; committed test/CI configuration is unchanged. Hosted CI remains required.
Summary
Adds agent scheduling APIs, Live delegation controls, and prompt cache lifetimes.
Changes