fix: compact plan and todo tool header args (#1031)
This commit is contained in:
@@ -7,13 +7,19 @@ import {
|
||||
isFileReadTool,
|
||||
isFileWriteTool,
|
||||
isPatchTool,
|
||||
isPlanTool,
|
||||
isShellTool,
|
||||
isTodoTool,
|
||||
} from "./toolNameMapping.js";
|
||||
|
||||
// Small helpers
|
||||
const isRecord = (v: unknown): v is Record<string, unknown> =>
|
||||
typeof v === "object" && v !== null;
|
||||
|
||||
function formatItemCount(count: number): string {
|
||||
return `${String(count)} item${count === 1 ? "" : "s"}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a file path for display (matches Claude Code style):
|
||||
* - Files within cwd: relative path without ./ prefix
|
||||
@@ -280,6 +286,18 @@ export function formatArgsDisplay(
|
||||
return { display, parsed };
|
||||
}
|
||||
|
||||
// Plan tools: only show compact plan item count.
|
||||
if (isPlanTool(toolName) && Array.isArray(parsed.plan)) {
|
||||
display = formatItemCount(parsed.plan.length);
|
||||
return { display, parsed };
|
||||
}
|
||||
|
||||
// Todo tools: only show compact todo item count.
|
||||
if (isTodoTool(toolName) && Array.isArray(parsed.todos)) {
|
||||
display = formatItemCount(parsed.todos.length);
|
||||
return { display, parsed };
|
||||
}
|
||||
|
||||
// Shell/Bash tools: show just the command
|
||||
if (isShellTool(toolName) && parsed.command) {
|
||||
// Handle both string and array command formats
|
||||
|
||||
Reference in New Issue
Block a user