sandbox-execution-fallback-238489
यह क्या करती है
यह स्किल AI एजेंट को तब एक स्वतंत्र Python स्क्रिप्ट बनाकर चलाने का निर्देश देती है, जब सैंडबॉक्स लाइब्रेरी वाला फ़ाइल काम न संभाल पाए। यह उन लोगों के लिए है जिन्हें PDF, Word फ़ाइलें या स्प्रेडशीट चाहिए।
कब इस्तेमाल करें
- ✓जब PDF, Word या Excel फ़ाइल बनाने में कोड सैंडबॉक्स विफल हो।
- ✓जब काम में ऐसी Python लाइब्रेरी चाहिए जो सैंडबॉक्स में उपलब्ध न हो।
- ✓जब आपको स्क्रिप्ट जिस वातावरण में चलती है उस पर ज़्यादा नियंत्रण चाहिए।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-execution-fallback-238489/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे नोट्स से reportlab के साथ एक PDF बनाइए। सैंडबॉक्स विफल हुआ, इसलिए एक स्क्रिप्ट फ़ाइल लिखकर चलाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक फ़ाइल लिखने वाले टूल से स्क्रिप्ट सहेजता है, फिर शेल से python3 के साथ चलाता है। वह जाँचता है कि स्क्रिप्ट पूरी हुई और अपेक्षित फ़ाइलें बनीं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Sandbox Execution Fallback
This skill provides a reliable fallback pattern when execute_code_sandbox fails for code execution tasks (especially PDF generation, complex file operations, or library-dependent tasks).
When to Use
Use this fallback pattern when:
execute_code_sandboxreturns errors or fails to produce expected output- The task requires specific Python libraries not available in the sandbox
- File I/O operations (especially PDF, docx, xlsx) fail in the sandbox environment
- You need more control over the execution environment
Step-by-Step Instructions
Step 1: Write the Python Script to a File
Instead of executing code directly in the sandbox, use write_file to create a standalone Python script:
Use write_file to create a script (e.g., script.py) with your complete Python code.
Step 2: Execute the Script Directly
Run the script using run_shell with Python:
Use run_shell with command: python3 script.py
Step 3: Verify Output
Check that the script executed successfully and produced the expected files or output.
Example Pattern
Instead of this (sandbox execution):
execute_code_sandbox with code using libraries like reportlab, fpdf, etc.
Do this (fallback pattern):
# Step 1: Create the script
write_file:
path: generate_pdf.py
content: |
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
def create_pdf(filename):
c = canvas.Canvas(filename, pagesize=letter)
c.drawString(100, 750, "Hello World")
c.save()
create_pdf("output.pdf")
# Step 2: Execute directly
run_shell:
command: python3 generate_pdf.py
Best Practices
- Include all dependencies in the script - Make the script self-contained
- Add error handling - Include try/except blocks to catch and report errors
- Use absolute or clear relative paths - Ensure file paths work in the execution context
- Verify prerequisites - Check that required Python packages are available
- Clean up temporary files - Remove intermediate scripts after successful execution if needed
Troubleshooting
If run_shell also fails:
- Check if Python 3 is available:
run_shell command: python3 --version - Install missing packages:
run_shell command: pip3 install package_name - Check file permissions and paths
- Review error output from the shell execution for specific issues
Why This Works
This pattern bypasses sandbox limitations by:
- Running code in the actual execution environment with full library access
- Avoiding sandbox timeout or resource constraints
- Enabling direct file system access for I/O operations
- Providing better error messages from the native Python interpreter
Self-Assessment
This skill captures a genuinely reusable pattern that:
- Is generalizable beyond just PDF generation to any execute_code_sandbox failure
- Provides clear, actionable steps
- Includes example code and troubleshooting guidance
- Would benefit future executions facing similar sandbox limitations
अक्सर पूछे जाने वाले सवाल
यह किन फ़ाइल प्रकारों को कवर करती है?
स्किल PDF, Word और Excel फ़ाइलों को उन आउटपुट के रूप में बताती है जो सैंडबॉक्स में अक्सर विफल होते हैं।
सीधे कोड चलाने की बजाय फ़ाइल क्यों लिखें?
सहेजी हुई स्क्रिप्ट शेल को चलाने के लिए एक साफ़ फ़ाइल देती है और काम की जाँच आसान बनाती है।
क्या एजेंट आउटपुट की पुष्टि करता है?
हाँ, अंतिम चरण यह जाँचना है कि अपेक्षित फ़ाइलें बनीं।
जानकारी
लेखक का मूल विवरण
Fallback pattern for when execute_code_sandbox fails - write script to file and execute directly with run_shell
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12984
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।