diff --git a/crates/tui/src/commands/debug.rs b/crates/tui/src/commands/debug.rs index 615165c2..7af8f064 100644 --- a/crates/tui/src/commands/debug.rs +++ b/crates/tui/src/commands/debug.rs @@ -73,7 +73,10 @@ pub fn tokens(app: &mut App) -> CommandResult { .replace("{total}", &app.session.total_tokens.to_string()) .replace( "{cost}", - &app.format_cost_amount_precise(app.session_cost_for_currency(app.cost_currency)), + &app.format_cost_amount_precise( + app.session_cost_for_currency(app.cost_currency) + + app.subagent_cost_for_currency(app.cost_currency), + ), ) .replace("{api_messages}", &message_count.to_string()) .replace("{chat_messages}", &chat_count.to_string()) @@ -83,9 +86,11 @@ pub fn tokens(app: &mut App) -> CommandResult { /// Show session cost breakdown pub fn cost(app: &mut App) -> CommandResult { + let total = app.session_cost_for_currency(app.cost_currency) + + app.subagent_cost_for_currency(app.cost_currency); let report = tr(app.ui_locale, MessageId::CmdCostReport).replace( "{cost}", - &app.format_cost_amount_precise(app.session_cost_for_currency(app.cost_currency)), + &app.format_cost_amount_precise(total), ); CommandResult::message(report) } diff --git a/crates/tui/src/tui/sidebar.rs b/crates/tui/src/tui/sidebar.rs index daf28436..0fd68124 100644 --- a/crates/tui/src/tui/sidebar.rs +++ b/crates/tui/src/tui/sidebar.rs @@ -671,9 +671,9 @@ fn render_context_panel(f: &mut Frame, area: Rect, app: &App) { ))); // ── Session cost ───────────────────────────────────────────── - let total_cost = app.displayed_session_cost_for_currency(app.cost_currency); let session_cost = app.session_cost_for_currency(app.cost_currency); let agent_cost = app.subagent_cost_for_currency(app.cost_currency); + let total_cost = session_cost + agent_cost; lines.push(Line::from(Span::styled( format!( "cost: {} (session {} + agents {})",