# 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