Your agent now runs tasks that take hours and hundreds of steps. How do you evaluate and observe it?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Stop treating a task as one pass/fail sample. At that length the end-to-end outcome is too rare, too expensive and too noisy to iterate on alone, so you need intermediate structure in both the eval and the traces.
Full worked answer with diagram
Stop treating a task as one pass/fail sample. At that length the end-to-end outcome is too rare, too expensive and too noisy to iterate on alone, so you need intermediate structure in both the eval and the traces.
Evaluation:
- Milestone grading. Decompose each task into checkpoints verifiable against environment state: failing test reproduced, fix compiles, migration applied, report drafted. Score progress as milestones reached and keep the final outcome as the headline. Long tasks then give you a gradient instead of a wall of zeros.
- Reliability against task length. Bucket tasks by how long a skilled human would take and plot success rate per bucket. Success falls with length, and the length at which the agent succeeds half the time summarises it better than one average. METR popularised this "time horizon" framing for frontier models; the same plot on your own tasks tells you which jobs are safe to delegate.
- Budgeted trials. A run can cost real money and hours, so k=10 on everything is unaffordable. Keep a small long-task suite on a nightly schedule with a few trials, and a larger mid-length set for fast iteration. Resume from checkpoints to test late stages without replaying early ones.
Observability:
- The trace is too big to read, so emit structured events above the span level: milestone reached, plan revised, context compacted, sub-agent spawned, budget threshold crossed. Those are what you query.
- Track context management explicitly. Many long-run failures are the agent losing a constraint after compaction, and no token or latency metric shows it.
- Detect stalls: steps without milestone progress, repeated near-identical tool calls, rising cost per milestone. Alert on them, and enforce hard caps on steps, wall-clock time and spend.
- Make runs resumable from checkpoints, so a failure at hour three can be debugged without paying for hours one and two again.
Worth sketching. Milestones and compaction events on one timeline show where a long run actually broke.
flowchart LR
T["Long task in a sandbox"] --> M1["Milestone 1:<br/>bug reproduced"]
M1 --> M2["Milestone 2:<br/>fix compiles"]
M2 --> CP["Context compacted"]
CP --> M3["Milestone 3:<br/>tests pass"]
M3 --> O["Final outcome grade"]
CP -.-> EV["Event logged:<br/>constraint still present?"]
M2 -.-> ST["Stall detector:<br/>steps without progress"]
What a good answer covers
- Stop treating a task as one pass/fail sample
- At that length the end-to-end outcome is too rare, too expensive and too noisy to iterate on alone, so…
- Milestone grading
- Reliability against task length
- Budgeted trials
Key terms: Milestone grading · Reliability against task length · Budgeted trials
In the glossary: Observability · Compaction · Tool call
Interviewer follow-ups to expect
How do you write milestones for a task with many valid paths without punishing the unconventional ones?
Your agent's success rate at four-hour tasks doubled after a model upgrade, but cost per success tripled. Is that a win?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep