Skip to content

fix(api): remove a nonpublic Managed Agents turn error - #4288

Closed
markstuart-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-434
Closed

markstuart-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-434

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The SDK has been listing session_budget_exceeded as a public session turn error. The public API no longer advertises that value.

Changes

  • Code that refers to session_budget_exceeded as a known SessionTurnError.code may need to change. To detect a session hitting its budget, listen for agent.session.budget_reached.

Verification

The focused stream tests have been passing (92 cases), along with 32 cases using session_budget_exceeded as an opaque stream-error code. Both session creation and subscription have been delivering the typed agent.session.budget_reached event after that error. Strict SessionTurnError validation has been rejecting the removed enum member.

Castiron-Internal-PR: openai/openai-python-internal#434
Castiron-Source-SHA: ccb3797f51d81c685a60fd5b5afe900c4589b829
Castiron-Public-Base-SHA: f56a67f
@markstuart-oai
markstuart-oai requested a review from a team as a code owner November 18, 2026 04:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T04:18:26.932119Z 7394952 PR opened
🔒 Security Review ✅ Completed 2026-11-18T04:19:01.802087Z 7394952 PR opened
ℹ️ 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.

@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 the exact current commit. No actionable findings. The schema and generated types consistently remove the nonpublic SessionTurnError member; generic SessionError codes remain string-valued, so opaque stream errors still precede the typed agent.session.budget_reached event. Reviewed both creation and subscription paths, existing budget-event coverage, and generated-file manifest hashes. The named constant/literal removal is an intentional compatibility change documented in this PR.

Hosted CI: 17 success, 9 skipped. Static review with independent review; no candidate code or local tests executed.

markstuart-oai added a commit that referenced this pull request Nov 18, 2026
)

## Summary

The SDK has been exposing Managed Agents session budget controls as
public types. This update removes the alpha budget API from those types.

This is an alpha breaking change for a **minor** release. If your
application depends on these members, stay on the previous SDK until you
can remove those references. There is no replacement typed budget API in
this release.

## Changes

- Session requests and responses no longer declare `spend_control`.
- The public event and status types no longer declare
`agent.session.budget_reached` or `budget_reached`. Code that names
these members needs to change before upgrading.

This also includes the turn-error code removal from #4288. This PR
supersedes that narrower change; the old PR does not need to land first.

## Verification

The 278 focused SDK tests have been passing (6 skipped), along with Ruff
and formatting. The tests cover preserving a generic error, ignoring
unrelated unknown frames, and ending a helper's wait when a matching
opaque budget frame arrives.

Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
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