一键导入
debug-sandbox-execution
Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Delegate tasks to OpenSpace — a full-stack autonomous worker for coding, DevOps, web research, and desktop automation, backed by an extensive MCP tool and skill library. Skills auto-improve through use, reducing token consumption over time. A cloud community lets agents share and collectively evolve reusable skills.
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
Step-by-step audio production with per-stem verification, timing alignment, and incremental quality gates
End-to-end audio production workflow with stems, effects, archiving, and verification
| name | debug-sandbox-execution |
| description | Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs |
When execute_code_sandbox fails with unknown errors or incomplete output, use this debugging pattern to identify the root cause and recover incrementally.
The execute_code_sandbox tool may fail silently, truncate output, or produce opaque errors. Complex scripts with multiple file outputs are especially prone to partial failures.
Use a three-phase debugging approach:
When a sandbox execution fails, rerun the code using run_shell with output piping to capture whatever output is produced before the failure:
python your_script.py 2>&1 | head -100
This reveals:
Break the script into smaller, testable units. Execute each function or code block independently:
# Test individual components
if __name__ == "__main__":
# Step 1: Test imports
import numpy as np
print("Imports OK")
# Step 2: Test function A in isolation
result_a = function_a()
print(f"Function A: {result_a}")
# Step 3: Test function B
result_b = function_b(result_a)
print(f"Function B: {result_b}")
Run each section with execute_code_sandbox separately to identify which component fails.
Generate output files one at a time, verifying each before proceeding:
import numpy as np
import soundfile as sf
# Generate and save file 1
audio1 = np.random.randn(48000 * 10).astype(np.float32)
sf.write('output_01.wav', audio1, 48000, subtype='FLOAT')
# Verify file 1 exists and has expected properties
import os
assert os.path.exists('output_01.wav'), "File 1 not created"
# Generate and save file 2
audio2 = np.random.randn(48000 * 10).astype(np.float32)
sf.write('output_02.wav', audio2, 48000, subtype='FLOAT')
# Verify file 2
assert os.path.exists('output_02.wav'), "File 2 not created"
execute_code_sandboxrun_shell and | head -100 to see partial outputassert os.path.exists(path)execute_code_sandbox call that produces incomplete or no output