A doom loop is a failure mode in which a coding agent, having settled on a plan, repeatedly makes small variations to the same broken approach rather than reconsidering it. LangChain, in Improving Deep Agents with harness engineering, attributes it to agents being myopic once they have decided on a plan, and reports seeing the same approach retried ten or more times in some of its traces.

Usage

LangChain uses the term in the context of Harness Engineering, and its response is a harness mechanism rather than a model change. LangChain’s countermeasure was a loop-detection middleware (see Agent Middleware) that counts edits per file through tool-call hooks and, after a set number of edits to the same file, adds context suggesting the agent reconsider its approach. The team reports that this can help an agent recover, but that the model may still continue down the same path if it believes it is correct. It presents the guardrail as a heuristic designed around today’s perceived model issues, likely to become unnecessary as models improve; its broader takeaway lists blind retries among the bad patterns a harness designer should detect and fix in the short term.