$ fssg build --deterministic --validate |

Why a Headless Agent Needs a Final Summary, Not Just Tool Calls

IOSM

The first time I drove a coding agent from a chat surface instead of a terminal, I hit a problem I did not expect: the turn went quiet, and I could not tell whether it had finished.

In a terminal you can watch the tools fire, read the diff, and see the cursor come back. The silence at the end means something. In a headless surface — a Telegram bridge, a queued RPC call, a background run — silence is just silence. The tools ran. Did the task actually complete? What did the model decide? There is no cursor to watch.

I solved this in IOSM CLI with a rule that is embarrassingly small and surprisingly deep: a turn is not finished until it says, in text, what happened.


Completion is a contract, not a side effect

Most agent runtimes treat the final text as whatever the model happened to emit after its last tool call. If the model ends on a tool call, the run ends on a tool call. From the runtime's point of view, the turn is "complete" because the loop stopped.

That is the bug, and it is a design bug, not a model bug.

The Telegram bridge injects two constraints into every child run's system prompt:

Always finish each completed user task with a concise textual summary in the user's language (do not end with tool-only output).

If tools were used, include a short outcome summary (2–5 bullets) before ending the turn.

Read them closely. They do not ask the model to be more polite or more verbose. They redefine the terminal event of a turn. The summary is not decoration appended after the work; it is the delivery. Tool activity is the labor; the summary is the hand-off. A turn that skips the hand-off has not finished — it has only stopped.

This is the same instinct behind why a missing IOSM metric must block the score: a system that quietly substitutes "no data" for "zero" changes the meaning of the result. A turn that quietly substitutes "the loop stopped" for "the task completed" does the same thing, one layer up.


The honest fallback

A contract that only fails silently is not a contract. So the bridge also has to answer: what happens when the model violates it?

The answer is deliberately boring, and that is the point.

When a turn ends with no final assistant text, the bridge does not ask the model to "try again" and hope for a summary. It builds a fallback from the only things it knows for certain:

  • how many tool calls happened;
  • which tools were invoked;
  • how long the turn ran;
  • that the turn ended in tool-only output.

Then it hands the user a recovery instruction: "Summarize the previous result briefly without new tool calls."

That instruction matters more than it looks. It does not ask the model to re-run anything. It asks for a summary of work that already happened, bounded to zero new side effects. Recovery and execution are kept apart, exactly the way rollback and hypothesis termination stay separate in a cycle. You do not fix an incomplete delivery by triggering more work; you fix it by closing the loop on the work you already did.

The alternative — the one I refuse to ship — is fabricating a confident summary. "Done, looks good." A runtime that invents a delivery for a turn it could not observe is lying to the operator in the one place where the operator has no other source of truth. The fallback is honest precisely because it is thin: I know three tools ran and I have no summary. Here is exactly what I can still tell you, and here is how to recover.


Why telemetry matters when nothing was "said"

There is a subtler failure hiding under the tool-only finish, and the bridge records for it separately: per-turn tool call count and the set of tool names, logged whenever the final text is empty.

This is not noise. An empty output is a signal, not a void. A turn that ends with zero tool calls and no text is a different failure from one that ends with eleven tool calls and no text. The first suggests the model stalled before acting. The second suggests it acted, then failed to close. They need different fixes, but you cannot tell them apart unless the runtime preserves the difference even when there is no "result" to show.

This is the dual-checkpoint lesson in miniature: you do not wait for a good after-state before you record what actually happened. You record the execution state unconditionally, because that record is what lets you reason about a bad state later.


The generalization

I keep returning to this because it is not really about Telegram, and it is not really about summaries.

When execution moves off the visible terminal — into bridges, queues, background jobs, orchestrators — the definition of "done" has to move with it. In a watched session, the human is the completion signal: the cursor returns, the operator reads the result and moves on. In a headless session, that signal does not exist, so the runtime has to manufacture it as an explicit contract.

That is what I mean when I call IOSM CLI a runtime rather than a chat tool. A chat tool stops when the model stops. A runtime has an opinion about what "stopped" means, and it enforces that opinion as a constraint on every turn.

The rule is three lines long. But it is the difference between a system that ran and a system that delivered. And in a headless loop, delivered is the only thing that counts.

FACET AI CLI Terminal
facet@ai:~$