anomalyco / anomalyco/opencode

Resumed session: "thinking" forever, loop exits at step=0 with no error

Open
#43,459 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 19, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Bug Report

Description

When resuming an old session, the UI shows "Thinking" indefinitely. The loop starts at step=0 and immediately exits without ever calling the LLM. No error is displayed to the user.

Expected Behavior
  • Show an error message when context exceeds model limits
  • Or auto-compact/truncate context to fit within limits
  • Or at minimum, exit the "thinking" state and return to input
Actual Behavior
  • "Thinking" stays on screen indefinitely
  • No error message is shown
  • The user must force-quit and start a new session
Logs

loop session.id=ses051a099bcffewokH4M8DUvs8yO step=0
"exiting loop" session.id=ses051a099bcffewokH4M8DUvs8yO
This pattern repeats 12+ times in rapid succession (~200ms each). No process or stream entries appear.

Environment
  • opencode v1.17.20
  • Linux (Debian 13)
  • Models used: Deepseek Reasoner → Big Pickle (switched mid-session)
  • Session token count: ~1,470,382 tokens
Additional Context

The session had accumulated many errors over time (rate limits, aborted operations, forbidden access). The compaction agent also fails with the same context overflow (2,135,961 tokens).

Plugins

https://github.com/obra/superpowers.git

OpenCode version

1.17.20

Steps to reproduce
  1. Use a session extensively until it accumulates a large context (e.g., >1M tokens)
  2. Resume the session with opencode --continue or via the TUI
  3. Send any prompt
  4. "Thinking" appears but never resolves
Screenshot and/or share link
Image
Operating System

Linux x64-Dev 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 GNU/Linux

Terminal

konsole 25.04.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.