[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KFFVMND03E71V8VXGBE61F":3,"skill-same:01M6KFFVMND03E71V8VXGBE61F":61},{"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":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":14,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6KFFVMND03E71V8VXGBE61F","execute-code-fallback",null,"Fallback from execute_code_sandbox to run_shell when e2b sandbox is unavailable","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\u002Fexecute-code-fallback\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27],"code","execute","fallback","execute code fallback","sandbox","run","shell","e2b sandbox","e2b","2026-11-10 10:12:30",false,"---\nname: execute-code-fallback\ndescription: Fallback from execute_code_sandbox to run_shell when e2b sandbox is unavailable\n---\n\n# Execute Code Fallback Pattern\n\nWhen `execute_code_sandbox` fails due to e2b unavailability, immediately fall back to `run_shell` with embedded Python code. This ensures task continuity when the sandbox service is down.\n\n## When to Apply\n\nUse this pattern when you observe:\n- `execute_code_sandbox` returns errors mentioning \"e2b\", \"sandbox unavailable\", or connection timeouts\n- Repeated sandbox execution failures (2+ attempts)\n- Error messages indicating the code execution environment is unreachable\n\n## Fallback Procedure\n\n### Step 1: Detect the Failure\n\nIdentify that `execute_code_sandbox` has failed. Common error indicators:\n- \"e2b service unavailable\"\n- \"Sandbox connection failed\"\n- \"Execution environment not reachable\"\n- Timeout errors during code execution\n\n### Step 2: Switch to run_shell with Embedded Python\n\nInstead of:\n```python\nexecute_code_sandbox(code=\"...\")\n```\n\nUse:\n```bash\nrun_shell(command=\"python3 -c '...your Python code...'\")\n```\n\n### Step 3: Install Dependencies First (If Needed)\n\nIf your Python code requires external packages, install them first:\n\n```bash\nrun_shell(command=\"pip install pandas requests matplotlib\")\n```\n\nThen execute your main code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport requests\n\n# Your code here\nprint(\"Success\")\nEOF\n\")\n```\n\n### Step 4: Use Heredoc for Multi-line Code\n\nFor complex Python scripts, use heredoc syntax for cleaner code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'PYTHON_SCRIPT'\nimport json\nimport os\n\n# Complex logic here\ndata = {'key': 'value'}\nwith open('output.json', 'w') as f:\n    json.dump(data, f)\n\nprint('File created successfully')\nPYTHON_SCRIPT\n\")\n```\n\n## Complete Example\n\n**Scenario:** You need to process a CSV file and generate a report.\n\n**Original approach (sandbox):**\n```python\nexecute_code_sandbox(code=\"\"\"\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\n\"\"\")\n```\n\n**Fallback approach (run_shell):**\n```bash\n# First install dependencies if needed\nrun_shell(command=\"pip install pandas --quiet\")\n\n# Then execute the code\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\nEOF\n\")\n```\n\n## Important Considerations\n\n1. **State Persistence**: Unlike `execute_code_sandbox`, `run_shell` executions may not share state between calls. Save intermediate results to files if needed.\n\n2. **Working Directory**: Ensure you're operating in the correct directory. Use `pwd` to verify or include `cd \u002Fpath\u002Fto\u002Fworkdir` in your commands.\n\n3. **Python Version**: Use `python3` explicitly to avoid ambiguity. Verify with `python3 --version` if needed.\n\n4. **Error Handling**: Check the stdout\u002Fstderr from `run_shell` to confirm success. Failed Python scripts will return non-zero exit codes.\n\n5. **Security**: Be cautious when embedding user-provided data into shell commands. Escape appropriately or use file-based input.\n\n6. **Performance**: For large computations, `run_shell` may be slower than sandbox. Consider breaking into smaller steps if timeouts occur.\n\n## Quick Reference\n\n| Task | Sandbox Approach | Fallback Approach |\n|------|-----------------|-------------------|\n| Simple calculation | `execute_code_sandbox(code=\"print(2+2)\")` | `run_shell(command=\"python3 -c 'print(2+2)'\")` |\n| Install + run | `execute_code_sandbox(code=\"import pkg; ...\")` | `run_shell(command=\"pip install pkg && python3 -c '...'\")` |\n| Multi-line script | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n| File I\u002FO | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n\n## Recovery Checklist\n\n- [ ] Confirm `execute_code_sandbox` failure (not a code bug)\n- [ ] Switch to `run_shell` immediately\n- [ ] Install required packages with `pip install`\n- [ ] Use heredoc for multi-line Python\n- [ ] Verify output and handle errors\n- [ ] Save intermediate results to files if multi-step","# Execute Code Fallback Pattern\n\nWhen `execute_code_sandbox` fails due to e2b unavailability, immediately fall back to `run_shell` with embedded Python code. This ensures task continuity when the sandbox service is down.\n\n## When to Apply\n\nUse this pattern when you observe:\n- `execute_code_sandbox` returns errors mentioning \"e2b\", \"sandbox unavailable\", or connection timeouts\n- Repeated sandbox execution failures (2+ attempts)\n- Error messages indicating the code execution environment is unreachable\n\n## Fallback Procedure\n\n### Step 1: Detect the Failure\n\nIdentify that `execute_code_sandbox` has failed. Common error indicators:\n- \"e2b service unavailable\"\n- \"Sandbox connection failed\"\n- \"Execution environment not reachable\"\n- Timeout errors during code execution\n\n### Step 2: Switch to run_shell with Embedded Python\n\nInstead of:\n```python\nexecute_code_sandbox(code=\"...\")\n```\n\nUse:\n```bash\nrun_shell(command=\"python3 -c '...your Python code...'\")\n```\n\n### Step 3: Install Dependencies First (If Needed)\n\nIf your Python code requires external packages, install them first:\n\n```bash\nrun_shell(command=\"pip install pandas requests matplotlib\")\n```\n\nThen execute your main code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\nimport requests\n\n# Your code here\nprint(\"Success\")\nEOF\n\")\n```\n\n### Step 4: Use Heredoc for Multi-line Code\n\nFor complex Python scripts, use heredoc syntax for cleaner code:\n\n```bash\nrun_shell(command=\"python3 \u003C\u003C 'PYTHON_SCRIPT'\nimport json\nimport os\n\n# Complex logic here\ndata = {'key': 'value'}\nwith open('output.json', 'w') as f:\n    json.dump(data, f)\n\nprint('File created successfully')\nPYTHON_SCRIPT\n\")\n```\n\n## Complete Example\n\n**Scenario:** You need to process a CSV file and generate a report.\n\n**Original approach (sandbox):**\n```python\nexecute_code_sandbox(code=\"\"\"\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\n\"\"\")\n```\n\n**Fallback approach (run_shell):**\n```bash\n# First install dependencies if needed\nrun_shell(command=\"pip install pandas --quiet\")\n\n# Then execute the code\nrun_shell(command=\"python3 \u003C\u003C 'EOF'\nimport pandas as pd\ndf = pd.read_csv('data.csv')\nsummary = df.describe()\nprint(summary)\nEOF\n\")\n```\n\n## Important Considerations\n\n1. **State Persistence**: Unlike `execute_code_sandbox`, `run_shell` executions may not share state between calls. Save intermediate results to files if needed.\n\n2. **Working Directory**: Ensure you're operating in the correct directory. Use `pwd` to verify or include `cd \u002Fpath\u002Fto\u002Fworkdir` in your commands.\n\n3. **Python Version**: Use `python3` explicitly to avoid ambiguity. Verify with `python3 --version` if needed.\n\n4. **Error Handling**: Check the stdout\u002Fstderr from `run_shell` to confirm success. Failed Python scripts will return non-zero exit codes.\n\n5. **Security**: Be cautious when embedding user-provided data into shell commands. Escape appropriately or use file-based input.\n\n6. **Performance**: For large computations, `run_shell` may be slower than sandbox. Consider breaking into smaller steps if timeouts occur.\n\n## Quick Reference\n\n| Task | Sandbox Approach | Fallback Approach |\n|------|-----------------|-------------------|\n| Simple calculation | `execute_code_sandbox(code=\"print(2+2)\")` | `run_shell(command=\"python3 -c 'print(2+2)'\")` |\n| Install + run | `execute_code_sandbox(code=\"import pkg; ...\")` | `run_shell(command=\"pip install pkg && python3 -c '...'\")` |\n| Multi-line script | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n| File I\u002FO | `execute_code_sandbox(code=\"...\")` | `run_shell(command=\"python3 \u003C\u003C 'EOF'...EOF\")` |\n\n## Recovery Checklist\n\n- [ ] Confirm `execute_code_sandbox` failure (not a code bug)\n- [ ] Switch to `run_shell` immediately\n- [ ] Install required packages with `pip install`\n- [ ] Use heredoc for multi-line Python\n- [ ] Verify output and handle errors\n- [ ] Save intermediate results to files if multi-step",{"name":5,"description":7},"main","af1b40a42167d09c30b3a63000aa14ace4c1e229","gdpval_bench\u002Fskills\u002Fexecute-code-fallback","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":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add xyliu-cs\u002FOpenSpace-GDPval --skill execute-code-fallback",{"tool":47,"command":48},"bunx","bunx skills add xyliu-cs\u002FOpenSpace-GDPval --skill execute-code-fallback",{"tool":50,"command":51},"pnpm","pnpm dlx skills add xyliu-cs\u002FOpenSpace-GDPval --skill execute-code-fallback","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexecute-code-fallback\u002FSKILL.md",true,[55],{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},".skill_id","OTHER","其他",35,"https:\u002F\u002Fgithub.com\u002Fxyliu-cs\u002FOpenSpace-GDPval\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexecute-code-fallback\u002F.skill_id",[62,75,83,99,119,135],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":28},"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",[],[69,70,71,72,73,74],"zip export deliverable","zip","export","deliverables","codebase","as",{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":28},"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",[],[82,70,72,73,74],"zip deliverable finalization",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":28},"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",[],[90,91,92,93,94,95,96,97,74,98],"failure analysis","ZeRO","analysis","iteration","zero iteration failure analysis","with","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":28},"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":28},"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,95,21,127,128,25,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":28},"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,95,148,116],"context","context anchored fallback report","Guardrails","Tools","task","drift","context drift"]