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,