route-failed-searches-to-shell-agent
Skill này làm gì
Skill này bảo AI agent chuyển một tìm kiếm web liên tục thất bại cho một shell agent, để nó có thể thử các cách tiếp cận khác nhau. Nó dành cho những người cần thông tin từ web khi công cụ tìm kiếm không đáng tin cậy.
Khi nào nên dùng
- ✓Khi công cụ tìm kiếm trả về lỗi không rõ nguyên nhân hoặc kết quả trống qua nhiều truy vấn.
- ✓Khi nhiệm vụ cần nhiều bước thu thập dữ liệu mà một vòng lặp thử lại có thể xử lý.
- ✓Khi bạn muốn agent tự chọn phương pháp, chẳng hạn một API hoặc một script, để lấy dữ liệu.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/route-failed-searches-to-shell-agent/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm giá năng lượng hiện tại ở khu vực của tôi. Công cụ tìm kiếm liên tục thất bại, nên hãy nhờ một shell agent tìm chúng bằng cách khác.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Thay vì thử lại công cụ tìm kiếm nhiều lần, agent giao cho một shell agent một mục tiêu rõ ràng. Shell agent có thể thử lại, viết các script nhỏ hoặc dùng công cụ khác để thu thập dữ liệu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 (
Câu hỏi thường gặp
Shell agent làm gì khác đi?
Nó có thể thử các cách tiếp cận khác nhau, như script, API hoặc nguồn khác, và tự thử lại.
Agent biết tìm kiếm đã thất bại bằng cách nào?
Skill nêu các lỗi không rõ nguyên nhân, quá thời gian chờ và kết quả trống hoặc thiếu là dấu hiệu thất bại.
Kết quả có được kiểm tra không?
Skill không mô tả bước kiểm tra, nên hãy xem lại dữ liệu trước khi dựa vào nó.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12978
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.