Add fromHook field to CompactionEntry and BranchSummaryEntry
- fromHook: true = hook generated, skip file extraction - fromHook: undefined/false = pi generated, extract files (backward compatible) - branchWithSummary now accepts fromHook parameter - File extraction only runs for !entry.fromHook entries
This commit is contained in:
@@ -215,8 +215,9 @@ export function prepareBranchEntries(entries: SessionEntry[], tokenBudget: numbe
|
||||
|
||||
// First pass: collect file ops from ALL entries (even if they don't fit in token budget)
|
||||
// This ensures we capture cumulative file tracking from nested branch summaries
|
||||
// Only extract from pi-generated summaries (fromHook !== true), not hook-generated ones
|
||||
for (const entry of entries) {
|
||||
if (entry.type === "branch_summary" && entry.details) {
|
||||
if (entry.type === "branch_summary" && !entry.fromHook && entry.details) {
|
||||
const details = entry.details as BranchSummaryDetails;
|
||||
if (Array.isArray(details.readFiles)) {
|
||||
for (const f of details.readFiles) fileOps.read.add(f);
|
||||
|
||||
Reference in New Issue
Block a user