feat(gui): add Session Insights panel with token history tracking

This commit is contained in:
2026-03-07 11:17:51 -05:00
parent d6cdbf21d7
commit 9aea9b6210
2 changed files with 47 additions and 0 deletions

View File

@@ -333,6 +333,7 @@ class App:
self._render_token_budget_panel()
self._render_cache_panel()
self._render_tool_analytics_panel()
self._render_session_insights_panel()
if imgui.collapsing_header("System Prompts"):
self._render_system_prompts_panel()
@@ -1509,6 +1510,19 @@ class App:
imgui.text("0%")
imgui.end_table()
def _render_session_insights_panel(self) -> None:
if not imgui.collapsing_header("Session Insights"):
return
insights = self.controller.get_session_insights()
imgui.text(f"Total Tokens: {insights.get('total_tokens', 0):,}")
imgui.text(f"API Calls: {insights.get('call_count', 0)}")
imgui.text(f"Burn Rate: {insights.get('burn_rate', 0):.0f} tokens/min")
imgui.text(f"Session Cost: ${insights.get('session_cost', 0):.4f}")
completed = insights.get('completed_tickets', 0)
efficiency = insights.get('efficiency', 0)
imgui.text(f"Completed: {completed}")
imgui.text(f"Tokens/Ticket: {efficiency:.0f}" if efficiency > 0 else "Tokens/Ticket: N/A")
def _render_message_panel(self) -> None:
# LIVE indicator
is_live = self.ai_status in ["running powershell...", "fetching url...", "searching web...", "powershell done, awaiting AI..."]