(runner)
| 125 | |
| 126 | |
| 127 | async def test_budget_ceiling_stops_the_run(runner): |
| 128 | # Each agent costs 5 tokens; total 8 -> the third call trips the ceiling. |
| 129 | script = META + ( |
| 130 | 'a = await agent("1")\n' |
| 131 | 'b = await agent("2")\n' |
| 132 | 'c = await agent("3")\n' |
| 133 | "return [a, b, c]\n" |
| 134 | ) |
| 135 | res = await run_workflow(script, runner=runner, budget_total=8) |
| 136 | assert not res.ok |
| 137 | assert "budget" in res.error.lower() |
| 138 | assert runner.call_count == 2 # third never reached the runner |
| 139 | |
| 140 | |
| 141 | async def test_per_call_item_cap(monkeypatch, runner): |
nothing calls this directly
no test coverage detected