Yoav Goldberg read the leaked agent code: 'nested loops from hell' saved only by LLM flexibility
yoavgo · x · 2026-11-18
AI researcher Yoav Goldberg shared his firsthand read of the leaked code behind a popular agent product, and the verdict is harsh:
- Bad code: The main loop and LLM context construction are "practically impossible to follow" — "nested loops from hell," with exceptions thrown inside deeply nested loops and caught several levels up as a control-flow mechanism.
- Clear bugs found: Items appearing twice in context, getting dropped, or rendered inconsistently.
- It doesn't matter much: The LLM is flexible enough to compensate for all of it.
In follow-up discussion, a commenter noted the code isn't novel — open-source equivalents exist — and that while there's clever engineering underneath, "any experienced programmer would probably have done" the same. A useful data point on how rough engineering plus a strong model can still yield a working product.
Related event: Leaked Agent Code Shows Success Comes From Solid Engineering, Not Magic(3 posts)→
More from coding & agent
- Preambient launches autonomous investment bank: 4x faster deals at half the fees — alifcoder · 2026-11-18
- Stanford's CS329Z Agentic AI Course Is Free on YouTube, Covers DSPy — stanfordnlp · 2026-11-18
- Tier your agents: Opus for planning, Sonnet for features, Haiku for simple tasks — Zachly · 2026-11-18
- Microsoft launches AI Transparency Initiative with 40+ orgs; Perception security platform goes GA — satyanadella · 2026-11-18
- Microsoft launches Agent 365 Business Analytics, an 'ERP for AI' spend — satyanadella · 2026-11-18
- Microsoft Perception goes GA: red, blue, and green security agents at machine speed — satyanadella · 2026-11-18