# 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 `...`, `...`, 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 `` 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).