Fallback workflow for running code via file write and shell when sandbox execution fails
61
72%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Critical
Do not install without reviewing
Fix and improve this skill with Tessl
tessl review fix ./benchmarks/gdpval/skills/fallback-code-execution/SKILL.mdThis skill defines a robust workaround for executing code (specifically Python) when the primary execute_code_sandbox tool fails repeatedly with unknown or transient errors. Instead of continuing to retry the failing tool, the agent switches to a manual file-write and shell-execution pattern.
Activate this workflow when:
execute_code_sandbox fails 2 or more times consecutively for the same logic.Use the write_file tool to save the Python script to a specific path in the workspace.
.py (e.g., scripts/generate_report.py).requirements.txt is updated or installed via shell beforehand.Example:
tool: write_file
path: workspace/scripts/process_data.py
content: |
import sys
# ... script logic ...
print("Success")Use the run_shell tool to execute the script using the system Python interpreter.
python3 <path_to_script> or python <path_to_script>.Example:
tool: run_shell
command: python3 scripts/process_data.py0.__file__ to avoid working directory issues.print() statements in the Python script to log progress, as shell output capture is sometimes more reliable than sandbox return values.Problem: execute_code_sandbox times out while generating a PDF.
Solution:
generate_pdf.py to workspace/scripts/.python3 workspace/scripts/generate_pdf.py via run_shell.output.pdf exists in the workspace.c5a9c4b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.