AI Agent Frameworks / Scenario
The AgentExecutor That Never Stops
A LangChain agent burns 14 iterations, crashes on parse errors, and its 'answer' is the iteration-limit sentinel. The tests saw none of it.
- Difficulty
- Hard
- Format
- Scenario
- Points
- 200
- Estimate
- 15 min
// MISSION BRIEF
Your Mission
A support agent built with create_tool_calling_agent + AgentExecutor is misbehaving in production: some conversations crash, others grind through the iteration limit and reply with a canned stop message that users see verbatim.
The test suite is green, it only asserts one happy-path answer. Read the setup, the trace, and the test, then dissect the failure modes.
// FIRST CONTACT
Battle teaser
First artifact
agent.py
Why do some conversations crash outright?
- Ahandle_parsing_errors is False (the default), so when the model emits output the agent cannot parse, the executor raises instead of feeding the error back for recovery
- BThe LLM is rate-limited
- CAgentExecutor cannot run more than one conversation
- DPython cannot catch this class of exception
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
langchainagentexecutortool-callingdebuggingai-agents