Add tokens consumed and context percentage to per-tool timing footer
The per-tool timing line now shows:
- Tokens delta (tokens added to context by this tool call)
- Context window usage percentage
Example: └─ ⚡️ 1ms 523tk | 49% ctx
Changes:
- Updated UiWriter trait print_tool_timing signature
- Track tokens before/after adding tool messages to calculate delta
- Updated ConsoleUiWriter, MachineUiWriter, PlannerUiWriter, and test mocks
This commit is contained in:
@@ -265,7 +265,7 @@ impl g3_core::ui_writer::UiWriter for PlannerUiWriter {
|
||||
fn update_tool_output_line(&self, _line: &str) {}
|
||||
fn print_tool_output_line(&self, _line: &str) {}
|
||||
fn print_tool_output_summary(&self, _hidden_count: usize) {}
|
||||
fn print_tool_timing(&self, _duration_str: &str) {}
|
||||
fn print_tool_timing(&self, _duration_str: &str, _tokens_delta: u32, _context_percentage: f32) {}
|
||||
|
||||
fn print_agent_prompt(&self) {
|
||||
// No-op - don't add extra blank lines
|
||||
|
||||
Reference in New Issue
Block a user