verify-success-after-unknown-error
What it does
This skill tells the AI agent to check whether its work actually completed before it retries after an unclear error. It is for people whose tools report unknown errors even when the file was made.
When to use it
- βWhen the code sandbox returns an unknown error but the code may have finished.
- βWhen a shell command fails with an unclear message on a file task.
- βWhen a file creation or change reports an error that may be false.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verify-success-after-unknown-error/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βThe tool said unknown error when making my PDF, but the file may be there. Check whether it was created and is readable before you retry.β
5 new skills a week. 1 minute to read.
How it works
The agent lists the expected output folder and checks that each expected file exists. It then opens the files to confirm they have the expected content, so it does not retry work that already succeeded.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Verify Success After Unknown Error
Purpose
When execute_code_sandbox or run_shell return "unknown error" messages, the underlying task may have actually succeeded. This skill provides a systematic approach to verify actual completion before assuming failure and retrying unnecessarily.
When to Apply
Use this pattern when:
execute_code_sandboxreturns "unknown error" but your code may have completedrun_shellfails with unclear error messages- File creation, modification, or transformation tasks report errors
- The error message is generic/unspecified rather than a clear failure reason
Verification Steps
Step 1: Check Expected Output Files
After receiving an unknown error, immediately verify if expected files were created:
# Example: Verify file creation after execute_code_sandbox
from tools import list_dir, read_file
# List directory to check if files exist
files = list_dir(path="/workspace/output")
print(files)
# Check specific file existence
expected_files = ["report.pdf", "data.xlsx"]
for f in expected_files:
try:
content = read_file(filetype="pdf", file_path=f"/workspace/output/{f}")
print(f"β {f} exists and is readable")
except:
print(f"β {f} not found or unreadable")
Step 2: Validate File Content/State
Don't just check existence β verify the files have expected content:
# For spreadsheets
file_content = read_file(filetype="xlsx", file_path="/workspace/output/schedule.xlsx")
# Verify expected sheets, columns, or data exist
# For text/json files
file_content = read_file(filetype="txt", file_path="/workspace/output/result.json")
# Parse and validate structure
# For directories
dir_contents = list_dir(path="/workspace/output")
# Verify expected number of files or specific files exist
Step 3: Decision Logic
IF expected files exist AND content is valid:
β Task succeeded despite error message
β Proceed to next step without retry
ELIF files exist but content is incomplete:
β Partial success, may need targeted fix
ELSE (files missing or corrupted):
β True failure, retry or debug required
Code Example: Complete Pattern
def execute_with_verification(code, expected_files):
"""Execute code and verify success even if error returned."""
# Attempt execution
result = execute_code_sandbox(code=code)
# Check for unknown/generic errors
if "unknown error" in result.get("output", "").lower() or result.get("error"):
print("Received error, verifying actual outcome...")
# Verify filesystem state
all_present = True
for f in expected_files:
try:
list_dir(path=f"/workspace/{f}") # or appropriate path
print(f"β {f} verified")
except:
print(f"β {f} missing")
all_present = False
if all_present:
print("Task completed successfully despite error message")
return {"status": "success_verified", "files": expected_files}
else:
print("True failure - files not created")
return {"status": "failed", "error": result.get("error")}
return {"status": "success", "output": result.get("output")}
Shell Command Example
# After run_shell returns error, verify with:
ls -la /workspace/output/
test -f /workspace/output/result.pdf && echo "File exists" || echo "File missing"
file /workspace/output/result.pdf # Verify file type is correct
Benefits
- Saves iterations: Avoids unnecessary retries when task already succeeded
- Handles tool bugs: Works around sandbox/shell tool reporting issues
- Faster completion: Move forward immediately when verification passes
- Clearer debugging: Distinguishes true failures from false positives
Anti-Patterns to Avoid
- β Immediately retrying on any error without verification
- β Assuming "unknown error" means complete failure
- β Only checking file existence without validating content
- β Skipping verification for "minor" tasks (any file output should be verified)
Related Tools
list_dirβ Check directory contentsread_fileβ Validate file content and accessibilityexecute_code_sandboxβ Primary execution tool this pattern supportsrun_shellβ Shell execution tool this pattern supports
FAQ
Why check before retrying?
The skill says the task may have succeeded even when the tool reported an unknown error, so retrying could waste effort.
What does checking content add?
Opening the file confirms it contains the expected data, not just that it exists.
Which files does it check?
It checks the output files that the task was expected to create.
Details
Original description by the author
Verify task completion by checking filesystem state when execute_code_sandbox or run_shell return misleading unknown errors
repo: HKUDS/AgentPilot
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #13026
- License
- MIT
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.