2.4 KiB
2.4 KiB
Implementation Plan: Rich Thinking Trace Handling
Phase 1: Core Parsing & Model Update
- Task: Audit
src/models.pyandsrc/project_manager.pyto identify current message serialization schemas. - Task: Write Tests: Verify that raw AI responses with
<thinking>,<thought>, andThinking:markers are correctly parsed into segmented data structures (Thinking vs. Response). - Task: Implement: Add
ThinkingSegmentmodel and updateChatMessageschema insrc/models.pyto support optional thinking traces. - Task: Implement: Update parsing logic in
src/ai_client.pyor a dedicated utility to extract segments from raw provider responses. - Task: Conductor - User Manual Verification 'Phase 1: Core Parsing & Model Update' (Protocol in workflow.md)
Phase 2: Persistence & History Integration
- Task: Write Tests: Verify that
ProjectManagercorrectly serializes and deserializes messages with thinking segments to/from TOML history files. - Task: Implement: Update
src/project_manager.pyto handle the newChatMessageschema during session save/load. - Task: Implement: Ensure
src/aggregate.pyor relevant context builders include thinking traces in the "Discussion History" sent back to the AI. - Task: Conductor - User Manual Verification 'Phase 2: Persistence & History Integration' (Protocol in workflow.md)
Phase 3: GUI Rendering - Comms & Discussion
- Task: Write Tests: Verify the GUI rendering logic correctly handles messages with and without thinking segments.
- Task: Implement: Create a reusable
_render_thinking_tracehelper insrc/gui_2.pyusing a collapsible header (e.g.,imgui.collapsing_header). - Task: Implement: Integrate the thinking trace renderer into the Comms History panel in
src/gui_2.py. - Task: Implement: Integrate the thinking trace renderer into the Discussion Hub message loop in
src/gui_2.py. - Task: Conductor - User Manual Verification 'Phase 3: GUI Rendering - Comms & Discussion' (Protocol in workflow.md)
Phase 4: Final Polish & Theming
- Task: Implement: Apply specialized styling (e.g., tinted background or italicized text) to expanded thinking traces to distinguish them from direct responses.
- Task: Implement: Ensure thinking trace headers show a "Calculating..." or "Monologue" indicator while an agent is active.
- Task: Conductor - User Manual Verification 'Phase 4: Final Polish & Theming' (Protocol in workflow.md)