[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KG1GCYTWMBPQ6SX3G41QA5":3,"skill-same:01M6KG1GCYTWMBPQ6SX3G41QA5":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":14,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6KG1GCYTWMBPQ6SX3G41QA5","sandbox-fallback-python-e5d7ae",null,"Fallback to run_shell with Python heredoc when execute_code_sandbox fails","xyliu-cs\u002FOpenSpace-GDPval","xyliu-cs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89236536?v=4","01M6KF8Z1V4TXS86CKSH48BY8T","xy","01M6KF8Z67443W0SHXM85JEF0B",0,"MIT","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28],"python","sandbox","fallback","sandbox fallback python e5d7ae","sandbox fallback python","run","code","shell","execute","with","2026-11-10 10:12:30",false,"---\nname: sandbox-fallback-python-e5d7ae\ndescription: Fallback to run_shell with Python heredoc when execute_code_sandbox fails\n---\n\n# Python Sandbox Fallback Pattern\n\n## When to Use\n\nUse this pattern when `execute_code_sandbox` fails with e2b\u002Fsandbox initialization errors, especially when running Python code that requires external libraries like reportlab, pandas, numpy, etc.\n\n## Common Failure Indicators\n\nDetect these error patterns to trigger the fallback:\n- `e2b` initialization errors\n- `sandbox` creation\u002Fcreation timeout failures\n- `container` startup errors\n- Connection\u002Frefusal errors from sandbox service\n\n## The Fallback Pattern\n\n### Basic Heredoc Approach\n\nFor short scripts, use a Python heredoc directly in `run_shell`:\n\n```python\nrun_shell(\n    command=\"\"\"python3 \u003C\u003C 'EOF'\nimport sys\nprint(f\"Python version: {sys.version}\")\n# Your code here\nEOF\n\"\"\",\n    timeout=60\n)\n```\n\n### File-Based Approach for Complex Scripts\n\nFor longer scripts or when you need to preserve state across multiple executions:\n\n```python\n# Step 1: Write the script to a temporary file\nscript_content = '''\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nimport os\n\n# Your code here\n'''\n\nrun_shell(command=f\"cat > \u002Ftmp\u002Fscript.py \u003C\u003C 'SCRIPT_EOF'\\n{script_content}\\nSCRIPT_EOF\")\n\n# Step 2: Execute the script\nresult = run_shell(command=\"python3 \u002Ftmp\u002Fscript.py\", timeout=120)\n```\n\n## Key Considerations\n\n### Timeouts\n- `run_shell` typically needs longer timeouts than `execute_code_sandbox`\n- Use `timeout=60` for simple scripts\n- Use `timeout=120` or higher for library-heavy operations (PDF generation, data processing)\n\n### Library Availability\n- Verify required libraries are installed in the shell environment\n- Install missing libraries first if needed:\n  ```python\n  run_shell(command=\"pip install reportlab\", timeout=60)\n  ```\n\n### Error Handling\n- Capture and inspect `run_shell` output for Python errors\n- Check stderr for import failures or runtime exceptions\n\n### Working Directory\n- Files created via `run_shell` are in the current working directory by default\n- Use absolute paths or `os.getcwd()` to reference files reliably\n\n## Example: PDF Generation with reportlab\n\n```python\n# FALLBACK VERSION (when execute_code_sandbox fails):\n\npdf_code = \"\"\"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nfrom reportlab.lib.units import inch\n\ndef create_memo(filename):\n    c = canvas.Canvas(filename, pagesize=letter)\n    c.drawString(1*inch, 10*inch, \"Legal Memorandum\")\n    c.save()\n    print(f\"Created {filename}\")\n\ncreate_memo('\u002Fworkspace\u002Foutput.pdf')\n\"\"\"\n\n# Write script to file\nrun_shell(command=f\"cat > \u002Ftmp\u002Fcreate_pdf.py \u003C\u003C 'PYEOF'\\n{pdf_code}\\nPYEOF\")\n\n# Execute and verify\nrun_shell(command=\"python3 \u002Ftmp\u002Fcreate_pdf.py\", timeout=120)\n\n# Verify output exists\nrun_shell(command=\"ls -la \u002Fworkspace\u002Foutput.pdf\", timeout=30)\n```\n\n## Comparison Table\n\n| Aspect | execute_code_sandbox | run_shell (fallback) |\n|--------|---------------------|---------------------|\n| Isolation | High (containerized) | Low (host environment) |\n| Reliability | Can fail with e2b errors | More reliable |\n| Library Access | Pre-configured sandbox | Depends on host |\n| Timeout | Default 30s | Configurable |\n| File Access | ARTIFACT_PATH convention | Direct filesystem |\n\n## Migration Checklist\n\nWhen switching from `execute_code_sandbox` to `run_shell`:\n\n- [ ] Increase timeout values (typically 2-4x)\n- [ ] Convert ARTIFACT_PATH references to actual file paths\n- [ ] Add explicit file verification steps after execution\n- [ ] Handle potential library import errors\n- [ ] Test script execution in shell environment first","# Python Sandbox Fallback Pattern\n\n## When to Use\n\nUse this pattern when `execute_code_sandbox` fails with e2b\u002Fsandbox initialization errors, especially when running Python code that requires external libraries like reportlab, pandas, numpy, etc.\n\n## Common Failure Indicators\n\nDetect these error patterns to trigger the fallback:\n- `e2b` initialization errors\n- `sandbox` creation\u002Fcreation timeout failures\n- `container` startup errors\n- Connection\u002Frefusal errors from sandbox service\n\n## The Fallback Pattern\n\n### Basic Heredoc Approach\n\nFor short scripts, use a Python heredoc directly in `run_shell`:\n\n```python\nrun_shell(\n    command=\"\"\"python3 \u003C\u003C 'EOF'\nimport sys\nprint(f\"Python version: {sys.version}\")\n# Your code here\nEOF\n\"\"\",\n    timeout=60\n)\n```\n\n### File-Based Approach for Complex Scripts\n\nFor longer scripts or when you need to preserve state across multiple executions:\n\n```python\n# Step 1: Write the script to a temporary file\nscript_content = '''\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nimport os\n\n# Your code here\n'''\n\nrun_shell(command=f\"cat > \u002Ftmp\u002Fscript.py \u003C\u003C 'SCRIPT_EOF'\\n{script_content}\\nSCRIPT_EOF\")\n\n# Step 2: Execute the script\nresult = run_shell(command=\"python3 \u002Ftmp\u002Fscript.py\", timeout=120)\n```\n\n## Key Considerations\n\n### Timeouts\n- `run_shell` typically needs longer timeouts than `execute_code_sandbox`\n- Use `timeout=60` for simple scripts\n- Use `timeout=120` or higher for library-heavy operations (PDF generation, data processing)\n\n### Library Availability\n- Verify required libraries are installed in the shell environment\n- Install missing libraries first if needed:\n  ```python\n  run_shell(command=\"pip install reportlab\", timeout=60)\n  ```\n\n### Error Handling\n- Capture and inspect `run_shell` output for Python errors\n- Check stderr for import failures or runtime exceptions\n\n### Working Directory\n- Files created via `run_shell` are in the current working directory by default\n- Use absolute paths or `os.getcwd()` to reference files reliably\n\n## Example: PDF Generation with reportlab\n\n```python\n# FALLBACK VERSION (when execute_code_sandbox fails):\n\npdf_code = \"\"\"\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\nfrom reportlab.lib.units import inch\n\ndef create_memo(filename):\n    c = canvas.Canvas(filename, pagesize=letter)\n    c.drawString(1*inch, 10*inch, \"Legal Memorandum\")\n    c.save()\n    print(f\"Created {filename}\")\n\ncreate_memo('\u002Fworkspace\u002Foutput.pdf')\n\"\"\"\n\n# Write script to file\nrun_shell(command=f\"cat > \u002Ftmp\u002Fcreate_pdf.py \u003C\u003C 'PYEOF'\\n{pdf_code}\\nPYEOF\")\n\n# Execute and verify\nrun_shell(command=\"python3 \u002Ftmp\u002Fcreate_pdf.py\", timeout=120)\n\n# Verify output exists\nrun_shell(command=\"ls -la \u002Fworkspace\u002Foutput.pdf\", timeout=30)\n```\n\n## Comparison Table\n\n| Aspect | execute_code_sandbox | run_shell (fallback) |\n|--------|---------------------|---------------------|\n| Isolation | High (containerized) | Low (host environment) |\n| Reliability | Can fail with e2b errors | More reliable |\n| Library Access | Pre-configured sandbox | Depends on host |\n| Timeout | Default 30s | Configurable |\n| File Access | ARTIFACT_PATH convention | Direct filesystem |\n\n## Migration Checklist\n\nWhen switching from `execute_code_sandbox` to `run_shell`:\n\n- [ ] Increase timeout values (typically 2-4x)\n- [ ] Convert ARTIFACT_PATH references to actual file paths\n- [ ] Add explicit file verification steps after execution\n- [ ] Handle potential library import errors\n- [ ] Test script execution in shell environment first",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs","https:\u002F\u002Fxyliu-cs.github.io","PhD Student in CS, CUHK-Shenzhen.","2026-04-06 20:32:15",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill sandbox-fallback-python-e5d7ae",{"tool":48,"command":49},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill sandbox-fallback-python-e5d7ae",{"tool":51,"command":52},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill sandbox-fallback-python-e5d7ae","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002FSKILL.md",true,[56],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},".skill_id","OTHER","其他",44,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002F.skill_id",[63,76,84,99,119,135],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":29},"01M6KG8MF1S664SWBDENYRSCK8","zip-export-deliverable","Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-export-deliverable\u002FSKILL.md",[],[70,71,72,73,74,75],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":29},"01M6KG8GAZWHHEK7VNJDW0ME21","zip-deliverable-finalization","Ensure codebase deliverables are properly packaged as ZIP exports in a dedicated final step","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzip-deliverable-finalization\u002FSKILL.md",[],[83,71,73,74,75],"zip deliverable finalization",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":29},"01M6KG8CMQQ1PYMNTSRZ9VS1MD","zero-iteration-failure-analysis","Identify and handle agent failures with 0 iterations as pre-execution system issues","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fzero-iteration-failure-analysis\u002FSKILL.md",[],[91,92,93,94,95,28,96,97,75,98],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","issues","execution","system",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":29},"01M6KG86W3PA07FT9W58YHHERM","write-file-fallback-report","Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report\u002FSKILL.md",[],[21,106,107,108,109,110,111,112,113,114,115,116,117,118],"write","file","report","write file fallback report","domain","professional","sources","retrieval","generate","embedded","documents","data","knowledge",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":29},"01M6KG82GAEY3GG77CMGCK1C2T","fallback-doc-with-delegation","Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text\u002Fmarkdown","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced\u002FSKILL.md",[],[126,28,21,127,128,26,116,114,107,129,130,131,106,132,111,133,134],"fallback doc with delegation","doc","delegation","markdown","tool","text","simple","formats","for",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":29},"01M6KG7WT7GX5NYCGEFHW22NV7","context-anchored-fallback-report","Generate documents with write_file when retrieval tools fail, with explicit guardrails against task context drift","https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fwrite-file-fallback-report-enhanced-4bc5c2\u002FSKILL.md",[],[21,108,142,143,114,107,144,145,106,146,147,113,28,148,116],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]