[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJZHV3RMP44R569E7FKFV7":3,"skill-same:01M6KJZHV3RMP44R569E7FKFV7":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":13,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M6KJZHV3RMP44R569E7FKFV7","sandbox-fallback-python-e5d7ae",null,"Fallback to run_shell with Python heredoc when execute_code_sandbox fails","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27],"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","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add AG064\u002FOpenSpace --skill sandbox-fallback-python-e5d7ae",{"tool":46,"command":47},"bunx","bunx skills add AG064\u002FOpenSpace --skill sandbox-fallback-python-e5d7ae",{"tool":49,"command":50},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill sandbox-fallback-python-e5d7ae","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},".skill_id","OTHER","其他",44,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fsandbox-fallback-python-e5d7ae\u002F.skill_id",[61,84,100,108,138,154],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":28},"01M6KKMPWA0B5SCCH766F8M5EA","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,18,83],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","typescript",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":28},"01M6KKMJXVBNVEY3TRK055F4A7","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[91,92,70,81,93,94,82,18,95,96,97,98,99,74,76,27],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":28},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[70,107,18,74,97,81,25,82,76],"write special chars heredoc",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":119,"publishedAt":28},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[120,121,122,123,83,124,125,126,127,128,74,129,130,131,132,133,134,135,136,137],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":28},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[145,146,147,148,74,149,27,150,151,152,153],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":28},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[161,162,163,164,165,166,82,167,168,169],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]