feat(webui): visualize context usage by logical round (#5649)

* feat(webui): visualize per-request context reuse

* refactor(webui): report usage by logical round

* fix(webui): align context chart with logical rounds

* refactor(webui): derive turn usage from logical rounds

* fix(webui): polish context usage details
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-04 15:13:17 +08:00
1 parent 8fb7bc34ec
commit 6b82d642fc
35 files changed
+994 -274

No files matched your search

+6
View File
@@ -742,6 +742,12 @@ async def test_runner_fits_each_malformed_retry_with_its_actual_tools(monkeypatc
assert None in estimated_tools
assert [len(call["messages"]) for call in calls] == [1, 1, 1]
assert result.final_content == "recovered"
assert result.usage is not None
assert result.usage.input_tokens == 300
assert result.usage.output_tokens == 30
assert result.usage.request_count == 3
# Recovery dispatches contribute to the total without becoming extra chart bars.
assert result.round_usages == [result.usage]
assert result.messages == [
{"role": "user", "content": "use a tool"},
{"role": "assistant", "content": "recovered"},