RetryBudgetLedger class final
The per-run dual retry budgets (issue #1398 AC3): two independent counters, one per RetryBudgetClass, each with its own cap — the connection class defaults to 4 (codex-rs order), the stream class to 3. One ledger per run: create it where #1395's per-run state lives.
Constructors
- RetryBudgetLedger({int connectionRetries = 4, int streamRetries = 3})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cap(
RetryBudgetClass kind) → int -
The cap for
kind(injectable for tests). -
isExhausted(
RetryBudgetClass kind) → bool -
Whether
kind's budget is spent. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
terminalStory(
) → String - E5: the terminal-error story fragment carrying BOTH counters, so a dead run reports exactly what each budget spent — and says "exhausted" only of the budgets that actually are (review r2):
-
toString(
) → String -
A string representation of this object.
inherited
-
tryConsume(
RetryBudgetClass kind) → bool -
Consumes one attempt of
kind; false when that budget is exhausted (the caller escalates instead). Never touches the other counter. -
used(
RetryBudgetClass kind) → int -
How many attempts of
kindwere consumed so far.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited