fix(cli): report cumulative total_tokens in stream-json/json output (#8910)
Signed-off-by: Trinity <trinity@multica.ai> Signed-off-by: Bright Zheng <bzqzheng@gmail.com> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -1501,10 +1501,9 @@ impl CliSession {
|
||||
.await
|
||||
}
|
||||
|
||||
// Get the session's total token usage
|
||||
pub async fn get_total_token_usage(&self) -> Result<Option<i32>> {
|
||||
let metadata = self.get_session().await?;
|
||||
Ok(metadata.total_tokens)
|
||||
Ok(metadata.accumulated_total_tokens)
|
||||
}
|
||||
|
||||
/// Display enhanced context usage with session totals
|
||||
|
||||
Reference in New Issue
Block a user