Skip to content

TUI: queued slash command interrupted by auto-compaction is re-submitted after every later compaction #51178

Description

@benjaminbelaga

Description

When a slash command sits in the TUI follow-up queue and its submission gets interrupted by an auto-compaction, the TUI does not drop it after delivering it. It re-submits the same command after every later compaction in that session, for hours, until the TUI is restarted.

Server log for one session (opencode.log, filtered on that session.id). Everything stays on the same run= id for more than three hours:

13:20:26 run=31f51ac0 agent=compaction
13:20:35 run=31f51ac0 message=command command=autoplan
13:59:27 run=31f51ac0 agent=compaction
13:59:29 run=31f51ac0 message=command command=autopilot
15:44:37 run=31f51ac0 agent=compaction
15:44:42 run=31f51ac0 message=command command=autoplan
15:44:46 run=31f51ac0 message=command command=autopilot
16:40:36 run=31f51ac0 agent=compaction
16:41:48 run=31f51ac0 message=command command=autoplan

Nobody typed those commands after the first time. Each re-submission restarts the whole command workflow.

Observations:

  • Timing. The re-send usually lands a few seconds after the compaction, sometimes at the next idle.
  • Frozen text. The re-sent text is the text that was queued originally. I edited the command's markdown file on disk, and the re-sends kept carrying the old body.
  • Plugins not involved. Restarting only a plugin changes nothing. Only quitting the TUI and resuming the session (opencode -s <id>) stops it.
  • Scale. Across ~20 long-running sessions on one machine I counted 115 such re-submissions in 24 h.

Expected: a queued command is delivered once after the compaction, or dropped. It is never replayed on later compactions.

Possibly related, all closed: #1476, #20529, #13217. #32157 discusses compaction-aware queue semantics.

Plugins

Local plugins only, none touch the prompt queue: cmux-feed, cmux-session, command-dedup, domain-router, mission-continuity, provider-fallback, safety-bridge, session-identity, session-tracker. command-dedup now only annotates the duplicate text; it can't clear the TUI queue.

OpenCode version

1.18.32

Steps to reproduce

  1. Use a session near the context limit, so auto-compaction triggers on the next turn.
  2. While the agent is busy, type a slash command (for example a custom /mycommand). It goes to the follow-up queue.
  3. Let auto-compaction run, and keep working in the session.
  4. Watch the server log. message=command command=mycommand reappears after each later compaction of that session.

I have not reduced this to a clean-config repro. The steps above are what the logs show on my setup.

Operating System

macOS 26.6, arm64

Terminal

cmux (Ghostty-based)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions