agent-ops-patterns / gallery / DeerFlow map / how it decides

How DeerFlow decides

In DeerFlow, a lead AI model does the work through tool calls and, when sub-agents are switched on (the web app does this only in its Ultra mode), can hand tasks to them; a run normally ends when that model replies without asking for a tool, and plain code can also remove tool calls to bring it to a close. When a thread has an active /goal, a separate model call can judge whether the conversation shows the goal was met, though some conditions stand the goal down without that call.

From bytedance/deer-flow at source version 14abd9a2, mapped 2026-11-02. Each answer links the place in the code where that decision is made; the full map has the rest.

How it decides it is done

Limits and memory

Other judgments

Three problems in the code

  1. 1. web_fetch cuts page content at 4,096 characters, with no notice of the cut

    Each web_fetch tool the map cites keeps at most the first 4,096 characters of the content it selects and adds no notice of that cut, so a long page can reach the model incomplete with nothing from the tool saying so. The example config uses the Jina tool, which does this. An open pull request proposes making the limit a setting.

    Reported; a fix is proposed, not merged (#1071), checked 2026-11-15.

    Where: tools.py:70-71, tools.py:130. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) on 2026-11-08, in five rounds; each sentence it questioned was narrowed, removed or kept with the reason recorded.

  2. 2. One matching presented file is enough to pass the delivery check

    On a normal completion, when changed output files are detected, the delivery check compares them with the paths recorded as presented. One presented path that covers a detected change satisfies the check, even if the run's other changed output files were not presented. The check is written to catch runs that present none of them.

    No tracker issue found, checked 2026-11-08.

    Where: worker.py:401-403, worker.py:418-422. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) on 2026-11-08, in five rounds; each sentence it questioned was narrowed, removed or kept with the reason recorded.

  3. 3. Fifty proposed calls to one tool can force a stop, even when each call differs

    Besides counting repeated sets of tool calls, the loop check counts calls by tool name in a sliding window. At the default threshold, reaching 50 proposed calls to one tool in that window triggers a stop whatever their arguments: all calls in that response are removed and a stop message is added. A setting can raise the limit per tool. An open issue reports this limit interrupting batch scientific work, and a contributor there points to that setting.

    Already tracked upstream (#2510), checked 2026-11-15.

    Where: loop_detection_middleware.py:699-718, loop_detection_middleware.py:846-855, loop_detection_config.py:58-70. How we checked: the code was re-read at the source version named above; the sentences were checked by an independent AI reviewer from another company (OpenAI Codex, read-only) on 2026-11-08, in five rounds; each sentence it questioned was narrowed, removed or kept with the reason recorded.

See the full map →

This card was taken from the published map of DeerFlow at one commit and covers only decisions shown there; it did not look at code outside the map's scope (the Python harness package and the gateway, channel and scheduler code that answers the harness's requests) or at the 17 decisions left out of that edition, and no DeerFlow code was run to make it.

Map: edition with 17 of 135 cards left out (published 2026-11-03) · taken from the full map · card data: gallery/cards/deer-flow.json. Found something wrong? Use the correction form.