graceful-tool-failure
Skill này làm gì
Skill này cho AI biết cách phản hồi khi một công cụ cần thiết liên tục thất bại: liệt kê những gì đã lỗi và đưa ra câu trả lời một phần được ghi nhãn rõ ràng. Dành cho người cần trạng thái trung thực khi tác vụ bị chặn.
Khi nào nên dùng
- ✓Khi một công cụ cần thiết như trích xuất PDF hoặc tìm kiếm web đã thất bại ba lần trở lên.
- ✓Khi các phương pháp thay thế cho cùng mục tiêu cũng đã thất bại.
- ✓Khi tác vụ không thể hoàn thành đầy đủ nếu thiếu khả năng bị chặn.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/graceful-tool-failure/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
“Công cụ PDF liên tục thất bại với tệp của tôi và tìm kiếm web không ra kết quả. Hãy cho tôi biết những gì đã lỗi và đưa câu trả lời một phần tốt nhất, ghi rõ là một phần.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết một danh sách ngắn các vấn đề đang chặn tác vụ cùng các lần thử đã thất bại, rồi đưa ra kết quả một phần tốt nhất và ghi nhãn kèm mức độ tin cậy và giới hạn.
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.
Graceful Tool Failure Workflow
This skill guides agents on how to respond when critical tools (like PDF extraction, web search, data APIs) fail repeatedly and block task completion.
When to Apply This Skill
Use this pattern when:
- A core tool required for task completion has failed multiple times (3+ attempts with different approaches)
- Alternative approaches to achieve the same goal have also failed
- The task cannot be fully completed without the blocked capability
Step-by-Step Instructions
1. Explicitly Report Blocking Issues
Clearly document what failed and why:
## Blocking Issues
The following tools/approaches were attempted but failed:
1. **PDF Extraction (pdftotext)**: Command returned error - file appears corrupted or uses non-standard encoding
2. **PDF Extraction (PyMuPDF)**: Library could not parse document structure
3. **Web Search**: Search queries returned no relevant results for [specific topic]
These failures prevent completion of [specific deliverable].
2. Attempt Minimal Viable Output
Using available domain knowledge, create the best possible output with clear limitations:
## Partial Output (Based on Domain Knowledge)
*Note: The following content is derived from general domain knowledge rather than the requested source materials.*
[Insert best-effort content here]
**Confidence Level**: Low - content has not been verified against source documents
**Recommendation**: Verify all claims against original source materials when available
3. Avoid Claiming Success
Never state the task is complete when core deliverables are missing or unverified:
Incorrect:
"Task completed successfully."
Correct:
"Task partially completed. Core deliverable [X] could not be produced due to tool failures. Minimal viable output provided with disclaimers. Manual review or alternative data sources recommended."
4. Provide Actionable Next Steps
Suggest concrete actions for human operators or alternative approaches:
## Recommended Next Steps
1. Obtain the source document in an alternative format (e.g., request text version from document owner)
2. Manually extract key information from the PDF and provide as text input
3. Use alternative tools: [list specific tools or services]
4. Proceed with partial output acknowledging limitations: [describe what can still be accomplished]
Code Examples
Example: Python Script with Fallback Behavior
def extract_with_fallback(pdf_path):
"""Attempt PDF extraction with multiple methods, fail gracefully."""
methods = [
("pdftotext", lambda p: run_shell(f"pdftotext {p} -")),
("PyMuPDF", lambda p: extract_with_pymupdf(p)),
("pdfplumber", lambda p: extract_with_pdfplumber(p)),
]
failures = []
for method_name, method_func in methods:
try:
result = method_func(pdf_path)
if result:
return {"success": True, "content": result}
except Exception as e:
failures.append(f"{method_name}: {str(e)}")
# All methods failed - return graceful failure
return {
"success": False,
"failures": failures,
"message": "All extraction methods failed. Consider manual extraction or alternative source."
}
Example: Response Template for Failed Tasks
## Task Status: PARTIALLY COMPLETE
### What Was Accomplished
- [List completed subtasks]
### What Could Not Be Completed
- [Deliverable X]: Blocked by [specific tool failure]
- [Deliverable Y]: Requires source material that could not be accessed
### Blocking Issues Summary
| Tool/Method | Attempts | Error |
|-------------|----------|-------|
| Tool A | 3 | [error details] |
| Tool B | 2 | [error details] |
### Partial Output (With Disclaimers)
[Insert best-effort work product]
### Recommendations
1. [Action item 1]
2. [Action item 2]
Key Principles
- Transparency Over Optimism: Clearly state what failed rather than obscuring limitations
- Document Attempts: Record which approaches were tried to prevent redundant work
- Preserve Value: Even partial output is better than no output, if properly disclaimed
- Enable Handoff: Make it easy for a human or different system to pick up where you left off
- No False Claims: Never mark a task as "complete" when core requirements are unmet
Anti-Patterns to Avoid
- ❌ Silently skipping failed steps withou
Câu hỏi thường gặp
AI có giấu các lỗi không?
Không. Hướng dẫn yêu cầu liệt kê rõ từng công cụ và cách đã thất bại.
Kết quả một phần được ghi nhãn thế nào?
Hướng dẫn yêu cầu ghi rõ là dựa trên kiến thức chung và nêu mức độ tin cậy.
Khi nào áp dụng cách này?
Áp dụng sau nhiều lần thử thất bại, khi tác vụ không thể hoàn thành đầy đủ.
Chi tiết
Mô tả gốc của tác giả
Report tool failures transparently and attempt minimal viable output with disclaimers
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12890
- 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.