chore(conductor): Add new track 'Rich Thinking Trace Handling'
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Track thinking_trace_handling_20260313 Context
|
||||
|
||||
- [Specification](./spec.md)
|
||||
- [Implementation Plan](./plan.md)
|
||||
- [Metadata](./metadata.json)
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"track_id": "thinking_trace_handling_20260313",
|
||||
"type": "feature",
|
||||
"status": "new",
|
||||
"created_at": "2026-03-13T13:28:00Z",
|
||||
"updated_at": "2026-03-13T13:28:00Z",
|
||||
"description": "Properly section and handle 'agent thinking' responses from the ai. Right now we just have <thinking> indicators not sure if thats a bodge or if there is a richer way we could be handling this..."
|
||||
}
|
||||
26
conductor/tracks/thinking_trace_handling_20260313/plan.md
Normal file
26
conductor/tracks/thinking_trace_handling_20260313/plan.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Implementation Plan: Rich Thinking Trace Handling
|
||||
|
||||
## Phase 1: Core Parsing & Model Update
|
||||
- [ ] Task: Audit `src/models.py` and `src/project_manager.py` to identify current message serialization schemas.
|
||||
- [ ] Task: Write Tests: Verify that raw AI responses with `<thinking>`, `<thought>`, and `Thinking:` markers are correctly parsed into segmented data structures (Thinking vs. Response).
|
||||
- [ ] Task: Implement: Add `ThinkingSegment` model and update `ChatMessage` schema in `src/models.py` to support optional thinking traces.
|
||||
- [ ] Task: Implement: Update parsing logic in `src/ai_client.py` or 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 `ProjectManager` correctly serializes and deserializes messages with thinking segments to/from TOML history files.
|
||||
- [ ] Task: Implement: Update `src/project_manager.py` to handle the new `ChatMessage` schema during session save/load.
|
||||
- [ ] Task: Implement: Ensure `src/aggregate.py` or 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_trace` helper in `src/gui_2.py` using 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)
|
||||
31
conductor/tracks/thinking_trace_handling_20260313/spec.md
Normal file
31
conductor/tracks/thinking_trace_handling_20260313/spec.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Specification: Rich Thinking Trace Handling
|
||||
|
||||
## Overview
|
||||
Implement a formal system for parsing, storing, and rendering "agent thinking" monologues (chains of thought) within the Manual Slop GUI. Currently, thinking traces are treated as raw text or simple markers. This track will introduce a structured UI pattern to separate internal monologue from direct user responses while preserving both for future context.
|
||||
|
||||
## Functional Requirements
|
||||
- **Multi-Format Parsing:** Support extraction of thinking traces from `<thinking>...</thinking>`, `<thought>...</thought>`, and blocks prefixed with `Thinking:`.
|
||||
- **Integrated UI Rendering:**
|
||||
- In the **Comms History** and **Discussion Hub**, thinking traces must be rendered in a distinct, collapsible section.
|
||||
- The section should be **Collapsed by Default** to minimize visual noise.
|
||||
- Thinking traces must be visually separated from the "visible" response (e.g., using a tinted background, border, or specialized header).
|
||||
- **Persistent State Management:**
|
||||
- Both the thinking monologue and the final response must be saved to the permanent discussion history (`manual_slop_history.toml` or `project_history.toml`).
|
||||
- History entries must be properly tagged/schematized to distinguish between thinking and output.
|
||||
- **Context Recurrence:**
|
||||
- Thinking traces must be included in subsequent AI turns (Full Recurrence) to maintain the model's internal state and logical progression.
|
||||
|
||||
## Non-Functional Requirements
|
||||
- **Performance:** Parsing and rendering of thinking blocks must not introduce visible latency in the GUI thread.
|
||||
- **Accessibility:** All thinking blocks must remain selectable and copyable via the standard high-fidelity selectable UI pattern.
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] AI responses containing `<thinking>` or similar tags are automatically parsed into separate segments.
|
||||
- [ ] A "Thinking..." header appears in the Discussion Hub for messages with monologues.
|
||||
- [ ] Clicking the header expands the full thinking trace.
|
||||
- [ ] Saving/Loading a project preserves the distinction between thinking and response.
|
||||
- [ ] Subsequent AI calls receive the thinking trace as part of the conversation history.
|
||||
|
||||
## Out of Scope
|
||||
- Implementing "Hidden Thinking" (where the user cannot see it but the AI can).
|
||||
- Real-time "Streaming" of thinking into the UI (unless already supported by the active provider).
|
||||
Reference in New Issue
Block a user