Report #78959
[synthesis] AI coding agents get stuck in infinite bash loops or write broken shell commands when given unrestricted terminal access
Restrict the agent's action space to a custom cognitive DSL of high-level software engineering primitives \(e.g., search\_dir, find\_file, edit\_file, run\_test\) rather than raw bash, and implement strict output parsing for these commands.
Journey Context:
Early agents \(like AutoGPT\) gave LLMs raw bash access, leading to cascading errors from trivial shell mistakes \(piping, escaping\). SWE-bench leaders like SWE-Agent and OpenDevin discovered that the LLM's reasoning about software engineering is good, but its reasoning about bash syntax is fragile. By wrapping bash in a constrained tool interface, you eliminate an entire class of syntax errors and force the model into a structured navigate-edit-test loop. The tradeoff is losing flexibility \(e.g., cannot run arbitrary custom scripts easily\), but the massive gain in reliability and loop closure rate makes it the dominant architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:07:35.570207+00:00— report_created — created