Skip to content

A cut answer is not an answer

When a provider stops a model at its output limit, the task now fails with its own code and keeps the partial text instead of passing it on.

An infer: task asks a model for an answer. Its max_tokens field caps how many tokens the model may produce. Tokens are the small pieces of text a model reads and writes, and the unit providers bill.

When the model reaches that cap, the provider stops it. The text simply ends, often mid-sentence, and the provider's reply says why it stopped. Before v0.123.0, in the words of its changelog, an infer: task in that case "used to return the truncated text as a success". The next task read half an answer as if it were a whole one.

Models that reason before they answer add a twist. In the spec's words, "On a route that reasons by default the cap also pays for the reasoning." The spec's diagnostics registry records the case behind the change, observed on 10 October 2026:

4,096 of 4,096 output tokens, 3,860 of them reasoning, the answer cut mid-sentence and returned as a success

The model spent most of its budget thinking. What was left was a fragment, and the run called it a result.

The rule #

The specification changed on 11 October and the engine followed on 12 October. The engine change then sat on main, unreleased, until v0.123.0 on 23 October, the date this post carries. The 0.123.0-preview.1 prerelease of 9 October does not contain it.

This is the new rule in the spec's verbs chapter:

Fail an answer cut at the output cap · when the provider reports that it stopped at max_tokens (Anthropic max_tokens · OpenAI-compatible length · Gemini MAX_TOKENS), the task fails with NIKA-INFER-005 (budget_error · not transient)

Four details make the failure useful rather than just loud.

  • The partial text is kept. In the spec's words, "the visible text received is preserved at error.details.partial_output and the stop reason at error.details.stop_reason." The text that arrived is not thrown away.
  • It is never validated against schema:. A cut JSON object would fail validation and blame its shape. The spec says checking it "would fail NIKA-INFER-002 and hide its cause". The cause is the cap, so the code names the cap.
  • It is not transient. A transient error is one worth retrying. The engine's design note for the verb (docs/crate-specs/nika-verb-infer.md) explains why this one is not: "a re-ask under the same cap would be cut again."
  • An empty answer keeps its own code. The spec says "an empty visible answer stays NIKA-INFER-004".

Agents too #

An agent: task runs a loop: the model answers, may call tools, reads their results and answers again. Two things change there.

An agent's final message cut the same way now fails with NIKA-AGENT-006. And when a message is cut while it carries tool calls, those calls are no longer executed. The 0.123.0 changelog gives the answer the agent receives for each of them:

« not run: your message was cut at the output limit; re-issue the call with complete arguments »

The loop then goes on under the task's own limits. A tool call whose arguments were cut off is exactly the kind of input you do not want acted on.

The same changelog entry covers a neighbouring case: "A turn the provider interrupted on its side is never acted on: the task fails NIKA-INFER-001, transient, naming the provider's own word."

What to do when it fires #

The spec's diagnostics registry carries the lesson for the new code:

a cut answer is not an answer: raise max_tokens (on a route that reasons by default the cap also pays for the reasoning), lower the reasoning where a control reaches the route, or recover the partial explicitly through on_error:.

A separate spec commit of 11 October, the day of the rule ("docs(authoring): name the room a reasoning model needs above small caps", b1924ea), gave the max_tokens row of the verbs table a concrete amount: a model that reasons before it answers "draws its reasoning from this budget: give it room (16,384), or a low run.reasoning.effort its route documents". That effort is the route-specific value described in The file says how it reaches its model. The same commit says that "Every cap of 4,096 or less in the examples, the templates and the README quickstart now carries a comment" naming that room. This is the task block of the first lesson, examples/01-hello.nika, shown as a fragment of the file:

01-hello.nika
tasks:
  greet:
    infer:
      prompt: "Say hello in French, in one short sentence."
      # The ceiling. On a priced model this is what turns the cost report from
      # UNBOUNDED into a hard worst-case number.
      #
      # A short greeting on the small non-reasoning seat does not need a
      # thinking budget. If you later choose a reasoning model, raise this
      # cap to cover its thinking as well as its visible answer.
      # a reasoning model needs 16384 here, or a documented run.reasoning.effort: low
      max_tokens: 128

The cap stays at 128: the lesson's own comments call its model a "small local model" and a "non-reasoning model", and the commit says "Each cap stays sized for its file's own offline seat". The comment is for the person who copies the task onto a model that reasons.

The third way out is on_error:, a task's recovery block. If a partial answer is acceptable for your job, the spec says it "is recovered explicitly through on_error:", from the text the error kept. Accepting a fragment becomes a line in the file, visible in review, instead of something the engine decided for you.

The conversational Session applies the same arithmetic before it proposes a file. In the words of the 0.123.0 changelog, a cap the person did not type "that cannot cover the reasoning plus the answer, or no cap at all, is now refused before the workflow is proposed", with the repairs that reach the model's route.

Why it matters #

A workflow is a chain. A task that succeeds with a broken value passes the damage downstream, where it is harder to see and costlier to trace. The old behaviour also made the run's status wrong: the record said success while the answer said otherwise.

Failing at the point of cause keeps the record honest. In the changelog's words, "The run record's details carry the text received (partial_output) and the provider's stop reason", under a code that names the cap. You decide whether that text is good enough, and the file says what you decided.

What it does not do #

  • It needs the provider's word. The spec's rule applies "when the provider reports that it stopped at max_tokens", and names the stop reasons it means for Anthropic, OpenAI-compatible routes and Gemini. The sources describe no other trigger.
  • It raises no cap and retries nothing. The task fails, and the code is not transient. Raising max_tokens, lowering the effort or recovering the partial is a change the author makes.
  • It changes the verdict, not the call. The provider reports the stop in its reply, so the call that produced the cut answer has already been made.
  • Some runs that passed now fail. A workflow that used to succeed with a truncated answer now stops at that task. That is the point, but expect it when upgrading.
  • An agent turn is a different case. The registry's lesson for NIKA-AGENT-006 says "an agent turn runs under the provider's own output cap", so it asks for a shorter final message or an explicit on_error: recovery.
  • It was unreleased until 23 October. The engine change sat on main from 12 October and reached installs with v0.123.0.

Read the v0.123.0 release, the verbs chapter of the spec, or continue with The cost line.