Skip to content

feat(api): add delegation controls and prompt cache lifetimes - #1272

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

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

Conversation

@dpiet-oai

Copy link
Copy Markdown
Contributor

Summary

Adds Live delegation controls, prompt cache lifetimes, and agent scheduling tools.

Changes

  • Add acknowledgement_delay_ms to Live delegation parameters.
  • Add optional 30m and 12h TTLs to prompt cache breakpoints, including Responses message inputs.
  • Add the automations agent tool variant.
  • Preserve existing agent-tool visitors when encountering automations tools.

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

chatgpt-codex-connector Bot commented Oct 23, 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-23T21:23:55.160906Z f73549f Manual request
🔒 Security Review ✅ Completed 2026-10-23T21:23:13.560280Z f73549f Manual request
ℹ️ 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

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 0ce5f3f17518fb2390d31ec9a4de0a9dda6d9946.

Trusted main policy: 0ce5f3f17518fb2390d31ec9a4de0a9dda6d9946.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared 0ce5f3f17518 → f73549f9aef3. 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 40025033845 --repo openai/openai-java \
  --name castiron-custom-code-40025033845-1 --dir /tmp/castiron-custom-code-40025033845-1
git apply --stat /tmp/castiron-custom-code-40025033845-1/custom-code.patch
cat /tmp/castiron-custom-code-40025033845-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 0ce5f3f17518fb2390d31ec9a4de0a9dda6d9946 f73549f9aef3fbc3b99dcf6f9ef724d8fb7d0f9d
python3 scripts/castiron/custom_code_report.py report \
  --base 0ce5f3f17518fb2390d31ec9a4de0a9dda6d9946 \
  --head f73549f9aef3fbc3b99dcf6f9ef724d8fb7d0f9d --target-branch main --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-f73549f9aef3
cat /tmp/castiron-custom-code-f73549f9aef3/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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 36486cdae2

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 36486cdae2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ 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
markstuart-oai previously approved these changes 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 36486cdae264fa37c78314dabe64fd5ba8122a5d. The delegation and cache lifetime changes preserve optional defaults and unknown values. Agent-tool visitors keep their defaults, and the shared TTL model avoids repeating the enum in each breakpoint type. I found no blocking issues.

Source-only review; I did not run candidate code or tests. Completed hosted checks passed. Still running: CI / build, OkTest.

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

LGTM 👍 No changes requested.

The remaining hosted SDK and compatibility checks are still running.


Reviewed: 36486cd · Base: 0ce5f3f · sdk-pr-review

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

Reviewed 36486cdae264fa37c78314dabe64fd5ba8122a5d. Requesting changes for the review-revocation race.

[P2] Retry stale main snapshots before abandoning review revocation. At .github/workflows/castiron-custom-code-comment.yml:127, requiresHuman can throw when review-required fetches a newer main than the captured SHA (custom_code_policy.py:572-573). Neither this await nor the helper catches that freshness error. The job exits before invalidating prior successful PR/queue policy statuses, so an approval dismissal/edit can leave the old authorization intact. Retry discovery on this explicit stale-main result, or safely invalidate authenticated affected statuses before exiting. Add coverage with existing successful statuses and main advancing between the read and fetch.

Hosted CI: no failed checks observed; still running: CI / tests / sdk, CI / tests / r8, CI / API compatibility, OkTest. Independent static review and coordinator cross-check; no candidate code or local tests executed.

@markstuart-oai
markstuart-oai dismissed their stale review October 23, 2026 19:46

Withdrawing my approval: I missed the review-revocation race in the shared Castiron workflow. If main advances between getRef and the policy helper fetch, the uncaught stale-main error exits before successful policy statuses are invalidated. A corrective comment review follows.

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

Correction to my earlier review: I missed this race and have withdrawn my approval. Reviewed 36486cdae264fa37c78314dabe64fd5ba8122a5d. 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.

Source-only review; I did not run candidate code or tests. Completed hosted checks passed or were skipped. Still running: OkTest.

Castiron-Internal-PR: openai/openai-java-internal#355
Castiron-Source-SHA: 58efdbf70ac0b67c982c5e432d30a4b3aa87fb5a
Castiron-Public-Base-SHA: 0ce5f3f
@dpiet-oai
dpiet-oai force-pushed the castiron/promotions/pr-355 branch from 36486cd to f73549f Compare October 23, 2026 21:11
@dpiet-oai

Copy link
Copy Markdown
Contributor Author

@codex review

Updated the candidate to retry review-policy evaluation when main advances during evaluation. Added a regression covering invalidation of existing successful PR and queue statuses. Please review the current head again.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: f73549f9ae

View security finding report

Only the user who started this review can view the report in Codex.

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

@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: f73549f9ae

ℹ️ 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 +129 to +133
requiresReview = await requiresHuman(pr, mainSha);
} catch (error) {
const {data: currentMain} = await github.rest.git.getRef({...context.repo, ref: 'heads/main'});
if (currentMain.object.sha !== mainSha) continue;
throw error;

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 Recheck main after a successful policy decision

If main advances after the Python helper fetches the old main ref but before it returns requires_human: true, this catch block never runs and the only subsequent main-freshness check is inside the !requiresReview branch. The handler therefore invalidates successful PR and queue statuses using the stale policy decision and may leave them pending if the requested rerun fails. Recheck heads/main after every successful evaluation and retry when it differs from mainSha, regardless of the decision.

Useful? React with 👍 / 👎.

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.

I checked this against requires_human_policy_review and local Git-history probes. With fixed PR/base commits, advancing main preserves a true decision: budget and ratchet edits are unchanged; existing pins compare immutable policies; bootstrap pins become older than main and still require review. A false decision can become true, but that branch already rechecks main. I don't see a stale-decision defect here under normal main advancement.

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

Re-reviewed f73549f. The main-ref retry addresses the earlier review-invalidation race. No remaining blocking findings in the incremental change; existing Java visitor and TTL fixes are retained.

Static review only; no local tests run. Hosted CI remains in progress and will be followed up separately.

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

LGTM 👍 No changes requested.

The stale-main retry regression passes. Hosted SDK CI is still running.


Reviewed: f73549f · Base: 0ce5f3f · sdk-pr-review

@dpiet-oai

Copy link
Copy Markdown
Contributor Author

@codex review

Please re-review the current PR head, including any unresolved findings from the previous round.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: f73549f9ae

View security finding report

Only the user who started this review can view the report in Codex.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: f73549f9ae

ℹ️ 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".

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

LGTM 👍 No changes requested.

SDK, shrinker, Jackson, and Java runtime checks passed. API compatibility CI is still running.


Reviewed: f73549f · Base: 0ce5f3f · sdk-pr-review

@dpiet-oai
dpiet-oai enabled auto-merge October 23, 2026 21:28
@dpiet-oai
dpiet-oai added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 2ddb859 Oct 23, 2026
34 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Oct 23, 2026
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.

4 participants