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
{{ message }}
Repository navigation
Budget exhaustion is not enforced after cost metrics #25
Cost metrics decrement the budget ledger, but no code checks whether the counter reached zero afterward. BudgetLedger.AssertNotExhausted exists and the XML comment on Job.EmitMetricAsync says a BudgetExhaustedException may be raised, yet EmitMetricAsync only calls ApplyMetric and then emits the metric event. A job can keep running after spending through its declared cost.budget, while the docs and conformance page state that BUDGET_EXHAUSTED is enforced.
The relevant locations are src/Arcp.Runtime/Job.cs:151, src/Arcp.Runtime/Job.cs:155, src/Arcp.Runtime/Budget/BudgetLedger.cs:51, docs/guides/jobs.md:129, and docs/conformance.md:33.
Fix prompt: Enforce budget exhaustion immediately after applying a matching cost.* metric. Update Job.EmitMetricAsync to call BudgetLedger.AssertNotExhausted after ApplyMetric returns true, convert exhaustion into the protocol behavior described by the docs, and ensure the job terminates with ErrorCode.BudgetExhausted and Retryable = false rather than continuing. Add unit and integration tests for a lease with cost.budget of USD:1.00, a metric of cost.inference with value greater than or equal to the budget, and the expected BUDGET_EXHAUSTED terminal result.
Activity
fix: resolve all open csharp-sdk bug, doc, and coverage issues (#34)
nficano commentedon May 24, 2026
Resolved in #34 (merged into main).