From deac5ff585e836892b5d0143ed3baf4195080f73 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 3 Dec 2025 10:12:27 +0000 Subject: [PATCH] Verbose: shorten home paths in tool meta --- src/auto-reply/command-reply.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/auto-reply/command-reply.ts b/src/auto-reply/command-reply.ts index d3d5a2360..5b5063f39 100644 --- a/src/auto-reply/command-reply.ts +++ b/src/auto-reply/command-reply.ts @@ -93,11 +93,19 @@ function inferToolMeta(message?: ToolMessageLike): string | undefined { const limit = details && typeof details.limit === "number" ? details.limit : undefined; const command = details && typeof details.command === "string" ? details.command : undefined; + const formatPath = (p: string) => { + const home = process.env.HOME; + if (home && p.startsWith(home + "/")) return p.replace(home, "~"); + if (home && p === home) return "~"; + return p; + }; + if (pathVal) { + const displayPath = formatPath(pathVal); if (offset !== undefined && limit !== undefined) { - return `${pathVal}:${offset}-${offset + limit}`; + return `${displayPath}:${offset}-${offset + limit}`; } - return pathVal; + return displayPath; } if (command) return command; return undefined;