conductor(checkpoint): Checkpoint end of Phase 1 (Directory Migration)

This commit is contained in:
2026-05-07 21:37:58 -04:00
parent 49acb884e1
commit 2065dd8559
119 changed files with 3 additions and 3 deletions
@@ -0,0 +1,16 @@
{
"name": "system_context_exposure",
"created": "2026-03-22",
"status": "future",
"priority": "medium",
"affected_files": [
"src/ai_client.py",
"src/gui_2.py",
"src/models.py"
],
"related_tracks": [
"discussion_hub_panel_reorganization (in_progress)",
"aggregation_smarter_summaries (future)"
],
"notes": "Deferred from discussion_hub_panel_reorganization planning. The _SYSTEM_PROMPT in ai_client.py is hidden from users - this exposes it for customization."
}
@@ -0,0 +1,41 @@
# Implementation Plan: System Context Exposure
## Phase 1: Backend Changes [checkpoint: a0fb086]
Focus: Make _SYSTEM_PROMPT configurable
- [x] Task: Audit ai_client.py system prompt flow b654c7c
- [x] Task: Move _SYSTEM_PROMPT to configurable storage 4f1bcea
- [x] Task: Implement load/save of base system prompt 4f1bcea
- [x] Task: Modify _get_combined_system_prompt() to use config 4f1bcea
- [x] Task: Write tests for configurable system prompt 4f1bcea
- [x] Task: Conductor - User Manual Verification 'Phase 1: Backend Changes' a0fb086
## Phase 2: UI Implementation [checkpoint: c3a114d]
Focus: Add base prompt editor to AI Settings
- [x] Task: Add UI controls to _render_system_prompts_panel c74971b
- [x] Task: Implement checkbox for "Use Default Base" c74971b
- [x] Task: Implement collapsible base prompt editor c74971b
- [x] Task: Add "Reset to Default" button c74971b
- [x] Task: Write tests for UI controls c74971b
- [x] Task: Conductor - User Manual Verification 'Phase 2: UI Implementation' c3a114d
## Phase 3: Persistence & Provider Testing [checkpoint: 40db835]
Focus: Ensure persistence and cross-provider compatibility
- [x] Task: Verify base prompt persists across app restarts e24ea60
- [x] Task: Test with Gemini provider e24ea60
- [x] Task: Test with Anthropic provider e24ea60
- [x] Task: Test with DeepSeek provider e24ea60
- [x] Task: Test with Gemini CLI adapter e24ea60
- [x] Task: Conductor - User Manual Verification 'Phase 3: Persistence & Provider Testing' 40db835
## Phase 4: Safety & Defaults [checkpoint: 2441ea6]
Focus: Ensure users can recover from bad edits
- [x] Task: Implement confirmation dialog before saving custom base 68d18f4
- [x] Task: Add validation for empty/invalid prompts 68d18f4
- [x] Task: Document the base prompt purpose in UI 68d18f4
- [x] Task: Add "Show Diff" between default and custom 68d18f4
- [x] Task: Write tests for safety features 68d18f4
- [x] Task: Conductor - User Manual Verification 'Phase 4: Safety & Defaults' 2441ea6
@@ -0,0 +1,120 @@
# Specification: System Context Exposure
## 1. Overview
This track exposes the hidden system prompt from `ai_client.py` to users for customization.
**Current Problem:**
- `_SYSTEM_PROMPT` in `ai_client.py` (lines ~118-143) is hardcoded
- It contains foundational instructions: "You are a helpful coding assistant with access to a PowerShell tool..."
- Users can only see/appending their custom portion via `_custom_system_prompt`
- The base prompt that defines core agent capabilities is invisible
**Goal:**
- Make `_SYSTEM_PROMPT` visible and editable in the UI
- Allow users to customize the foundational agent instructions
- Maintain sensible defaults while enabling expert customization
## 2. Current State Audit
### Hidden System Prompt Location
`src/ai_client.py`:
```python
_SYSTEM_PROMPT: str = (
"You are a helpful coding assistant with access to a PowerShell tool (run_powershell) and MCP tools (file access: read_file, list_directory, search_files, get_file_summary, web access: web_search, fetch_url). "
"When calling file/directory tools, always use the 'path' parameter for the target path. "
...
)
```
### Related State
- `_custom_system_prompt` - user-defined append/injection
- `_get_combined_system_prompt()` - merges both
- `set_custom_system_prompt()` - setter for user portion
### UI Current State
- AI Settings → System Prompts shows global and project prompts
- These are injected as `[USER SYSTEM PROMPT]` after `_SYSTEM_PROMPT`
- But `_SYSTEM_PROMPT` itself is never shown
## 3. Functional Requirements
### 3.1 Base System Prompt Visibility
- Add "Base System Prompt" section in AI Settings
- Display current `_SYSTEM_PROMPT` content
- Allow editing with syntax highlighting (it's markdown text)
### 3.2 Default vs Custom Base
- Maintain default base prompt as reference
- User can reset to default if they mess it up
- Show diff between default and custom
### 3.3 Persistence
- Custom base prompt stored in config or project TOML
- Loaded on app start
- Applied before `_custom_system_prompt` in `_get_combined_system_prompt()`
### 3.4 Provider Considerations
- Some providers handle system prompts differently
- Verify behavior across Gemini, Anthropic, DeepSeek
- May need provider-specific base prompts
## 4. Data Model
### 4.1 Config Storage
```toml
[ai_settings]
base_system_prompt = """..."""
use_default_base = true
```
### 4.2 Combined Prompt Order
1. `_SYSTEM_PROMPT` (or custom base if enabled)
2. `[USER SYSTEM PROMPT]` (from AI Settings global/project)
3. Tooling strategy (from bias engine)
## 5. UI Design
**Location:** AI Settings panel → System Prompts section
```
┌─ System Prompts ──────────────────────────────┐
│ ☑ Use Default Base System Prompt │
│ │
│ Base System Prompt (collapsed by default): │
│ ┌──────────────────────────────────────────┐ │
│ │ You are a helpful coding assistant... │ │
│ └──────────────────────────────────────────┘ │
│ │
│ [Show Editor] [Reset to Default] │
│ │
│ Global System Prompt: │
│ ┌──────────────────────────────────────────┐ │
│ │ [current global prompt content] │ │
│ └──────────────────────────────────────────┘ │
└──────────────────────────────────────────────┘
```
When "Show Editor" clicked:
- Expand to full editor for base prompt
- Syntax highlighting for markdown
- Character count
## 6. Acceptance Criteria
- [ ] `_SYSTEM_PROMPT` visible in AI Settings
- [ ] User can edit base system prompt
- [ ] Changes persist across app restarts
- [ ] "Reset to Default" restores original
- [ ] Provider APIs receive modified prompt correctly
- [ ] No regression in agent behavior with defaults
## 7. Out of Scope
- Changes to actual agent behavior logic
- Changes to tool definitions or availability
- Changes to aggregation or context handling
## 8. Dependencies
- `ai_client.py` - `_SYSTEM_PROMPT` and `_get_combined_system_prompt()`
- `gui_2.py` - AI Settings panel rendering
- `models.py` - Config structures