mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-05-06 16:26:16 +08:00
Fix unhandled OSError in subprocess and unsafe dict access in subagent (#159)
- agents/s01_agent_loop.py: Add FileNotFoundError/OSError handling in run_bash() - agents/s04_subagent.py: Same fix + use .get() for block.input['prompt'] (consistent with .get() already used for 'description' on line 157) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,8 @@ def run_bash(command: str) -> str:
|
||||
return out[:50000] if out else "(no output)"
|
||||
except subprocess.TimeoutExpired:
|
||||
return "Error: Timeout (120s)"
|
||||
except (FileNotFoundError, OSError) as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
|
||||
# -- The core pattern: a while loop that calls tools until the model stops --
|
||||
|
||||
Reference in New Issue
Block a user