-
Notifications
You must be signed in to change notification settings - Fork 163
Description
Problem
ExtractAllModifiedFiles and CalculateTotalTokenUsage both extract spawned agent IDs from the transcript slice starting at startLine. When startLine > 0 (i.e., after a checkpoint), subagents spawned in earlier turns are not discovered.
If those earlier-spawned subagents continue writing to their transcript files in later turns, their file modifications will be missed.
Impact
After a checkpoint is saved (advancing CheckpointTranscriptStart), modifications by previously-spawned subagents become invisible to both file extraction and token usage calculation.
Suggested Fix
Extract agent IDs from the full transcript (startLine=0) while still limiting main-agent modified file extraction to startLine. This ensures all subagent transcripts are scanned regardless of when the agent was spawned.
Context
Identified during review of #323 (ENT-297 fix). This is a pre-existing limitation shared by CalculateTotalTokenUsage.