From 509c6562fe0294e5758e30c260cde6e566936815 Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:35:27 +0200 Subject: [PATCH] search budget: recalibrated caps after the first measured searches [skip ci] Settled ~$0.003 per model call; worst-case reservations exhausted the $0.05 task allowance after 2-4 calls. Now $0.40 per task, $2 per search (maintainer decision). Co-Authored-By: Claude Fable 5.1 --- src/openultrasast/search/budget.py | 6 ++++-- tests/test_search_coordinator.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openultrasast/search/budget.py b/src/openultrasast/search/budget.py index 8482fef..09c6a2b 100644 --- a/src/openultrasast/search/budget.py +++ b/src/openultrasast/search/budget.py @@ -6,8 +6,10 @@ from dataclasses import dataclass @dataclass(frozen=True) class SearchBudget: - spend_usd: float = 0.50 - max_call_usd: float = 0.05 + # Recalibrated 2026-10-05 on the first three measured searches: settled cost was ~$0.003 per model call, + # but worst-case reservations (~$0.027 per call) exhausted the old $0.05 task allowance after 2-4 calls. + spend_usd: float = 2.00 + max_call_usd: float = 0.40 reason_rounds: int = 4 intents_per_round: int = 3 demonstrations: int = 3 diff --git a/tests/test_search_coordinator.py b/tests/test_search_coordinator.py index a816071..35edd61 100644 --- a/tests/test_search_coordinator.py +++ b/tests/test_search_coordinator.py @@ -71,7 +71,7 @@ def test_claim_checkpoint_survives_interrupt_without_free_spend(tmp_path): checkpoint = b.head resumed = Board.resume(b.store, "search-1", checkpoint, coordinator="host") state = Coordinator(resumed, lambda task: {"status": "ok", "cost_usd": 0, "intents": []}).run() - assert state["checkpoint"]["spent_usd"] == 0.05 + assert state["checkpoint"]["spent_usd"] == SearchBudget().max_call_usd assert state["checkpoint"]["tasks"] == 3 @@ -98,7 +98,7 @@ def test_cleanup_failure_halts_and_charges_unknown_spend(tmp_path): with pytest.raises(RuntimeError, match="cleanup"): Coordinator(b, broken).run() assert len(calls) == 1 - assert b.state["checkpoint"]["spent_usd"] == 0.05 + assert b.state["checkpoint"]["spent_usd"] == SearchBudget().max_call_usd assert b.state["checkpoint"]["pending"]["id"] == calls[0].id