Repository navigation
Add observed budgets for native agent runs - #5555
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. |
71c4354 to
1aa8809
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed request/token/estimated-cost accounting, missing usage, root event ordering, live replies, steering, output repair, and checkpoint restrictions. No actionable introduced issue found.
Static review only; no local code or tests executed. Hosted Python 3.10 failed three deferred-MCP cancellation traceback tests; the new budget tests passed in that log. Other observed checks passed. CI failure remains open; baseline causation is unverified.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the exact tree delta from my prior approval: only deferred-MCP test traceback capture changed. Capturing frames within the cancelled task avoids Python 3.10 losing them across the task boundary; sensitive-data and credential-release assertions remain. The runtime budget implementation is unchanged. No actionable introduced issue found. Hosted checks are newly running; the previous Python 3.10 failure is not yet verified resolved.
Static review only; no local code or tests executed.
911adc0 to
e2b5d42
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-approved. The child-turn test now waits for published handles before asserting them, addressing the observed Windows observation race while preserving the policy-stop, sibling and successor assertions and the enclosing timeout. Budget runtime code is unchanged. Also checked the merged CI/base reconciliation and retained budget annotation checks. No new actionable finding. The Windows fix still needs hosted confirmation.
Hosted CI remains pending with no observed current-head failures. Static coordinator and independent review only; no candidate code or local tests executed.
Summary
This pull request adds optional budgets for direct native agent runs and Session submissions. Applications can limit admitted root requests, reported tokens, and estimated cost in integer micro-US dollars.
The SDK records reported usage before deciding whether to admit another request. A denial happens before the step hook and provider request. If a measurement required by the budget is missing, the default policy stops the next request. Applications can opt to continue with the measurements they have. An admitted response can use more than the limit and still return a valid final result.
Live manual replies, retained steering, and output repair share the current budget. New root operations start with a fresh budget. Active budgets prevent portable checkpoint capture and preserve the live reply.
Test plan
Checks