Phase 06: CLI Interface Gap Closure - 2 plans addressing 3 UAT-identified issues - Session persistence: Add missing set_conversation_history method - Session feedback: Add verbose messaging for session file operations - Resource display: Fix color coding with force_terminal=True - Ready for execution to close CLI interface gaps
133 lines
4.8 KiB
Markdown
133 lines
4.8 KiB
Markdown
---
|
|
phase: 06-cli-interface
|
|
plan: 06
|
|
type: execute
|
|
wave: 1
|
|
depends_on: [06-02, 06-04]
|
|
files_modified: [src/app/__main__.py]
|
|
autonomous: true
|
|
gap_closure: true
|
|
|
|
must_haves:
|
|
truths:
|
|
- "Messages are automatically saved to ~/.mai/session.json during conversation"
|
|
- "Resource usage (CPU, RAM, GPU) displays during conversation with color-coded status"
|
|
artifacts:
|
|
- path: "src/app/__main__.py"
|
|
provides: "CLI with enhanced session feedback and color-coded resource display"
|
|
contains: "Console(force_terminal=True), session file feedback messages"
|
|
key_links:
|
|
- from: "src/app/__main__.py"
|
|
to: "session file creation"
|
|
via: "Verbose feedback for session operations"
|
|
pattern: "session.*created|saved|loaded"
|
|
- from: "src/app/__main__.py"
|
|
to: "resource display"
|
|
via: "Console with force_terminal=True for color support"
|
|
pattern: "Console.*force_terminal=True"
|
|
---
|
|
|
|
<objective>
|
|
Enhance CLI user feedback for session operations and fix color-coded resource display
|
|
|
|
Purpose: Address two UX issues - users can't see when/where session files are created, and resource monitoring lacks color coding in terminal
|
|
Output: CLI with clear session feedback and working color-coded resource monitoring
|
|
</objective>
|
|
|
|
<execution_context>
|
|
@~/.opencode/get-shit-done/workflows/execute-plan.md
|
|
@~/.opencode/get-shit-done/templates/summary.md
|
|
</execution_context>
|
|
|
|
<context>
|
|
@.planning/PROJECT.md
|
|
@.planning/ROADMAP.md
|
|
@.planning/STATE.md
|
|
|
|
# Gap closure context from UAT
|
|
@.planning/phases/06-cli-interface/06-UAT.md
|
|
|
|
# Previous session persistence and resource monitoring implementations
|
|
@.planning/phases/06-cli-interface/06-02-SUMMARY.md
|
|
@.planning/phases/06-cli-interface/06-04-SUMMARY.md
|
|
</context>
|
|
|
|
<tasks>
|
|
|
|
<task type="auto">
|
|
<name>Add verbose session feedback and fix resource display colors</name>
|
|
<files>src/app/__main__.py</files>
|
|
<action>
|
|
Fix two issues in src/app/__main__.py:
|
|
|
|
1. **Enhance session feedback** - Add user-friendly messaging for session operations:
|
|
- When creating new session: "Session created at ~/.mai/session.json"
|
|
- When loading existing session: "Session loaded from ~/.mai/session.json"
|
|
- When saving session: "Conversation saved to ~/.mai/session.json"
|
|
- Enhance /session command to display file path and session stats
|
|
- Add feedback for session file creation in ~/.mai directory
|
|
|
|
2. **Fix resource display color coding** - Modify ResourceDisplayManager:
|
|
- Change Console initialization to use Console(force_terminal=True) to force color output
|
|
- This overrides Rich's automatic terminal detection that disables colors in non-terminal environments
|
|
- Ensure rich imports and conditional logic properly handle this change
|
|
|
|
Gap reasons:
|
|
- "Session system works correctly, but users lack clear feedback about when/where session files are created"
|
|
- "Rich console detects is_terminal=False and disables color output automatically"
|
|
|
|
Make sure to preserve existing functionality while adding these improvements.
|
|
</action>
|
|
<verify>
|
|
# Test session feedback displays file path
|
|
echo "Testing session feedback..." && python -c "
|
|
import sys
|
|
sys.path.insert(0, 'src')
|
|
from pathlib import Path
|
|
import json
|
|
|
|
# Check if session feedback logic exists
|
|
with open('src/app/__main__.py', 'r') as f:
|
|
content = f.read()
|
|
if 'Session created at' in content and 'Session loaded from' in content:
|
|
print('✓ Session feedback messages added')
|
|
else:
|
|
print('✗ Session feedback messages missing')
|
|
exit(1)
|
|
|
|
# Check for force_terminal=True
|
|
if 'force_terminal=True' in content:
|
|
print('✓ Console force_terminal=True added')
|
|
else:
|
|
print('✗ Console force_terminal=True missing')
|
|
exit(1)
|
|
"
|
|
</verify>
|
|
<done>
|
|
CLI now provides clear feedback about session file operations and resource monitoring displays with proper color coding
|
|
</done>
|
|
</task>
|
|
|
|
</tasks>
|
|
|
|
<verification>
|
|
Test both fixes by:
|
|
1. Start new CLI session - should see "Session created at ~/.mai/session.json"
|
|
2. Send a message - should see color-coded resource display (not just plain text)
|
|
3. Use /session command - should show file location information
|
|
4. Exit and restart - should see "Session loaded from ~/.mai/session.json"
|
|
|
|
Expected: Clear feedback about session file operations and working color-coded resource monitoring
|
|
</verification>
|
|
|
|
<success_criteria>
|
|
- Session creation displays file path feedback to user
|
|
- Session loading displays file path feedback to user
|
|
- /session command shows file information
|
|
- Resource monitoring uses color-coded status indicators
|
|
- Console initialization uses force_terminal=True for color support
|
|
</success_criteria>
|
|
|
|
<output>
|
|
After completion, create `.planning/phases/06-cli-interface/06-06-SUMMARY.md`
|
|
</output> |