From d1a49c45ff6e6d1448831207417355c2d650f26b Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 29 Dec 2025 22:09:31 +0100 Subject: [PATCH] Append file lists to summary text for LLM context and TUI display Files are included both: - In summary text as / tags (visible to LLM and TUI) - In details for structured access by code --- .../src/core/compaction/branch-summarization.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/src/core/compaction/branch-summarization.ts b/packages/coding-agent/src/core/compaction/branch-summarization.ts index a0a750e6..4cb66dbf 100644 --- a/packages/coding-agent/src/core/compaction/branch-summarization.ts +++ b/packages/coding-agent/src/core/compaction/branch-summarization.ts @@ -361,16 +361,28 @@ export async function generateBranchSummary( return { error: response.errorMessage || "Summarization failed" }; } - const summary = response.content + let summary = response.content .filter((c): c is { type: "text"; text: string } => c.type === "text") .map((c) => c.text) .join("\n"); - // Compute file lists for details + // Compute file lists const modified = new Set([...fileOps.edited, ...fileOps.written]); const readOnly = [...fileOps.read].filter((f) => !modified.has(f)).sort(); const modifiedFiles = [...modified].sort(); + // Append file lists to summary text (for LLM context and TUI display) + const fileSections: string[] = []; + if (readOnly.length > 0) { + fileSections.push(`\n${readOnly.join("\n")}\n`); + } + if (modifiedFiles.length > 0) { + fileSections.push(`\n${modifiedFiles.join("\n")}\n`); + } + if (fileSections.length > 0) { + summary += `\n\n${fileSections.join("\n\n")}`; + } + return { summary: summary || "No summary generated", readFiles: readOnly,