mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 03:01:56 +00:00
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:
parent
0445da666c
commit
f118cdc67b
3 changed files with 9 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue