refactor(agent): capture runtime at turn admission

This commit is contained in:
chengyongru authored and Xubin Ren committed 2026-07-10 17:54:34 +08:00
1 parent 45ace23580
commit 198fd9f869
13 files changed
+209 -54

No files matched your search

+2 -2
View File
@@ -296,11 +296,11 @@ class TestRestartCommand:
LLMResponse(content="second", usage={}),
])
await loop._run_agent_loop([])
await loop._run_agent_loop([], runtime=loop.llm_runtime())
assert loop._last_usage["prompt_tokens"] == 9
assert loop._last_usage["completion_tokens"] == 4
await loop._run_agent_loop([])
await loop._run_agent_loop([], runtime=loop.llm_runtime())
assert loop._last_usage["prompt_tokens"] == 123
assert loop._last_usage["completion_tokens"] == 7
assert loop._last_usage["estimated_tokens"] == 130