Refine planner mode UI and error handling
Improve planner mode user experience with better error reporting, cleaner tool output, and consistent log file placement. - Propagate and display classified LLM errors to users with appropriate icons and context - Display tool calls on single lines with truncated arguments - Show LLM text responses without overwriting via UiWriter - Ensure all logs write to workspace/logs directory consistently - Set G3_WORKSPACE_PATH early in planning mode initialization
This commit is contained in:
42
g3-plan/completed_todo_2025-12-09_22-43-24.md
Normal file
42
g3-plan/completed_todo_2025-12-09_22-43-24.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Planner Mode UI and Error Handling Refinements
|
||||
|
||||
## 1. Error Propagation from LLM Calls
|
||||
- [x] Add error handling to `call_refinement_llm_with_tools()` in `crates/g3-planner/src/llm.rs`
|
||||
- [x] Import `classify_error` and `ErrorType` from `g3_core::error_handling`
|
||||
- [x] Wrap agent execution with error classification
|
||||
- [x] Display user-friendly error messages based on error type
|
||||
|
||||
## 2. Single-Line Tool Output Display
|
||||
- [x] Modify `print_tool_header()` in `PlannerUiWriter` to accept tool arguments
|
||||
- [x] Change signature to accept `tool_args: Option<&serde_json::Value>`
|
||||
- [x] Format output as single line with first 50 chars of args
|
||||
- [x] Ensure no trailing newlines
|
||||
- [x] Update UiWriter trait and all implementations
|
||||
- [x] Update call site in g3-core to pass tool args
|
||||
|
||||
## 3. Display LLM Text Responses
|
||||
- [x] Fix `print_agent_response()` to prevent overwriting
|
||||
- [x] Use `println` instead of `print` to avoid overwriting
|
||||
- [x] Review `notify_sse_received()` for carriage return issues
|
||||
- [x] Update `print_status_line()` to use proper formatting
|
||||
|
||||
## 4. Consistent Workspace Logs Directory
|
||||
- [x] Set `G3_WORKSPACE_PATH` early in `run_planning_mode()`
|
||||
- [x] Move env var setting before provider initialization
|
||||
- [x] Create logs directory and verify it exists
|
||||
- [x] Add user notification about logs directory
|
||||
- [x] Remove duplicate G3_WORKSPACE_PATH setting in coach_player_loop
|
||||
|
||||
## Testing
|
||||
- [x] Test error display with rate limit scenario
|
||||
- [x] Test tool output formatting
|
||||
- [x] Test text response visibility
|
||||
- [x] Verify logs are written to workspace/logs directory
|
||||
|
||||
## Summary
|
||||
All implementations complete and verified:
|
||||
- Error handling with `classify_error()` properly integrated
|
||||
- Tool output displays on single line with args preview
|
||||
- Text responses use println to avoid overwrites
|
||||
- Workspace path set early, logs directory created consistently
|
||||
- Code compiles successfully with no errors
|
||||
Reference in New Issue
Block a user