Skip to content

Plan->Compact->Re-Plan infinite loop in agency copilot (217 cycles, zero code written) #3151

@Akhi-microsoft

Description

@Akhi-microsoft

Repro

Started a coding task with agency copilot. After auto-compaction fired, the agent re-read the compaction summary and started re-planning instead of executing. This repeated through 217 plan→compact→re-plan cycles before I killed the session.

Root cause (hypothesis)

Compaction summarizes "we planned X, Y, Z" into the new context. The agent reads the summary and treats the plan as a fresh prompt to plan against, instead of as decided work to execute. The plan becomes self-perpetuating.

Impact

  • Burned through hours of compute and my Copilot quota
  • Zero code written despite hundreds of turns
  • Severe trust hit for autonomous workflows

Asks

  1. Treat plans in compaction summaries as DONE-DECIDED, not as new prompts
  2. Add a built-in "execution mode" flag that biases hard against re-planning
  3. Bundle a post-compact reminder hook by default (like post_compact_reminder)
  4. Surface a loop detector: N consecutive turns with zero file edits → halt
  5. Better default /compact preservation that drops planning history

Happy to share session logs and jump on a call to walk through the repro.

— Akhi Shukla, Senior PM, IC3 / UED (Prague)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:context-memoryContext window, memory, compaction, checkpoints, and instruction loading

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions