sandbox-fallback-execution-048d5a
Skill này làm gì
Skill này bảo AI agent chạy Python bên ngoài sandbox sau khi sandbox báo lỗi lặp lại. Nó dành cho mã không cần sự cách ly của sandbox.
Khi nào nên dùng
- ✓Khi sandbox mã lỗi liên quan đến e2b sau nhiều lần thử.
- ✓Khi mã không cần sự cách ly của sandbox để chạy an toàn.
- ✓Khi bạn cần một bảng tính được tạo từ Python và sandbox vẫn không hoạt động.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/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
“Sandbox đã lỗi ba lần với các lỗi e2b. Hãy chạy script Excel của tôi trực tiếp trong shell.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent ghi mã Python vào một file trong thư mục làm việc và chạy nó bằng python3 qua shell, có giới hạn thời gian. Sau đó nó đọc đầu ra để kiểm tra lỗi hoặc thông báo tạo file.
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.
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_sandboxfails 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
- Use absolute paths in your Python script when reading/writing files
- Add print statements for debugging since you won't get interactive output
- Increase timeout if the script performs heavy computation
- Check working directory - scripts run from the workspace root by default
- Handle errors explicitly with try/except blocks and meaningful error messages
Common e2b Errors That Trigger This Fallback
E2B execution errorSandbox timeoutConnection refusedSandbox 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_sandboxretry first
Câu hỏi thường gặp
e2b ở đây nghĩa là gì?
Đó là tên của dịch vụ sandbox, và skill coi các lỗi của nó là tín hiệu để chuyển.
Chạy mã bên ngoài sandbox có an toàn không?
Skill nói đây là cho mã không cần cách ly, nên chỉ dùng cho mã bạn tin cậy.
Script nên được lưu ở đâu?
Skill dùng một thư mục làm việc và đường dẫn đầy đủ để file đầu ra nằm ở nơi đã biết.
Chi tiết
Mô tả gốc của tác giả
Fallback method to execute Python code when execute_code_sandbox fails with e2b errors
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12988
- 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ự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.