deepseek-v4-flash terminates prematurely in agent tool-call loops via OpenAI-compatible API

Author: Lady-LinCreated Aug 9, 2026Updated Sep 26, 2026

Model: deepseek-v4-flash (DeepSeek-V4-Flash-0731, API endpoint https://api.deepseek.com)

Context: Used as the execution model inside a coding agent that operates in a tool-call loop via the OpenAI Chat Completions protocol. The agent is configured with reasoning_effort: max and expects each response to either issue a tool call or deliver a complete answer.

Observed behavior: The model frequently produces only one short sentence of natural language — e.g. "Let me look into this" or "I will check" — and then terminates with finish_reason: stop, without issuing any tool call and without completing the task. This occurs regardless of the max_tokens setting (tested with default, 8192, and 384000). The response is well-formed and clearly not truncated by token limits; the model elects to stop after the first sentence.

Expected behavior: In an agentic tool-call loop, the model should either continue reasoning and issue a tool call, or deliver a complete final answer. A one-sentence status update followed by an immediate stop causes the agent orchestrator to re-prompt, creating an inefficient loop where the model may never progress past the first sentence.

Reproduction conditions:

  • Both streaming and non-streaming Chat Completions, same behavior.
  • Occurs with and without reasoning_effort set.
  • More frequent in longer conversations with accumulated context, but also reproducible in fresh multi-turn sessions.
  • GPT-series models in the identical agent setup do not exhibit this behavior; they consistently continue into tool calls or complete answers.

Impact: Makes the model impractical for sustained coding-agent use. Each premature stop incurs a full round-trip of latency and token cost, degrading both performance and user experience.

Note: This is about deepseek-v4-flash, not V3. Filing here as the nearest active issue tracker for DeepSeek model family behavior.