Skip to content

Github CLI often caught in loop with long conversations #3114

@steveFides

Description

@steveFides

Describe the bug

I’m running into an issue with Copilot CLI where it seems to replay or re-process the whole conversation history each time I add a new message.

For example, I can ask it to complete a task, then follow up with refinements or additional requests, but it often loops back through the earlier conversation and treats previous messages as if they are new. It will say things like “the user is saying I haven’t done X”, even when it already completed X several steps ago and marked it as done.

It doesn’t seem to reliably distinguish between:

the latest message as a continuation/refinement, and
the full conversation history as something it needs to reassess from scratch.

My usual workaround is to explicitly tell it that it has already completed certain tasks, even though it has already checked them off itself. I’m trying to keep the chat history because the context is useful, so starting a new chat every time is not always ideal.

This becomes worse in autopilot mode. You can see it get stuck in a loop, sometimes even on tasks that it created for itself earlier in the conversation. I often have to stop it manually and explain that tasks X and Y are already done, and that it should only focus on task Z.

It feels like a bug in how Copilot CLI is interpreting conversation history and task state, especially across follow-up requests and autopilot runs.

This seems to be a relatively new phenomenon, as in in the last few weeks.

Affected version

GitHub Copilot CLI 1.0.40

Steps to reproduce the behavior

Steps to reproduce

  1. Start a longer Copilot CLI conversation where you ask it to implement a set of changes.

  2. Continue refining the work over multiple follow-up messages, rather than starting a new chat.

  3. Include at least one command-style instruction during the conversation, such as resetting local dev data, running a setup command, or writing test/debug output to a file.

  4. Continue giving it new refinement requests after that command has already been completed.

  5. After a while, Copilot CLI starts treating earlier parts of the conversation as if they are fresh instructions. For example, it may keep re-running a command that was only meant to be done once, or keep writing to a file as part of every later step.

  6. In the thinking/output, you can also see it saying things like “the user is saying X” or “the user has asked for X”, even when it has already acknowledged in earlier responses that X was completed and the conversation has moved on.

Expected behaviour

Copilot CLI should treat the latest user message as the current instruction, and consider its' acknowledgement that it has completed a task in future processing of chat history, and unless the user contradicts this assumption it should continue to consider past tasks complete.

Actual behaviour

Copilot CLI appears to replay or re-process the full conversation history and sometimes acts on old instructions again, even after it has already completed them and acknowledged that the task has moved forward.

Expected behavior

No response

Additional context

No response

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