Langsung ke konten
Skillpedia
Pemrograman umum7.8k Β· #13026

verify-success-after-unknown-error

Fungsinya

Skill ini memberi tahu agent AI untuk memeriksa apakah pekerjaannya benar-benar selesai sebelum mencoba ulang setelah error yang tidak jelas. Skill ini ditujukan untuk orang yang alatnya melaporkan error tidak diketahui meskipun file sudah dibuat.

Kapan dipakai

  • βœ“Saat sandbox kode mengembalikan error tidak diketahui padahal kodenya mungkin sudah selesai dijalankan.
  • βœ“Saat perintah shell gagal dengan pesan yang tidak jelas pada tugas file.
  • βœ“Saat pembuatan atau perubahan file melaporkan error yang mungkin tidak benar.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verify-success-after-unknown-error/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/verify-success-after-unknown-error/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œAlat melaporkan error tidak diketahui saat membuat PDF saya, tetapi file mungkin sudah ada. Periksa apakah file dibuat dan dapat dibaca sebelum Anda mencoba ulang.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mendaftar folder output yang diharapkan dan memeriksa bahwa setiap file yang diharapkan ada. Setelah itu agent membuka file untuk memastikan isinya sesuai, sehingga pekerjaan yang sudah berhasil tidak diulang.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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_sandbox returns "unknown error" but your code may have completed
  • run_shell fails 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 contents
  • read_file β€” Validate file content and accessibility
  • execute_code_sandbox β€” Primary execution tool this pattern supports
  • run_shell β€” Shell execution tool this pattern supports
Pertanyaan umum

Mengapa memeriksa sebelum mencoba ulang?

Skill ini menyatakan tugas mungkin sudah berhasil meskipun alat melaporkan error tidak diketahui, sehingga mencoba ulang bisa membuang usaha.

Apa tambahan dari memeriksa isi?

Membuka file memastikan isinya berisi data yang diharapkan, bukan hanya bahwa file itu ada.

File mana yang diperiksa?

Agent memeriksa file output yang diharapkan dibuat oleh tugas.

Detail

Deskripsi asli dari pembuat

Verify task completion by checking filesystem state when execute_code_sandbox or run_shell return misleading unknown errors

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#13026
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa