CSE Roadmap

Core tier · about 5 hours · 5 parts

Part 1 of 5 · 1 min read

Overview

In this module you will

  • Put five guards around an agent loop: step limit, token (word) budget, time limit, repeat and no-progress detection, and cancellation.
  • Choose a limit from data, not by guessing.
  • Avoid guards that stop good runs (polling, long but healthy tasks).
  • Make a stopped run end well: a status, a partial answer and a trace.
  • Diagnose a runaway from its trace: loop, thrash, wander, retry storm, huge results, slow tool.

A normal program stops because its code ends. An agent stops because the model says so, and a model can fail to say so: it repeats a call, wanders through searches that find nothing, retries a broken tool, or keeps reading enormous pages. Each wasted step costs money and time, and in the worst case causes real effects (module 2's duplicate emails). Every production agent therefore needs stop conditions that do not depend on the model, in the loop code, and a defined way to end.

About the examples

Everything here is an offline imitation. The "agents" are small scripted programs on a virtual clock: each decides its next call from the step number. They are built to get stuck in nine specific ways, and the guards are tuned on those nine, so the results show which guard catches which failure, not how often real agents get stuck. Time is made up (2 seconds for the model, 1 for a tool) and "words" stand in for tokens. No real model or service was called.