Skip to content

/compact causes the agent to continue unexpectedly #18794

@fubar-coder

Description

@fubar-coder

Description

This seems closely related to #13217, but I think there’s an important aspect missing there.

What I’m running into in longer agent/spec-style sessions:

  • When /compact triggers, the agent often continues with some work automatically.
  • In many cases, that’s actually not what I want.

There are at least two different states that currently get treated the same:

  1. The agent is in the middle of an active task -> continuing makes sense.
  2. The agent just answered a question and is waiting for user input -> continuing is wrong.

Issue #13217 focuses on what the agent should continue with after /compact, but the bigger problem (for me) is that the agent doesn’t know whether it should continue at all.

After a compact, the implicit “wait for user” state is often lost, which leads to:

  • unfinished tasks being abandoned
  • answered questions immediately followed by unrelated work
  • the feeling that the agent is acting without an explicit prompt

This seems less like a UX issue and more like missing task / wait-state semantics around /compact.

I don’t have a concrete implementation proposal here, but I wanted to point out that “continue working” is not always the correct default after compaction.

Plugins

No response

OpenCode version

1.3.0

Steps to reproduce

  1. Start a new opencode session.
  2. Begin a longer, multi-step task (e.g. a spec-driven change or refactor using openspec).
  3. Interact with the agent for several turns until the context window is close to full.
  4. Ask a question that does not imply further action (e.g. a clarification or confirmation).
  5. Let the agent answer the question.
  6. Observe that /compact is triggered automatically shortly after.
  7. After compaction, observe that the agent continues working on unrelated or previous tasks instead of waiting for further user input.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions