elksmmx 9f7e53d894 feat:完整实现了Subagent 4 weeks ago
..
README.md 9f7e53d894 feat:完整实现了Subagent 4 weeks ago
run.py 9f7e53d894 feat:完整实现了Subagent 4 weeks ago
test.prompt 9f7e53d894 feat:完整实现了Subagent 4 weeks ago
test_continue.prompt 9f7e53d894 feat:完整实现了Subagent 4 weeks ago
visualize_trace.py 9f7e53d894 feat:完整实现了Subagent 4 weeks ago

README.md

Subagent 工具真实测试

本测试用例用于验证 subagent 工具在真实 LLM 环境下的表现。

测试目标

测试 subagent 工具的三种核心模式:

  1. delegate 模式 - 委托子任务给专门的 agent 处理
  2. explore 模式 - 并行探索多个可能的方案
  3. evaluate 模式 - 评估任务完成情况

测试场景

分析 Agent-main 项目的架构,这个任务自然需要:

  • 委托不同模块的分析(delegate)
  • 并行探索改进方案(explore)
  • 评估分析完整性(evaluate)

运行方式

cd /Users/elksmmx/Desktop/agent_2.9/Agent-main
python examples/test_subagent_real/run.py

前置要求

  1. 配置 .env 文件,设置 OpenRouter API Key:

    OPENROUTER_API_KEY=your_key_here
    
  2. 确保已安装依赖:

    pip install -r requirements.txt
    

    预期结果

    Agent 应该:

    1. 使用 delegate 模式委托 2-4 个子任务分析不同模块
    2. 使用 explore 模式并行探索 2-3 个改进方案
    3. 使用 evaluate 模式评估分析的完整性
    4. 生成完整的架构分析报告

    输出

    • 控制台:实时显示 agent 执行过程和 subagent 调用
    • 文件:output/subagent_test_result.txt 包含最终结果和统计
    • Trace:.trace/ 目录保存完整执行记录

    可视化

    启动 API Server 查看 trace tree:

    python3 api_server.py
    

访问:http://localhost:8000/api/traces