2.8 KiB
2.8 KiB
Planner Mode UI Output Fixes
Phase 1: Read and Understand Current Code
- Read crates/g3-planner/src/llm.rs
- Read crates/g3-planner/src/planner.rs
- Read crates/g3-core/src/lib.rs (logs directory function)
Phase 2: Fix Tool Call Display (Single Line Output)
- Modify
PlannerUiWriter::print_tool_header()in crates/g3-planner/src/llm.rs- Change implementation to use proper single-line formatting
- Truncate args at char boundary (use char_indices)
- Use
println!with explicit single line format - Add flush after output
- Fix import for std::io::Write
Phase 3: Fix LLM Text Response Display
- Modify
PlannerUiWriter::print_agent_response()in crates/g3-planner/src/llm.rs- Change from
println!()toprint!()to avoid extra newlines - Keep the flush for real-time display
- Ensure no carriage returns or status line clearing
- Change from
Phase 4: Fix Logs Directory Location
- Debug where logs are actually being written
- Add debug prints to verify G3_WORKSPACE_PATH is set
- Add debug prints in get_logs_dir() to show what path is returned
- Build succeeded - compilation verified
Phase 5: Testing Instructions
The code has been successfully modified and compiled. To test:
-
Test tool call display:
cd /tmp g3 --planning --codepath ~/RustroverProjects/g3- Verify tool calls appear on single lines like:
🔧 [1] read_file {"file_path":"/path/to/file"} - Verify NO extra blank lines between tool calls
- Verify tool calls appear on single lines like:
-
Test LLM text response:
- Verify LLM explanatory text appears as contiguous, readable text
- Verify no text is overwritten or mangled
-
Test logs directory:
- Run:
rm -rf ~/RustroverProjects/g3/logs/*.log ~/RustroverProjects/g3/logs/*.txt - Run:
cd /tmp && g3 --planning --codepath ~/RustroverProjects/g3 - Check debug output shows:
🔍 DEBUG: Set G3_WORKSPACE_PATH to: ... - Check:
ls ~/RustroverProjects/g3/logs/- should contain log files - Check:
ls /tmp/logs/- should NOT exist or be empty
- Run:
-
After testing succeeds:
- Remove debug print statements from:
- crates/g3-planner/src/planner.rs (2 debug prints)
- crates/g3-core/src/lib.rs (2 debug prints in get_logs_dir)
- Rebuild:
cargo build --release
- Remove debug print statements from:
Summary of Changes
Files Modified:
-
crates/g3-planner/src/llm.rs
- Fixed
print_tool_header(): Uses char_indices for safe truncation, always shows args - Fixed
print_agent_response(): Changed toprint!()instead ofprintln!() - Added
use std::io::Write;import
- Fixed
-
crates/g3-planner/src/planner.rs
- Added debug prints to verify G3_WORKSPACE_PATH is set (temporary)
-
crates/g3-core/src/lib.rs
- Added debug prints to get_logs_dir() (temporary)