sandbox-exec-fallback
यह क्या करती है
यह स्किल AI एजेंट को कोड सैंडबॉक्स से हटकर शेल में चलाई गई सहेजी हुई Python फ़ाइल पर जाने का निर्देश देती है। यह उन लोगों के लिए है जो Python से स्प्रेडशीट, डेटा आउटपुट या दूसरी फ़ाइलें बनाते हैं।
कब इस्तेमाल करें
- ✓जब स्प्रेडशीट या CSV फ़ाइल बनाते समय कोड सैंडबॉक्स विफल हो।
- ✓जब सैंडबॉक्स में डेटा प्रोसेसिंग का काम विफल हो और आपको फिर भी आउटपुट चाहिए।
- ✓जब लंबे या भारी मेमोरी वाले Python काम को सैंडबॉक्स की सीमा से ज़्यादा समय चाहिए।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-exec-fallback/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी खर्च की स्प्रेडशीट बनाते समय सैंडबॉक्स विफल हुआ। Python को फ़ाइल में सहेजकर चलाइए और पुष्टि कीजिए कि स्प्रेडशीट बनी है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पूरा Python कोड एक स्क्रिप्ट फ़ाइल में लिखता है, उसे शेल में python3 से समय सीमा के साथ चलाता है, और छपा हुआ आउटपुट जाँचता है। फिर वह वर्किंग फ़ोल्डर की सूची बनाकर स्क्रिप्ट की बनाई फ़ाइलें ढूँढता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Sandbox Execution Fallback
When to Use
Use this skill when execute_code_sandbox fails during Python code execution, particularly for tasks involving:
- Spreadsheet generation (xlsx, csv)
- Data processing and transformations
- File output operations
- Complex computations requiring libraries
Recovery Pattern
When execute_code_sandbox returns an error or fails to produce expected output:
Step 1: Write Python Code to File
Use write_file to save your Python script to a file:
# Use write_file tool with:
path: "script.py"
content: <your complete Python code as a string>
Step 2: Execute via Shell
Use run_shell to execute the script:
# Use run_shell tool with:
command: "python3 script.py"
timeout: <appropriate timeout, e.g., 300 for long-running tasks>
Step 3: Verify Output
Check the shell output for:
- Success messages or printed results
- Error messages (if any, diagnose and fix the script)
- File creation confirmations
Step 4: Access Generated Files
If the script creates output files (e.g., spreadsheets), they will be in the current working directory. Use list_dir to confirm, then read_file to access if needed.
Why This Works
- Same Python Environment:
python3in the shell uses the same environment as the sandbox - More Robust: Shell execution handles long-running or memory-intensive tasks better
- Debuggable: Errors are captured in stdout/stderr for easier diagnosis
- Identical Results: Produces the same output as sandbox execution when successful
Example: Spreadsheet Generation
Original code that failed in execute_code_sandbox:
import pandas as pd
data = {'A': [1, 2, 3], 'B': [4, 5, 6]}
df = pd.DataFrame(data)
df.to_excel('output.xlsx', index=False)
print("File created successfully")
Recovery Execution:
write_filewith path="generate_spreadsheet.py" and the code above as contentrun_shellwith command="python3 generate_spreadsheet.py"- Verify output.xlsx was created with
list_dir
Tips
- Increase
timeoutfor complex operations (default 30s may be insufficient) - Add explicit print statements for debugging
- Handle exceptions in your script and print error messages
- Clean up temporary script files after successful execution if needed
अक्सर पूछे जाने वाले सवाल
आउटपुट फ़ाइल कहाँ जाती है?
स्किल कहती है कि आउटपुट फ़ाइलें मौजूदा वर्किंग फ़ोल्डर में आती हैं, इसलिए एजेंट उसी फ़ोल्डर की सूची देखकर उन्हें ढूँढता है।
स्क्रिप्ट कितनी देर चल सकती है?
स्किल लंबे कामों के लिए बढ़ी समय सीमा, जैसे 300 सेकंड, सुझाती है।
अगर स्क्रिप्ट फिर भी विफल हो तो?
स्किल कहती है कि एरर संदेश पढ़ें, स्क्रिप्ट ठीक करें और फिर चलाएँ।
जानकारी
लेखक का मूल विवरण
Fallback pattern for executing Python code when execute_code_sandbox fails by writing to file and running via shell
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12983
- लाइसेंस
- 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 खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।