You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(runtime): non-fatal budget exhaustion via tool_result.error (§9.6)
Spec §9.6 SHOULDs the `tool_result.error` form so the agent can decide
whether to continue with non-cost-bearing operations. The runtime
previously always threw `BudgetExhaustedException` from
`Job.EmitMetricAsync`, which the run-loop converted into a terminal
`job.error{BUDGET_EXHAUSTED}` — the agent never got a chance.
- `Job.EmitMetricAsync` now returns the exhausted-currency string (or
null) instead of throwing, leaving the policy decision to the caller.
- `JobContext.MetricAsync` surfaces the exhaustion as
`tool_result.error{BUDGET_EXHAUSTED, retryable:false}` and lets the
agent continue. Opt back into terminal exhaustion with the new
`ArcpServerOptions.FatalBudgetExhaustion = true`.
- `BudgetEnforcementTests` is rewritten: one test for the new
spec-preferred surface, one for the legacy fatal opt-in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments