#2510·deer-flow

Loop Detection Limit Too Restrictive for Scientific Computing Workflows

Author: gs80140Created Apr 24, 2026Updated Sep 27, 2026

Problem summary

Loop detection limit (50 bash calls) interrupts legitimate scientific workflows like RNA-seq analysis requiring batch processing of multiple samples. Need higher limits or configurable thresholds for scientific computing tasks.

Expected behavior

Image

Problem Description

The current loop detection limit in LoopDetectionMiddleware is too restrictive for scientific computing workflows that require many sequential operations.

Current Limit:

  • _DEFAULT_TOOL_FREQ_HARD_LIMIT = 50 (in loop_detection_middleware.py)
  • Results in [FORCED STOP] Tool bash called 53 times — exceeded the per-tool safety limit.

Impact:

  • Complex bioinformatics workflows (like RNA-seq analysis with 15+ samples) are interrupted
  • Long-running scientific computations are prematurely terminated
  • Users must artificially break down legitimate workflows into smaller segments

Use Case

For RNA-seq differential expression analysis with 15 samples:

  • Quality control: 15 samples × bash operations
  • Alignment: 15 samples × bash operations
  • Quantification: 15 samples × bash operations
  • Total easily exceeds 50 bash calls in a single logical workflow

Proposed Solutions

  1. Increase default limit: Raise from 50 to a higher value (e.g., 200-500) for scientific computing
  2. Configurable limits: Allow per-workflow customization of limits
  3. Subagent integration: Better promote subagent usage for long-running tasks
  4. Smart batching: Allow users to combine operations into single bash calls

Workaround

Currently using subagents to bypass this limitation, but this shouldn't be required for linear bioinformatics workflows.

Additional Context

This limit affects legitimate scientific computing tasks that require many sequential but distinct operations, unlike the infinite loops this safety feature was designed to prevent.

Actual behavior

Loop detection middleware forcibly stops scientific workflows after 50 bash calls with [FORCED STOP] Tool bash called 53 times — exceeded the per-tool safety limit., terminating legitimate batch processing tasks such as RNA-seq analysis of 15+ samples that require sequential operations.

Operating system

Linux

Platform details

No response

Python version

No response

Node.js version

No response

pnpm version

No response

uv version

No response

How are you running DeerFlow?

Local (make dev)

Reproduction steps

rna-seq-differential-analysis.zip

Install the RNA-seq differential expression analysis skill from rna-seq-differential-analysis.zip Start deer flow using make docker-start In the conversation interface, ask: "I need to analyze citrus SWO variety ABA treatment data, including the following steps: Install all required dependencies Download SWO reference genome data (genome.fa, genes.gtf, etc.) Download SRA data: SRR6451531 to SRR6451545 Run complete differential expression analysis pipeline Store data in /mnt/extra-data/rnaseq_analysis/ directory" Observe the workflow execution and note when it gets interrupted by the loop detection limit after 50+ bash calls

Relevant logs

bash
not found usable logs

Git state

No response

Additional context

No response