Summary
After auto-compaction triggers mid-session, the agent re-reads the compaction summary and resumes planning instead of executing. This creates a self-reinforcing loop: plan → context fills → compact → re-read plan → plan again → repeat.
In one session I observed 217 plan→compact→re-plan cycles before killing it. Zero file edits across hundreds of turns.
Repro
Start a non-trivial coding task with copilot (Copilot CLI). Let auto-compaction fire mid-task. Observe that after compaction the agent re-summarizes its own plan, validates it, and repeats — instead of resuming from the next concrete file edit.
Root Cause Hypothesis
Compaction preserves the plan as the most salient signal in the new context window. Post-compact, the agent treats ""we have a plan"" as a fresh prompt to plan against, rather than as decided work to execute. With no execution-bias instruction surviving compaction, the loop is structural — not prompt-specific.
Expected Behavior
After compaction, the agent resumes from the next concrete file edit. Plans already produced are treated as decided, not as a fresh prompt to re-plan against.
Actual Behavior
Agent re-summarizes its own plan, validates it, and repeats. No file edits across hundreds of turns.
Impact
- Quota / cost: hours of compute, hundreds of model calls, zero output
- Productivity: full session lost, manual recovery required
- Trust: undermines confidence in long-running autonomous tasks
- Likely under-reported: users blame themselves before blaming the tool
Proposed Fixes (priority order)
- Compaction summarizer: label plans as ""DECIDED — do not re-plan"" and surface ""next concrete action"" as the primary continuation signal.
- Inject a default post-compact rule: ""Resume from the next file edit. Do not re-validate the plan."" (Reference: https://github.com/Dicklesworthstone/post_compact_reminder)
- Add an
--mode execute session flag that biases hard against planning preambles.
- Loop detector: N consecutive turns with zero file edits → halt and prompt user. Suggested default N=3.
- Improve
/compact defaults: drop planning history, keep only files modified, current error state, and next concrete action.
- Telemetry signal for ""planning loop suspected"" to quantify real-world frequency.
Current Workarounds (should not be required)
AGENTS.md with explicit ""no re-plan after compact"" rule
- Post-compact reminder hook (manual third-party install)
- Manual
/compact at ~60% with explicit preservation instructions
HANDOFF.md as ground-truth state file
Reporter
Akhi Shukla — Senior PM, IC3 / UED, Prague
Manager: Bryan Castro | Skip: Nils Dussart
Happy to share session logs and join a triage call.
Summary
After auto-compaction triggers mid-session, the agent re-reads the compaction summary and resumes planning instead of executing. This creates a self-reinforcing loop: plan → context fills → compact → re-read plan → plan again → repeat.
In one session I observed 217 plan→compact→re-plan cycles before killing it. Zero file edits across hundreds of turns.
Repro
Start a non-trivial coding task with
copilot(Copilot CLI). Let auto-compaction fire mid-task. Observe that after compaction the agent re-summarizes its own plan, validates it, and repeats — instead of resuming from the next concrete file edit.Root Cause Hypothesis
Compaction preserves the plan as the most salient signal in the new context window. Post-compact, the agent treats ""we have a plan"" as a fresh prompt to plan against, rather than as decided work to execute. With no execution-bias instruction surviving compaction, the loop is structural — not prompt-specific.
Expected Behavior
After compaction, the agent resumes from the next concrete file edit. Plans already produced are treated as decided, not as a fresh prompt to re-plan against.
Actual Behavior
Agent re-summarizes its own plan, validates it, and repeats. No file edits across hundreds of turns.
Impact
Proposed Fixes (priority order)
--mode executesession flag that biases hard against planning preambles./compactdefaults: drop planning history, keep only files modified, current error state, and next concrete action.Current Workarounds (should not be required)
AGENTS.mdwith explicit ""no re-plan after compact"" rule/compactat ~60% with explicit preservation instructionsHANDOFF.mdas ground-truth state fileReporter
Akhi Shukla — Senior PM, IC3 / UED, Prague
Manager: Bryan Castro | Skip: Nils Dussart
Happy to share session logs and join a triage call.