#[non_exhaustive]pub enum Bound {
Deadline,
ToolBudget,
TokenBudget,
}Expand description
A bound that ended a run before its work did.
Separate from RunOutcome because the two answer different questions.
“The model ran out of the time you gave it” and “the provider refused the
request” call for different reactions, and a caller — the CLI’s exit code,
or a script driving many runs — should not have to read an error message to
tell them apart (ADR-0015). The outcome says whether an answer arrived; this
says whether an allowance is what ended the run, and the two are
independent. Deadline and ToolBudget
always arrive alongside RunOutcome::Error, because no final message
does; TokenBudget can arrive on a run that answered.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Deadline
RunConfig::with_deadline — the run took longer than it was given.
ToolBudget
RunConfig::with_tool_budget — the run made all the calls it had.
TokenBudget
RunConfig::with_token_budget, or a BudgetPool
the run drew dry — it spent its allowance and was refused another round.
The odd one out, and worth knowing why before branching on it. This
bound is graceful: mentra ends the run at a round boundary keeping
everything committed so far, exactly as if the model had finished. So a
run can report RunOutcome::Ok with an ordinary answer and this
bound, which is the honest description of “you got an answer, and the
allowance is why there is not more of one”. Whether an answer arrives
comes down to what the last committed message was: prose, and the turn
succeeds; a tool result, and it fails owing a final message it never
got.
Reportable at all only because mentra records the decision at the
boundary it makes it
(RunOptions::ended_early).
Comparing usage against the budget afterwards would answer a different
question — what is true now, rather than what the runner decided on —
and a pooled run can cross the line without being the run that was
stopped by it.
Trait Implementations§
impl Copy for Bound
Source§impl<'de> Deserialize<'de> for Bound
impl<'de> Deserialize<'de> for Bound
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Bound
impl StructuralPartialEq for Bound
Auto Trait Implementations§
impl Freeze for Bound
impl RefUnwindSafe for Bound
impl Send for Bound
impl Sync for Bound
impl Unpin for Bound
impl UnsafeUnpin for Bound
impl UnwindSafe for Bound
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.