Skillpedia
برمجة عامة7.8k · #12988

sandbox-fallback-execution-048d5a

ما الذي تفعله

توجّه هذه المهارة وكيل الذكاء الاصطناعي إلى تشغيل Python خارج بيئة التنفيذ المعزولة بعد تكرار أخطائها. وهي مناسبة للكود الذي لا يحتاج إلى عزل بيئة التنفيذ.

متى تستخدمها

  • ✓عندما تفشل بيئة التنفيذ المعزولة بأخطاء تخص خدمة e2b بعد عدة محاولات.
  • ✓عندما لا يحتاج الكود إلى عزل بيئة التنفيذ ليعمل بأمان.
  • ✓عندما تحتاج إلى جدول Excel من Python وما زالت بيئة التنفيذ متوقفة.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-fallback-execution-048d5a/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“فشلت بيئة التنفيذ المعزولة ثلاث مرات بأخطاء e2b. شغّل برنامج Excel الخاص بي مباشرة في الطرفية بدلًا من ذلك.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يكتب الوكيل كود Python في ملف داخل مجلد العمل، ويشغّله بالأمر python3 عبر الطرفية مع حد زمني. ثم يقرأ المخرجات ليتحقق من الأخطاء أو رسائل إنشاء الملفات.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من 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
الأسئلة الشائعة

ما الذي يعنيه e2b هنا؟

هو اسم خدمة بيئة التنفيذ المعزولة، وتعدّ المهارة أخطاءها سببًا للانتقال.

هل من الآمن تشغيل الكود خارج بيئة التنفيذ المعزولة؟

تقول المهارة إنها للكود الذي لا يحتاج إلى العزل، لذا استخدمها للكود الذي تثق به فقط.

أين يُحفظ البرنامج؟

تستخدم المهارة مجلد عمل ومسارات كاملة حتى تُحفظ ملفات الإخراج في مكان معروف.

التفاصيل

الوصف الأصلي من المؤلف

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

repo: HKUDS/AgentPilot

الشعبية

نجوم GitHub
7.8k
الترتيب
#12988
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة