The boundaryThe verified Agent loop has no documented aggregate max-steps or per-turn spending limit. Keep an independent provider-side quota.

Thirty seconds to containment.

  1. Cancel the active turn.Press Esc or Ctrl+C in the running TUI. Send Ctrl+C to a foreground CLI process.
  2. Watch the real meter.Confirm the process and provider usage stop. A frozen screen is not proof.
  3. Copy the trace.Preserve Session events, terminal output, timestamps, and sanitized provider usage.
  4. Do not resume unchanged.Fix the reachable failure or narrow tools, task, and budget before a fresh Session.

Know what each control bounds.

maxParallelToolCallsOne-step concurrency

Not total steps, calls, tokens, or spend.

maxTokensOne response output

Not accumulated input across repeated steps.

compactionContext pressure

Not the number of model requests.

provider quotaExternal consumption

The independent hard cost boundary.

Route the repetition.

Successful tools repeatNarrow completion.

Reduce the reachable tool surface and require a concrete done condition.

The same tool failsFix the capability.

Remove or repair the error source before another turn can reach it.

Provider errors retryInspect retry policy.

Separate transport retries from successful Agent steps.

Work outlives the UIFind the owner.

Stop child processes, schedules, and detached work explicitly.

Bring an event timeline.

Version + source commit:
Profile + model route:
Turn start / cancel / last charge:
Repeated assistant and tool events:
Sanitized tool result or error:
Request usage + provider curve:
Smallest bounded reproduction:

Recover with a smaller blast radius.

New Sessiondisposable workspace
Few toolsread-only first
Small quotaprovider enforced
One tracecancel on repetition

Primary evidence.

Keep the complete runbook.

The canonical guide adds failure branches, a diagnostic bundle, recovery rehearsal, and third-party budget-plugin caveats.

Read and star on GitHub