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:
@@ -4011,7 +4011,7 @@ impl<W: UiWriter> Agent<W> {
|
||||
// Skip printing tool call details for final_output
|
||||
if tool_call.tool != "final_output" {
|
||||
// Tool call header
|
||||
self.ui_writer.print_tool_header(&tool_call.tool);
|
||||
self.ui_writer.print_tool_header(&tool_call.tool, Some(&tool_call.args));
|
||||
if let Some(args_obj) = tool_call.args.as_object() {
|
||||
for (key, value) in args_obj {
|
||||
let value_str = match value {
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait UiWriter: Send + Sync {
|
||||
fn print_context_thinning(&self, message: &str);
|
||||
|
||||
/// Print a tool execution header
|
||||
fn print_tool_header(&self, tool_name: &str);
|
||||
fn print_tool_header(&self, tool_name: &str, tool_args: Option<&serde_json::Value>);
|
||||
|
||||
/// Print a tool argument
|
||||
fn print_tool_arg(&self, key: &str, value: &str);
|
||||
@@ -81,7 +81,7 @@ impl UiWriter for NullUiWriter {
|
||||
fn print_system_prompt(&self, _prompt: &str) {}
|
||||
fn print_context_status(&self, _message: &str) {}
|
||||
fn print_context_thinning(&self, _message: &str) {}
|
||||
fn print_tool_header(&self, _tool_name: &str) {}
|
||||
fn print_tool_header(&self, _tool_name: &str, _tool_args: Option<&serde_json::Value>) {}
|
||||
fn print_tool_arg(&self, _key: &str, _value: &str) {}
|
||||
fn print_tool_output_header(&self) {}
|
||||
fn update_tool_output_line(&self, _line: &str) {}
|
||||
|
||||
Reference in New Issue
Block a user