feat: tuiのトークン集計表示の修正

This commit is contained in:
2026-05-04 00:01:37 +09:00
parent 9a06494bc6
commit e6b6df09b8
6 changed files with 39 additions and 11 deletions
+10
View File
@@ -281,9 +281,19 @@ pub enum Event {
#[serde(default)]
is_error: bool,
},
/// Token accounting for one LLM request.
///
/// `input_tokens` is the prompt prefix occupancy (cache reads /
/// cache writes included), as normalised by the worker layer.
/// `cache_read_input_tokens` is the cache-hit subset of that
/// occupancy; subtracting it yields the "net upload" the client
/// actually paid full price to send on this request, which is what
/// the TUI status line accumulates per turn.
Usage {
input_tokens: Option<u64>,
output_tokens: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
cache_read_input_tokens: Option<u64>,
},
RunEnd {
result: RunResult,