From 9ae6f9da05488953f799fbf99617615f4a240432 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 2 Mar 2026 11:16:54 -0500 Subject: [PATCH] conductor(plan): Mark Phase 1 tasks complete [context_token_viz_20260301] 5bfb20f --- conductor/tracks/context_token_viz_20260301/plan.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conductor/tracks/context_token_viz_20260301/plan.md b/conductor/tracks/context_token_viz_20260301/plan.md index 3e35446..d41249a 100644 --- a/conductor/tracks/context_token_viz_20260301/plan.md +++ b/conductor/tracks/context_token_viz_20260301/plan.md @@ -4,10 +4,10 @@ Architecture reference: [docs/guide_architecture.md](../../docs/guide_architectu ## Phase 1: Token Budget Display -- [x] Task 1.1: Add a new method `_render_token_budget_panel(self)` in `gui_2.py`. Place it in the Provider panel area (after `_render_provider_panel`, gui_2.py:2485-2542), or as a new collapsible section within the provider panel. Call `ai_client.get_history_bleed_stats(self._last_stable_md)` — need to cache `self._last_stable_md` from the last `_do_generate()` call (gui_2.py:1408-1425, the `stable_md` return value). Store the result in `self._token_stats: dict = {}`, refreshed on each `_do_generate` call and on provider/model switch. -- [x] Task 1.2: Render the utilization bar. Use `imgui.progress_bar(stats['utilization_pct'] / 100, ImVec2(-1, 0), f"{stats['utilization_pct']:.1f}%")`. Color-code via `imgui.push_style_color(imgui.Col_.plot_histogram, ...)`: green if <50%, yellow if 50-80%, red if >80%. Below the bar, show: `f"{stats['estimated_prompt_tokens']:,} / {stats['max_prompt_tokens']:,} tokens ({stats['headroom_tokens']:,} remaining)"`. -- [x] Task 1.3: Render the proportion breakdown as a 3-row table: System (`system_tokens`), Tools (`tools_tokens`), History (`history_tokens`). Each row shows token count and percentage of total. Use `imgui.begin_table("token_breakdown", 3)` with columns: Component, Tokens, Pct. -- [~] Task 1.4: Write tests verifying `_render_token_budget_panel` calls `get_history_bleed_stats` and handles the empty dict case (when no provider is configured). +- [x] Task 1.1: Add a new method `_render_token_budget_panel(self)` in `gui_2.py`. 5bfb20f Place it in the Provider panel area (after `_render_provider_panel`, gui_2.py:2485-2542), or as a new collapsible section within the provider panel. Call `ai_client.get_history_bleed_stats(self._last_stable_md)` — need to cache `self._last_stable_md` from the last `_do_generate()` call (gui_2.py:1408-1425, the `stable_md` return value). Store the result in `self._token_stats: dict = {}`, refreshed on each `_do_generate` call and on provider/model switch. +- [x] Task 1.2: Render the utilization bar. 5bfb20f Use `imgui.progress_bar(stats['utilization_pct'] / 100, ImVec2(-1, 0), f"{stats['utilization_pct']:.1f}%")`. Color-code via `imgui.push_style_color(imgui.Col_.plot_histogram, ...)`: green if <50%, yellow if 50-80%, red if >80%. Below the bar, show: `f"{stats['estimated_prompt_tokens']:,} / {stats['max_prompt_tokens']:,} tokens ({stats['headroom_tokens']:,} remaining)"`. +- [x] Task 1.3: Render the proportion breakdown as a 3-row table. 5bfb20f: System (`system_tokens`), Tools (`tools_tokens`), History (`history_tokens`). Each row shows token count and percentage of total. Use `imgui.begin_table("token_breakdown", 3)` with columns: Component, Tokens, Pct. +- [x] Task 1.4: Write tests verifying `_render_token_budget_panel`. 5bfb20f calls `get_history_bleed_stats` and handles the empty dict case (when no provider is configured). ## Phase 2: Trimming Preview & Cache Status