Do not classify every max-token finish.max-tokens is the observed finish reason; consecutive useless repetition is a separate content-shape diagnosis.

Contain the live cost first.

Separate four failure shapes.

Empty completion

EMPTY_RESPONSE is retryable by default.

Token ceiling

Valid output reached a cap; fix budgeting.

Repeated text

One unit loops inside one attempt; guard the stream.

Agent loop

Multiple steps or calls need loop containment.

Detection and recovery are separate decisions.

Scopetext only by default

Do not run a prose heuristic over tool-call JSON; evaluate reasoning separately.

Protocolone terminal failure

Emit one experimental stable classifier; nothing follows terminal finish.

Policyfinite opt-in

Alpha.1 normal mode allows five ordinary transient retries, but no built-in degeneration code.

Stopping display is not a billing receipt.

Cancellation crosses browser, Session, Agent, adapter, and provider boundaries. Report observed usage or uncertainty.

Primary evidence.

Evaluate the guard before making it policy.

The complete guide includes live containment, evidence fields, channel rules, threshold experiments, finite retry configuration, UI semantics, billing caveats, and acceptance gates.

Read the complete guide