From 11d84b3b1635d698c8e0fa321cd92d68738a28ec Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 10 Sep 2025 19:26:50 -0700 Subject: [PATCH] feat: empty diff tool result message --- core/tools/implementations/viewDiff.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/tools/implementations/viewDiff.ts b/core/tools/implementations/viewDiff.ts index 9df82e78d..7d9b5256e 100644 --- a/core/tools/implementations/viewDiff.ts +++ b/core/tools/implementations/viewDiff.ts @@ -9,6 +9,17 @@ export const viewDiffImpl: ToolImpl = async (args, extras) => { // TODO includeUnstaged should be an option const combinedDiff = diffs.join("\n"); + + if (!combinedDiff.trim()) { + return [ + { + name: "Diff", + description: "current Git diff", + content: "The current diff is empty", + }, + ]; + } + const diffLines = combinedDiff.split("\n"); let truncated = false;