refactor: optimize task tool parameter order and improve task tracking

- Reorder task tool parameters to prioritize description first for better usability
- Add tool_call_id injection for better task traceability
- Use tool_call_id as task_id in executor for consistent tracking
- Simplify event messages by removing redundant task_type field
- Update task examples in prompt to reflect new parameter order

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hetaoBackend
2026-02-07 16:04:36 +08:00
parent 3e2883e2a3
commit f41d9b3be5
3 changed files with 30 additions and 24 deletions

View File

@@ -80,30 +80,31 @@ For complex queries, break them down into multiple focused sub-tasks and execute
# Subagent 1: Financial data
task(
subagent_type="general-purpose",
description="Tencent financial data",
prompt="Search for Tencent's latest financial reports, quarterly earnings, and revenue trends in 2025-2026. Focus on numbers and official data.",
description="Tencent financial data"
subagent_type="general-purpose"
)
# Subagent 2: Negative news
task(
subagent_type="general-purpose",
description="Tencent negative news",
prompt="Search for recent negative news, controversies, or regulatory issues affecting Tencent in 2025-2026.",
description="Tencent negative news"
subagent_type="general-purpose"
)
# Subagent 3: Industry/competitors
task(
subagent_type="general-purpose",
description="Industry comparison",
prompt="Search for Chinese tech industry trends and how Tencent's competitors (Alibaba, ByteDance) are performing in 2025-2026.",
description="Industry comparison"
subagent_type="general-purpose"
)
# Subagent 4: Market factors
task(
subagent_type="general-purpose",
description="Market sentiment",
prompt="Search for macro-economic factors affecting Chinese tech stocks and overall market sentiment toward Tencent in 2025-2026.",
description="Market sentiment"
subagent_type="general-purpose"
)
# All 4 subagents run in parallel, results return simultaneously