route-failed-searches-to-shell-agent
它能做什么
这项技能告诉 AI 智能体,把持续失败的网络搜索交给 shell 智能体,由它尝试不同的方法。它适合搜索工具不可靠、却需要网络信息的人。
适用场景
- ✓当搜索工具在多次查询中返回未知错误或空结果的时候。
- ✓当任务需要多步的数据收集,而重试循环可以处理的时候。
- ✓当你希望智能体自行选择方法(例如 API 或脚本)获取数据的时候。
技能链接
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/route-failed-searches-to-shell-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请查找我所在地区当前的能源价格。搜索工具一直失败,请让 shell 智能体用其他方式查找。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体不会反复重试搜索工具,而是为 shell 智能体设定一个明确的目标。shell 智能体可以自行重试、编写小脚本或使用其他工具收集数据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Route Failed Web Searches to Shell Agent
When to Use This Skill
Use this workflow when:
- Direct
search_webtool calls consistently fail with 'unknown error' or similar failures - You need to gather web-based information but the standard search tool is unreliable
- The task requires multi-step data collection that benefits from autonomous retry logic
- You need resilient data gathering that can adapt when initial approaches fail
Core Pattern
Instead of repeatedly calling search_web when it fails, delegate the entire search task to shell_agent. The shell_agent's internal capabilities provide:
- Automatic retry logic with error detection and recovery
- Multi-step approach - can try different methods (APIs, scraping, alternative sources)
- Code-based solutions - can write Python scripts, use curl, or other tools
- Autonomous adaptation - figures out the best approach without manual intervention
Step-by-Step Instructions
Step 1: Detect Search Tool Failure
When search_web returns errors like:
- "unknown error"
- Empty or incomplete results
- Consistent failures across multiple queries
Recognize this as a signal to switch strategies rather than retrying the same failing tool.
Step 2: Delegate to Shell Agent
Create a task for shell_agent with clear objectives:
shell_agent(
task="Gather current energy market data including oil prices, gas prices, and bond market information. Search multiple sources and compile findings into a structured summary.",
timeout=300
)
Key task formulation principles:
- Specify the what (data needed) not the how (specific tools to use)
- Include success criteria and output format expectations
- Allow sufficient timeout for multi-step execution (300+ seconds)
- Let shell_agent decide whether to use Python, curl, or other approaches
Step 3: Verify Results
Check shell_agent output for:
- Complete data collection (not partial results)
- Multiple sources cited (indicates thorough searching)
- Structured, usable output format
- Evidence of error handling (mentions of retry attempts, alternative approaches tried)
Step 4: Extract and Use Data
Process the shell_agent results for your downstream task:
- Parse collected data into required format
- Cross-reference with any partial results from failed search_web calls
- Document sources for verification if needed
Code Example
Scenario: Gathering market data for a financial report when search_web fails.
# Failed approach - don't keep retrying this:
try:
results = search_web(query="current oil gas bond market prices 2025")
# This fails with unknown error
except:
pass # Don't just catch and retry the same failing tool
# Correct approach - delegate to shell_agent:
from tools import shell_agent
market_data = shell_agent(
task="""
Gather comprehensive energy market data for a trading strategy report.
Required information:
1. Current crude oil prices (WTI, Brent)
2. Natural gas prices
3. Relevant bond issuer analysis and yields
4. Recent market trends and forecasts
Use multiple sources, handle any errors by trying alternative approaches,
and provide structured output with source citations.
""",
timeout=300
)
# Now use market_data for your report
Why This Works
| Aspect | search_web (failing) | shell_agent (working) |
|---|---|---|
| Retry logic | None or limited | Built-in multi-round retry |
| Error handling | Returns error | Attempts to fix and continue |
| Approach flexibility | Single method | Can use Python, bash, APIs, scraping |
| Adaptation | Fails completely | Tries alternative strategies |
| Output reliability | Inconsistent | Structured, verified results |
Best Practices
Don't chain failed tools: Once search_web fails twice, switch to shell_agent immediately rather than accumulating more failures.
Set appropriate timeouts: Shell_agent needs time to iterate (200-300 seconds typical for complex searches).
Be specific about data needs: Shell_agent performs better with clear requirements than broad queries.
Trust the autonomy: Don't micromanage which tools shell_agent should use - let it decide the best approach.
Validate outputs: Always verify shell_agent results meet your needs before proceeding to downstream tasks.
Troubleshooting
Shell_agent also fails?
- Increase timeout (
常见问题
shell 智能体有什么不同做法?
它可以尝试不同的途径,例如脚本、API 或其他来源,并自行重试。
智能体如何知道搜索已经失败?
这项技能把未知错误、超时以及空的或不完整的结果,列为失败的迹象。
结果会被核查吗?
这项技能没有描述核查步骤,因此在依赖数据之前请自行检查。
详情
作者的原始描述
Delegate web search tasks to shell_agent when direct search_web tool fails, using its retry mechanism and multi-step capabilities for resilient data gathering
repo: HKUDS/AgentPilot
热度
- GitHub 星标
- 7.8k
- 排名
- #12978
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
agentpilot
7.8k帮你的智能体准备任务并运行 AgentPilot 循环,逐步改进项目:循环会提出修改、测试修改并为其打分。
openspace
7.8k帮你的智能体设置 OpenSpace,这是一个用于存储和获取智能体技能的工具,并通过 MCP 将其连接到你的 AI 应用。
rsi-arena
7.8k帮你的智能体设置并运行标准 AI 基准测试,例如 AIME 和 Terminal-Bench,用来比较不同的改进方法。
experiment-guide
7.8k帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。