mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-20 05:29:28 +00:00
search-with-proof: name the exhausted limit, keep partial evidence, tighter reservation
budget_spent carries end_detail (spend, task_spend, reason_rounds, ...); a task whose allowance cannot cover the next call finishes with its facts; per-task metrics in pilot records; input reservation bytes/2 + 1024 per message (measured 3-4x over-reservation before). Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
4be2063d40
commit
c33b053b15
@@ -23,8 +23,9 @@ _USAGE_FIELDS = ("prompt_tokens", "prompt_cache_hit_tokens", "completion_tokens"
|
||||
class BudgetExhausted(RuntimeError):
|
||||
"""Raised before a call would start once the usd or calls ceiling is reached."""
|
||||
|
||||
def __init__(self, message: str, *, usd: float | None, calls: int) -> None:
|
||||
super().__init__(message)
|
||||
def __init__(self, message: str, *, usd: float | None, calls: int, end_detail: str = "spend") -> None:
|
||||
super().__init__(f"{end_detail}: {message}")
|
||||
self.end_detail = end_detail
|
||||
self.usd = usd
|
||||
self.calls = calls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user