sandbox-execution-fallback
यह क्या करती है
यह स्किल AI एजेंट को विफल कोड रन को .py फ़ाइल में सहेजकर शेल में चलाने से रिकवर करना दिखाती है। यह उन लोगों के लिए है जिनके स्प्रेडशीट या डेटा काम सैंडबॉक्स में टाइम आउट हो जाते हैं।
कब इस्तेमाल करें
- ✓जब स्प्रेडशीट या डेटा काम पर कोड सैंडबॉक्स टाइम आउट हो।
- ✓जब काम को pandas या openpyxl जैसी बाहरी लाइब्रेरी चाहिए।
- ✓जब लंबी गणना बार-बार सैंडबॉक्स की समय सीमा से टकराए।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/sandbox-execution-fallback/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा pandas काम सैंडबॉक्स में टाइम आउट हो रहा है। कोड को फ़ाइल में सहेजिए और लंबी सीमा के साथ शेल में चलाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट विफल हुए कोड को एक साफ़ नाम वाली .py फ़ाइल में लिखता है, उसे सिस्टम के Python से चलाता है, और जाँचता है कि अपेक्षित फ़ाइलें और नतीजे मौजूद हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Sandbox Execution Fallback
When to Use
Apply this pattern when execute_code_sandbox fails or times out, particularly for:
- Spreadsheet generation (pandas, openpyxl, xlsxwriter)
- Complex data processing with file I/O
- Tasks requiring external library imports
- Long-running computations that hit timeout limits
Recovery Procedure
Step 1: Capture the Python Code
Extract or reconstruct the Python code that failed in execute_code_sandbox.
Step 2: Write Code to File
Use write_file to save the script with a .py extension:
write_file(
path="script_name.py",
content="""
import pandas as pd
# Your implementation here
"""
)
Step 3: Execute via run_shell
Run the script using the system Python interpreter:
run_shell(command="python3 script_name.py")
Step 4: Verify Output
Confirm the results match expected outputs (files created, data processed correctly, etc.).
Complete Example
# Failed: execute_code_sandbox with pandas Excel generation
# Recovery - Step 1 & 2: Write script to file
write_file(
path="generate_pnl_report.py",
content="""
import pandas as pd
from openpyxl import Workbook
# Create sample data
data = {
'Category': ['Revenue', 'Expenses', 'Tax'],
'Amount': [10000, 3000, 500]
}
df = pd.DataFrame(data)
# Write to Excel
df.to_excel('pnl_report.xlsx', index=False)
print('Report generated: pnl_report.xlsx')
"""
)
# Step 3: Execute via shell
run_shell(command="python3 generate_pnl_report.py")
# Step 4: Verify file was created
run_shell(command="ls -la pnl_report.xlsx")
Why This Works
| Aspect | execute_code_sandbox | run_shell + write_file |
|---|---|---|
| Environment | Sandboxed, limited | Full system Python |
| File I/O | Restricted | Full access |
| Timeout | Strict limits | More flexible |
| Library Support | May be limited | System-installed packages |
| Result | Identical output | Identical output |
Best Practices
- Use descriptive filenames - e.g.,
generate_report.py,process_data.py - Add error handling - Include try/except blocks in your script
- Print progress - Use print statements for debugging
- Clean up - Remove temporary scripts after successful execution if needed
- Verify results - Always confirm outputs before proceeding
Common Use Cases
- Excel/CSV report generation
- Data transformation pipelines
- Batch file processing
- API data aggregation
- Chart and visualization creation
Troubleshooting
If run_shell also fails:
- Check Python is available:
run_shell(command="python3 --version") - Install missing packages:
run_shell(command="pip3 install pandas openpyxl") - Check file permissions and paths
- Review stderr output for specific errors
अक्सर पूछे जाने वाले सवाल
अगर कोड खो गया हो तो क्या एजेंट उसे वापस बना सकता है?
स्किल कहती है कि अगर कोड सहेजा न गया हो, तो विफल प्रयास से उसे फिर से बनाएँ।
किस Python कमांड का इस्तेमाल होता है?
स्किल शेल से स्क्रिप्ट python3 के साथ चलाती है।
एजेंट सफलता कैसे जाँचता है?
वह पक्का करता है कि फ़ाइलें बनीं और डेटा अपेक्षित रूप से प्रोसेस हुआ।
जानकारी
लेखक का मूल विवरण
Recover from execute_code_sandbox failures by writing Python scripts to files and executing via run_shell
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12986
- लाइसेंस
- 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 खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।