anomalyco / anomalyco/opencode

deepseek-v4-flash-free stops the agent loop after nearly every tool call

Open
#39,204 2 comments 4 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 27, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When using deepseek-v4-flash-free, the Build agent frequently stops after a single tool call, even when the model says it is about to continue. This happens after tools such as read, grep, glob, and todowrite.

Typing continue resumes the task, but it usually stops again after the next tool call. There is no steps limit configured, no permission denial, and no visible tool error. The logs show OpenCode starting the next loop step, then exiting normally because the model does not emit another tool call.

This appears to be a model or provider-adapter issue where the response ends with a terminal stop reason after a tool result instead of continuing the agent loop.

Plugins

none

OpenCode version

1.18.7

Steps to reproduce
  1. Open a repository in OpenCode.
  2. Select the deepseek-v4-flash-free model and use the Build agent.
  3. Give it a task that requires multiple tool calls, such as inspecting several files and making a change.
  4. Wait for it to run a tool like read, grep, glob, or todowrite.
  5. Observe that the agent stops immediately after the tool result instead of continuing.
  6. Type continue.
  7. Observe that it usually performs one more tool call and stops again.
Screenshot and/or share link
Image Image

https://opncd.ai/share/nxPY1oQG

Operating System

Macos 27 beta 2

Terminal

Kitty

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.