Zum Inhalt springen
Skillpedia
Allgemeines Programmieren7.8k · #12988

sandbox-fallback-execution-048d5a

Was er macht

Dieser Skill weist den KI-Agenten an, Python nach wiederholten Sandbox-Fehlern außerhalb der Sandbox auszuführen. Er richtet sich an Code, der die Isolation der Sandbox nicht braucht.

Wann du ihn nutzt

  • ✓Wenn die Code-Sandbox nach mehreren Versuchen mit e2b-bezogenen Fehlern scheitert.
  • ✓Wenn der Code keine Sandbox-Isolation braucht, um sicher zu laufen.
  • ✓Wenn du eine Tabelle aus Python brauchst und die Sandbox weiterhin ausfällt.

Link zum Skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Die Sandbox ist dreimal mit e2b-Fehlern gescheitert. Führe mein Excel-Skript stattdessen direkt in der Shell aus.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent schreibt den Python-Code in eine Datei im Arbeitsordner und führt sie mit python3 über die Shell mit einem Zeitlimit aus. Danach liest er die Ausgabe, um Fehler oder Meldungen zur Dateierstellung zu prüfen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen

Was bedeutet e2b hier?

Es ist der Name des Sandbox-Dienstes. Der Skill behandelt dessen Fehler als Auslöser zum Umschalten.

Ist es sicher, Code außerhalb der Sandbox auszuführen?

Der Skill sagt, das gilt für Code, der keine Isolation braucht, also nur für Code, dem du vertraust.

Wo sollte das Skript gespeichert werden?

Der Skill verwendet einen Arbeitsordner und vollständige Pfade, damit Ausgabedateien an einem bekannten Ort landen.

Details

Originalbeschreibung des Autors

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

repo: HKUDS/AgentPilot

Beliebtheit

GitHub-Sterne
7.8k
Platz im Ranking
#12988
Lizenz
MIT
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills