Improve tool output formatting

1. str_replace: Show insertion/deletion counts with colors
   " +N insertions | -M deletions" (green/red)

2. write_file: Compact format with human-readable sizes
   " wrote N lines | Xk chars"

3. read_file: Cleaner format
   "🔍 N lines read" instead of "📄 File content (N lines)"

4. webdriver_quit: Show correct driver name (safaridriver vs chromedriver)

5. read_file: When start position exceeds file length, read last 100 chars
   with explanation instead of failing

6. shell: Remove redundant "Command failed:" prefix from error messages
This commit is contained in:
Dhanji R. Prasanna
2026-01-11 19:52:00 +05:30
parent 7c960875ef
commit ed1c31dd70
3 changed files with 45 additions and 17 deletions

View File

@@ -61,7 +61,7 @@ pub async fn execute_shell<W: UiWriter>(tool_call: &ToolCall, ctx: &ToolContext<
result.stdout.trim().to_string()
})
} else {
Ok(format!(" Command failed: {}", result.stderr.trim()))
Ok(format!("{}", result.stderr.trim()))
}
}
Err(e) => Ok(format!("❌ Execution error: {}", e)),