Skip to content

Interview question · Agent Harnesses

A lead agent shipped a wrong answer built on a subagent's report that turned out to be cut off. What should the harness have done?

The subagent did tell the harness it stopped early. The bug is that nobody upstream looked at why it stopped.

mediumNewUpdated Nov 2026

TL;DR: Subagents must return an explicit stop reason with their result (completed, aborted, error, max-tokens, refusal), and the parent must treat anything other than completed as partial. The harness should surface the reason to the lead agent as part of the result, block a final answer that depends on a partial result, and offer a recovery: continue the subagent, retry with a narrower task, or tell the user what is missing. Log it, and add the trace to the evaluation set.

How to approach it

Find where the information was lost, then fix the contract between subagent and parent, the lead's handling, and the final check. Finish with prevention.

A strong answer

Where it was lost. The subagent hit its token limit mid-report. Its runtime recorded the stop reason, but the harness returned only the text to the lead agent, which read a fluent but incomplete report as finished.

Fix the contract. A subagent result is a structure, not a string: text, stop reason, budget used, and pointers to evidence (files read, sources). DeepSeek Harness, for example, defines stop reasons completed, aborted, error, max-tokens and refusal.

def accept(result):
    if result["stop"] == "completed":
        return "use", result["text"]
    if result["stop"] == "max-tokens":
        return "partial", f"Report cut off after {result['tokens']} tokens; continue or narrow the task."
    return "failed", f"Subagent stopped: {result['stop']}"

r = {"text": "Callers found: billing/refund.py, ...", "stop": "max-tokens", "tokens": 8000}
print(accept(r)[0])  # => partial

Fix the lead's handling. The harness shows the lead agent the status, not just the text, and its instructions say what to do with partial results. Better, the harness enforces it: a final answer whose cited inputs include a partial result is blocked until recovered.

Recovery options. Continue the subagent with its context, re-run with a narrower question, split the work across subagents, or answer with the gap stated.

Prevention. Size subagent budgets for their task; ask subagents for structured, bounded outputs (a list of findings with sources rather than an essay); add this trace to the evaluation set with a check that partial results never reach a final answer unflagged.

What interviewers probe next

"Why not just raise the token limit?" That moves the threshold; it does not stop the next truncation from being treated as complete.

"What about errors and refusals?" Same rule: anything but completed is surfaced, and the lead must decide, not ignore.

How it's scored

Weak: Raises the subagent's token limit.

Hire: Returns the stop reason and treats non-completed results as partial.

Strong Hire: Structured result contract with stop reason and evidence, enforcement in the harness rather than only in instructions, explicit recovery paths, bounded subagent outputs, and an evaluation case for the failure.

Common mistakes

  • Passing only text between agents.
  • Relying on the lead model to notice truncation.
  • No test that would catch the regression.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.