feat(gui): Implement per-response token metrics and AI discussion compression
- Display token metrics (input/output/cache) per response in Discussion Hub. - Add total Discussion Token usage in the panel header. - Implement 'Compress' feature to intelligently summarize and replace exhausted discussion histories using an AI subagent.
This commit is contained in:
+1
-1
@@ -308,7 +308,7 @@ This file tracks all major tracks for the project. Each track has its own detail
|
||||
|
||||
---
|
||||
|
||||
- [ ] **Track: Add per-response token metrics and AI-assisted history compression**
|
||||
- [x] **Track: Add per-response token metrics and AI-assisted history compression**
|
||||
*Link: [./tracks/discussion_metrics_and_compression_20260601/](./tracks/discussion_metrics_and_compression_20260601/)*
|
||||
|
||||
---
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Implementation Plan: Discussion Metrics and Compression
|
||||
|
||||
## Phase 1: Metrics Visibility
|
||||
- [ ] Task: Update UI for Token Metrics
|
||||
- [ ] Modify `_render_comms_history_panel` and `render_discussion_entry` in `src/gui_2.py` to extract and prominently display `usage` stats (input, output, cache) from the entry payloads.
|
||||
- [x] Task: Update UI for Token Metrics
|
||||
- [x] Modify `_render_comms_history_panel` and `render_discussion_entry` in `src/gui_2.py` to extract and prominently display `usage` stats (input, output, cache) from the entry payloads.
|
||||
|
||||
## Phase 2: Compression Helper Agent
|
||||
- [ ] Task: Implement Compression Agent
|
||||
- [ ] Create a new agent definition or function in `src/ai_client.py` (or a dedicated module) capable of receiving a discussion history and a system prompt instructing it to summarize and compact the history.
|
||||
- [ ] Task: Implement UI Triggers
|
||||
- [ ] Add a "Compress Discussion" button to the Discussion Hub UI.
|
||||
- [ ] Wire the button to dispatch the compression task to the background executor and display a loading indicator.
|
||||
- [ ] Upon completion, replace the older entries with the generated summary block.
|
||||
- [x] Task: Implement Compression Agent
|
||||
- [x] Create a new agent definition or function in `src/ai_client.py` (or a dedicated module) capable of receiving a discussion history and a system prompt instructing it to summarize and compact the history.
|
||||
- [x] Task: Implement UI Triggers
|
||||
- [x] Add a "Compress Discussion" button to the Discussion Hub UI.
|
||||
- [x] Wire the button to dispatch the compression task to the background executor and display a loading indicator.
|
||||
- [x] Upon completion, replace the older entries with the generated summary block.
|
||||
|
||||
## Phase 3: Verification
|
||||
- [ ] Task: Verification
|
||||
- [ ] Verify token metrics are visible per response.
|
||||
- [ ] Run the "Compress Discussion" tool on a heavy discussion and verify the history is successfully summarized without losing core context.
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Verification' (Protocol in workflow.md)
|
||||
- [x] Task: Verification
|
||||
- [x] Verify token metrics are visible per response.
|
||||
- [x] Run the "Compress Discussion" tool on a heavy discussion and verify the history is successfully summarized without losing core context.
|
||||
- [x] Task: Conductor - User Manual Verification 'Phase 3: Verification' (Protocol in workflow.md)
|
||||
Reference in New Issue
Block a user