Skip to content

Stops after compaction #13217

Closed as not planned
Closed as not planned

Description

@tomerweller

Description

Often times opencode (tui) stops mid-task after compaction. Prompting "keep going" fixes it

Plugins

No response

OpenCode version

1.1.59

Steps to reproduce

Prompt for a long running task. Sometimes it stops after compaction

Screenshot and/or share link

No response

Operating System

Ubuntu 22.04.5 LTS

Terminal

termius

Activity

  1. github-actions commented on Feb 11, 2026

    @github-actions
    Contributor

    This issue might be related to existing TUI responsiveness problems. Please check if your issue is similar to:

    While these issues mention different triggers, they all involve the TUI becoming unresponsive. The specific behavior after compaction might be a distinct angle worth investigating separately, or could be related to the broader responsiveness issues being tracked in those tickets.

  2. yasoob commented on Feb 26, 2026

    @yasoob

    Experiencing the same issue. It shows up after compaction. If it helps I am using Opus 4.6 and had a similar issue with Opus 4.5. And like OP, keep going fixes it and the model keeps on iterating. But would be nice to not have to resort to manually asking the model to continue.

  3. 2fns commented on Feb 26, 2026

    @2fns

    I am experiencing the same issue. I am using GitHub Copilot, and I have less context than with other providers. Most of my tasks that are delegated to the agents end in the middle of the exploration. The agent explores the codebase, the context becomes full before it completes the exploration, it writes a compaction, and ends the task. It causes multiple round trips of agent task delegation.

  4. pschork commented on Feb 28, 2026

    @pschork

    Experiencing the same issue when using local llama.cpp serving qwen3.5_35b with 16384 context size.

  5. viralbitcraft commented on Mar 1, 2026

    @viralbitcraft

    Experiencing the same issue when using local ik llama cpp serving minimax m2.5 with 196k context size.

    TUI is responsive, just the agent is not proceeding after that.

    opencode --version
    1.2.10

  6. NicolaiOksen commented on Mar 1, 2026

    @NicolaiOksen

    Seeing the same - Version 1.2.15.

    using Github Copilot - Opus 4.6

  7. MattOates commented on Mar 1, 2026

    @MattOates

    One more voice I'm on OpenCode 1.2.15 but 1.2.4 was the same. Like others here Im using Opus 4.6 via Github Copilot. Exactly the same issues with compaction and havint to prod, the amount and regularity of the compacting is a bit random too. Sometimes it compacts whilst planning which is extremely frustrating.

  8. Mte90 commented on Mar 4, 2026

    @Mte90

    same issue

  9. l0seq commented on Mar 12, 2026

    @l0seq

    Same issue, i use Sonnet 4.6 with github copilot

  10. added a commit that references this issue on Mar 12, 2026
    cc6e137
  11. zjjott commented on Mar 17, 2026

    @zjjott

    +1

  12. sunhs commented on Apr 16, 2026

    @sunhs

    +1

    It's been happening regularly. I start to be afraid of using opencode with copilot.

    Any info I can provide to help address the issue?

  13. gergo-hortobagyi commented on Apr 20, 2026

    @gergo-hortobagyi

    +1

    GPT-5.4, using 1.14.18 on MacOS 26.3.1

  14. dhruvkej9 commented on Apr 20, 2026

    @dhruvkej9

    @rekram1-node are we getting it solved?

  15. AlexKenbo commented on Apr 20, 2026

    @AlexKenbo

    @2fns nailed the shape back in Feb: "it writes a compaction, and ends the task." With @gergo-hortobagyi now reproducing on GPT-5.4 (1.14.18), plus Opus 4.5/4.6, Copilot-Sonnet, local qwen3.5 and minimax m2.5 — that breadth across models/providers usually points at a harness-level invariant, not a model quirk.

    One diagnostic framing: after auto-compaction the summary becomes the trailing item. Models are trained to read summary-as-last-item as the terminal state of a turn — so without a trailing user-message-like anchor or an explicit continuation signal, stopping is the expected behavior. "keep going" works because it restores the anchor.

    One documented pipeline splits the policy by trigger. Mid-turn compaction inserts initial context before the last real user message, with precedence last_real_user_index ?? last_user_or_summary_index ?? last_compaction_index. Pre-turn/manual uses DoNotInject and defers to the next regular turn. The invariant: mid-turn compaction must preserve a trailing user-anchor or inject a continuation hint — never leave the summary as the final item.

    Cheap verification: log the exact prompt sent on the first post-compaction API call. If the last message is the summary with nothing after it, that's the mechanism.

    Rules: https://github.com/AlexKenbo/codex-harness-internals/blob/main/SRC-0011/rules.json (initial-context-injection-policy, initial-context-insertion-precedence).

    — @AlexKenbo

  16. removed
    bugSomething isn't working
    on May 3, 2026
  17. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  18. ilarramendi commented on Jul 7, 2026

    @ilarramendi

    +1

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

Metadata

Metadata

Assignees

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