Skip to content

[Bug] After context compaction, the agent can resume an old task instead of the current task #22

Description

@Akshayxkill

问题描述 / Description

I'm experiencing a reproducible issue where, after PI Desktop performs context compaction, the agent sometimes **loses the current task/continuation state and starts working on an older task from earlier in the session**.

This is more than simply forgetting a detail from the conversation.

The problem is that the agent can appear to **switch back to a previously completed/unrelated task** after compaction.

For example, I was working through a long software project using a strict workflow:

> Implement one fix → report results → wait for approval → move to the next fix.

Before compaction, the active task was clearly:

复现步骤 / Steps to reproduce

1. Start a long-running coding/agent session.
2. Work through multiple sequential tasks and explicitly complete older tasks.
3. Start a new task with clear constraints and an approval-gated workflow.
4. Continue the session until PI Desktop performs context compaction.
5. Allow the agent to continue after compaction.
6. Observe that the agent may begin executing an older completed/unrelated task instead of continuing the current task.
7. In some cases, it can begin making real workspace changes belonging to that older task.

截图 / Screenshots

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agent-runtimeAgent execution, subagents, tools, and runtime behaviorbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions