Skip to content

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

Closed as not planned

Description

@BookCatKid

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

Activity

  1. github-actions commented on Jul 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. aaronlee950808-afk commented on Jul 29, 2026

    @aaronlee950808-afk

    YES, I'm using WINDOWS 10, after opencode update, this issue appears frequently. I have no idea what is going on. Please fix it, thank you. It will help me a lot. Otherwise, I have to keep telling her "keep going, do not stop"

  3. github-actions commented on Sep 28, 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.

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