# DeepSeek-V4-Flash-0731 tool-call repetition collapse: portable reproducer (3 stacks incl. Ollama cloud 6/6)

> Source: <https://gist.github.com/rasatpetabit/64ea43e9795bdb8844ba590155ae9f87>
> Published: 2026-08-14 03:11:29+00:00

One fixed, fully sanitized ~240k-token agentic conversation that makes DeepSeek-V4-Flash-0731 collapse into repeating a short action-announcement ("Run.") instead of emitting a tool call. Reproduced 2026-08-14 on three serving stacks that share no code or hardware:

| Serving stack | Trials | Strict loops | Notes | 
|---|---|---|---|
| Ollama cloud, deepseek-v4-flash:0731-cloud | 6 | 6/6 | 61-97x "Run.", all rolls hit the 2,048-token cap | 
| Alibaba DashScope intl, deepseek-v4-flash | 6 | 2/6 | remaining 4 rolls emitted 6-19x "Run." before the tool call | 
| Community SM80 vLLM (haosdent fork), 8x A100 | 6 | 4/6 | where we first hit it in production | 

Strict loop metric (implemented in the script): a normalized sentence-segment occurring >=20 times in one completion, or >=24 consecutive segments of <=5 words. Sampling: temperature 1.0, top_p 0.95, no penalties, tool_choice=auto.

```
python3 cross_check.py <openai_compatible_base_url> <api_key> <model> <tag> 6
```

Run from the directory containing dsv4-repro-payload-sanitized.json.

Distilled from a production incident (Petabit Scale, 2026-08-12/13). The
conversation is real (394 messages, 210 tool results, 51 declared tools) with
every identifier neutralized; sanitization did not remove the trigger.
Notably, synthetic conversations matching its shape (depth, tool count,
structure, mid-chain ending, repeated-history priming) produced 0/22 loops -
the attractor appears to require realistic content statistics. Related:
[ggml-org/llama.cpp#26694](https://github.com/ggml-org/llama.cpp/issues/26694) (Flash-0731 GGUF/Metal), [QwenLM/qwen-code#4695](https://github.com/QwenLM/qwen-code/issues/4695)
(V4-Pro on DashScope, incl. a dose-response showing in-context
self-reinforcement). Reported to DeepSeek ([service@deepseek.com](mailto:service@deepseek.com)) with full
receipts on 2026-08-14. Contact: [ras@petabitscale.com](mailto:ras@petabitscale.com)
