Langsung ke konten
Skillpedia
Pemrograman umum7.8k · #12988

sandbox-fallback-execution-048d5a

Fungsinya

Skill ini memberi tahu agent AI untuk menjalankan Python di luar sandbox setelah error sandbox berulang kali terjadi. Skill ini ditujukan untuk kode yang tidak memerlukan isolasi sandbox.

Kapan dipakai

  • ✓Saat sandbox kode gagal dengan error terkait e2b setelah beberapa percobaan.
  • ✓Saat kode tidak memerlukan isolasi sandbox untuk berjalan.
  • ✓Saat Anda memerlukan spreadsheet yang dibuat dengan Python dan sandbox masih tidak berfungsi.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/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/sandbox-fallback-execution-048d5a/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

“Sandbox sudah gagal tiga kali dengan error e2b. Jalankan skrip Excel saya langsung di shell.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menulis kode Python ke file di folder ruang kerja dan menjalankannya dengan python3 lewat shell, dengan batas waktu. Setelah itu agent membaca output untuk memeriksa error atau pesan pembuatan file.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Sandbox Fallback Execution

When execute_code_sandbox repeatedly fails with e2b sandbox errors, use this fallback pattern to execute Python code directly on the host system.

When to Use

Use this skill when:

  • execute_code_sandbox fails with e2b-related errors
  • Multiple retry attempts (3+) have not resolved the issue
  • The code does not require sandbox isolation

Steps

Step 1: Write Python Script to File

Use write_file to save your Python code as a .py file:

Tool: write_file
path: /workspace/script_name.py
content: |
  # Your Python code here
  import pandas as pd
  # ... rest of code

Step 2: Execute via Shell

Use run_shell with explicit python3 path:

Tool: run_shell
command: python3 /workspace/script_name.py
timeout: 120

Step 3: Verify Output

Check the stdout/stderr from run_shell for:

  • Successful execution messages
  • Expected output or file creation confirmations
  • Any errors that need debugging

Complete Example

# Instead of this (failing):
Tool: execute_code_sandbox
code: |
  import pandas as pd
  df = pd.DataFrame({'a': [1,2,3]})
  df.to_excel('output.xlsx')

# Use this fallback:
Tool: write_file
path: /workspace/generate_report.py
content: |
  import pandas as pd
  
  # Create sample data
  df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
  
  # Save to Excel
  df.to_excel('/workspace/output.xlsx', index=False)
  print('File created successfully')

Tool: run_shell
command: python3 /workspace/generate_report.py
timeout: 120

Tips

  1. Use absolute paths in your Python script when reading/writing files
  2. Add print statements for debugging since you won't get interactive output
  3. Increase timeout if the script performs heavy computation
  4. Check working directory - scripts run from the workspace root by default
  5. Handle errors explicitly with try/except blocks and meaningful error messages

Common e2b Errors That Trigger This Fallback

  • E2B execution error
  • Sandbox timeout
  • Connection refused
  • Sandbox initialization failed
  • Repeated retry failures (3+ attempts)

When NOT to Use This Fallback

  • When sandbox isolation is required for security
  • When the code needs specific sandbox environment variables
  • On first failure only - try execute_code_sandbox retry first
Pertanyaan umum

Apa yang dimaksud dengan e2b di sini?

Itu adalah nama layanan sandbox, dan skill ini menjadikan error-nya sebagai pemicu untuk beralih.

Apakah aman menjalankan kode di luar sandbox?

Skill ini hanya untuk kode yang tidak memerlukan isolasi, jadi gunakan hanya untuk kode yang Anda percaya.

Di mana skrip sebaiknya disimpan?

Skill ini memakai folder ruang kerja dan path lengkap agar file output berada di lokasi yang diketahui.

Detail

Deskripsi asli dari pembuat

Fallback method to execute Python code when execute_code_sandbox fails with e2b errors

repo: HKUDS/AgentPilot

Popularitas

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

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa