Reliable Python execution workflow when execute_code_sandbox or shell_agent fail
Use this pattern when:
execute_code_sandbox returns unknown errors or fails repeatedlyshell_agent cannot successfully execute Python codeInstead of delegating Python execution to agents, use this two-step inline approach:
.py file using write_filerun_shell with python <script.py>Use write_file to create a Python script with all necessary code inline:
write_file