Fallback workflow for running code via file write and shell when sandbox execution fails
This 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: