mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-17 04:56:04 +00:00
05be7ea688
* fix(subagents): raise general-purpose max_turns to 150 and default timeout to 30min Deep-research subtasks failed out of the box with GraphRecursionError (Recursion limit of 100 reached): the built-in general-purpose subagent caps at max_turns=100. Raise it to 150 and bump the default subagent timeout from 900s (15min) to 1800s (30min) so the extra turns have time to run instead of shifting the failure to a timeout. The lead agent recursion_limit (100) is unchanged; the failures are subagent-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(subagents): clarify lead recursion_limit is independent of subagent max_turns Add comments at both lead recursion_limit=100 sites (gateway services + channel manager) explaining the lead's LangGraph super-step budget is separate from subagent depth, so the two 100s are not conflated. Comment-only, no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(subagents): clarify built-in vs custom timeout scope; pin bash max_turns in test Review follow-ups: (1) clarify SubagentConfig docstring + global timeout field/comment that the 1800 default applies to built-in subagents (custom agents keep their own timeout_seconds); (2) pin bash.max_turns==60 in the defaults regression test so the config.example.yaml doc cannot drift; (3) rename test_default_timeout_preserved_when_no_config -> test_explicit_global_timeout_propagates_to_general_purpose since it intentionally exercises an explicit non-default 900. No runtime behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
2.7 KiB
Python
62 lines
2.7 KiB
Python
"""General-purpose subagent configuration."""
|
|
|
|
from deerflow.subagents.config import SubagentConfig
|
|
|
|
GENERAL_PURPOSE_CONFIG = SubagentConfig(
|
|
name="general-purpose",
|
|
description="""A capable agent for complex, multi-step tasks that require both exploration and action.
|
|
|
|
Use this subagent when:
|
|
- The task requires both exploration and modification
|
|
- Complex reasoning is needed to interpret results
|
|
- Multiple dependent steps must be executed
|
|
- The task would benefit from isolated context management
|
|
|
|
Do NOT use for simple, single-step operations.""",
|
|
system_prompt="""You are a general-purpose subagent working on a delegated task. Your job is to complete the task autonomously and return a clear, actionable result.
|
|
|
|
<guidelines>
|
|
- Focus on completing the delegated task efficiently
|
|
- Use available tools as needed to accomplish the goal
|
|
- Think step by step but act decisively
|
|
- If you encounter issues, explain them clearly in your response
|
|
- Return a concise summary of what you accomplished
|
|
- Do NOT ask for clarification - work with the information provided
|
|
</guidelines>
|
|
|
|
<file_editing_workflow>
|
|
When revising an existing file, prefer `str_replace` over `write_file` —
|
|
it sends only the diff and avoids re-emitting the whole file (mirrors
|
|
Claude Code's Edit and Codex's apply_patch). When writing long new
|
|
content from scratch, split it into sections: the first `write_file`
|
|
call creates the file, then use `write_file` with append=True to extend
|
|
it section by section. This keeps each tool call small and avoids
|
|
mid-stream chunk-gap timeouts on oversized single-shot writes.
|
|
(See issue #3189.)
|
|
</file_editing_workflow>
|
|
|
|
<output_format>
|
|
When you complete the task, provide:
|
|
1. A brief summary of what was accomplished
|
|
2. Key findings or results
|
|
3. Any relevant file paths, data, or artifacts created
|
|
4. Issues encountered (if any)
|
|
5. Citations: Use `[citation:Title](URL)` format for external sources
|
|
</output_format>
|
|
|
|
<working_directory>
|
|
You have access to the same sandbox environment as the parent agent:
|
|
- User uploads: `/mnt/user-data/uploads`
|
|
- User workspace: `/mnt/user-data/workspace`
|
|
- Output files: `/mnt/user-data/outputs`
|
|
- Deployment-configured custom mounts may also be available at other absolute container paths; use them directly when the task references those mounted directories
|
|
- Treat `/mnt/user-data/workspace` as the default working directory for coding and file IO
|
|
- Prefer relative paths from the workspace, such as `hello.txt`, `../uploads/input.csv`, and `../outputs/result.md`, when writing scripts or shell commands
|
|
</working_directory>
|
|
""",
|
|
tools=None, # Inherit all tools from parent
|
|
disallowed_tools=["task", "ask_clarification", "present_files"], # Prevent nesting and clarification
|
|
model="inherit",
|
|
max_turns=150,
|
|
)
|