feat: add codex image tool (#650)

This commit is contained in:
Kevin Lin
2026-01-22 18:05:49 -08:00
committed by GitHub
parent e32b10f931
commit e735bb7c66
8 changed files with 77 additions and 3 deletions

View File

@@ -248,14 +248,14 @@ export function formatArgsDisplay(
}
// Read tools: show file path + any other useful args (limit, offset)
if (isFileReadTool(toolName) && parsed.file_path) {
const filePath = String(parsed.file_path);
if (isFileReadTool(toolName) && (parsed.file_path || parsed.path)) {
const filePath = String(parsed.file_path || parsed.path);
const relativePath = formatDisplayPath(filePath);
// Collect other non-hidden args
const otherArgs: string[] = [];
for (const [k, v] of Object.entries(parsed)) {
if (k === "file_path") continue;
if (k === "file_path" || k === "path") continue;
if (v === undefined || v === null) continue;
if (typeof v === "boolean" || typeof v === "number") {
otherArgs.push(`${k}: ${v}`);

View File

@@ -15,6 +15,7 @@ export function getDisplayToolName(rawName: string): string {
if (rawName === "write") return "Write";
if (rawName === "edit" || rawName === "multi_edit") return "Update";
if (rawName === "read") return "Read";
if (rawName === "view_image" || rawName === "ViewImage") return "View Image";
if (rawName === "bash") return "Bash";
if (rawName === "grep" || rawName === "Grep") return "Search";
if (rawName === "glob" || rawName === "Glob") return "Glob";
@@ -180,6 +181,8 @@ export function isFileReadTool(name: string): boolean {
return (
name === "read" ||
name === "Read" ||
name === "view_image" ||
name === "ViewImage" ||
name === "ReadFile" ||
name === "read_file" ||
name === "read_file_gemini" ||