Files
deer-flow/backend/src/subagents/builtins/general_purpose.py
LofiSu 2a39947830 feat: citations prompts, path_utils, and citation code cleanup
- Prompt: add citation reminders for web_search and subagent synthesis (lead_agent, general_purpose)
- Gateway: add path_utils for shared thread virtual path resolution; refactor artifacts and skills to use it
- Citations: simplify removeAllCitations (single parse); backend _extract_citation_urls and remove_citations_block cleanup

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 12:55:12 +08:00

58 lines
2.2 KiB
Python

"""General-purpose subagent configuration."""
from src.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>
<citations_format>
If you used web_search (or similar) and cite sources, ALWAYS include citations in your output:
1. Start with a `<citations>` block in JSONL format listing all sources (one JSON object per line)
2. In content, use FULL markdown link format: [Short Title](full_url)
- Every citation MUST be a complete markdown link with URL: [Title](https://...)
- Example block:
<citations>
{"id": "cite-1", "title": "...", "url": "https://...", "snippet": "..."}
</citations>
</citations_format>
<output_format>
When you complete the task, provide:
1. A brief summary of what was accomplished
2. Key findings or results (with citation links when from web search)
3. Any relevant file paths, data, or artifacts created
4. Issues encountered (if any)
</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`
</working_directory>
""",
tools=None, # Inherit all tools from parent
disallowed_tools=["task", "ask_clarification", "present_files"], # Prevent nesting and clarification
model="inherit",
max_turns=50,
)