Five ways an agent run can end: success, giving up, budget, human handoff, failure
ClickOk5811 · reddit · 2026-11-05
A framework-agnostic agent engineering methodology: most designs polish the happy path, but every run ends, and you should explicitly design for five endings.
- Success: task done and verified by the system (result exists, test passed), not just claimed done; log the result plus evidence.
- Giving up on purpose: give the model a legitimate "I can't, because " output for missing info, impossible requests, or absent tools — otherwise it will fabricate.
- Budget exhausted: set step/time/token/cost limits ahead of time and decide what happens at the limit (stop and report, hand off a summary, or escalate); watch for same-tool-same-args loops.
- Blocked, needs a human: pause with state saved, show the reviewer the effect not just the explanation, and define timeouts and escalation.
- Failure: distinguish retryable from permanent errors, cap retries, and keep partial side effects safe to repeat or undo.
Practices that tie it together: every run lands in exactly one recorded state; track the frequency of each ending — a rising share of "budget exhausted" or "gave up" signals problems with your agent or tools; user-facing messaging at each ending matters as much as the logic. Caveats: categories overlap, and limits depend on task and cost of mistakes.
More from coding & agent
- Cutting LLM-as-judge eval costs ~70% with prompt caching and a decision-model cascade — Longjumping-Piano550 · 2026-11-05
- particle-1 tested on real agent work: near-Opus quality for under $2 a day — heyneighbor · 2026-11-05
- Aether runs Claude Code and Codex on your existing AI subscription, charging only for the cloud machine — Scobleizer · 2026-11-05
- Claude Code desktop adds /storage to view and clear local disk usage — lydiahallie · 2026-11-05
- AI code is unmaintainable? Human code wasn't a masterpiece for 30 years either — feregri_no · 2026-11-05
- SpaceX principal engineer: grok bot merged PRs surged 809→10,926/month with 30x code shipped — elonmusk · 2026-11-05