Skip to content

kew dispatch

Dispatch a single issue.

Usage

kew dispatch <issue>                      # single-shot dispatch (same as `kew run --issue <n>`)
kew dispatch <issue> --loop               # supervise the runner as a first-class loop
kew dispatch <issue> --loop --max-steps N  # loop with explicit step cap

--loop (first-class loops)

With --loop, kew creates a Loop: a goal it pursues to a terminal state, recording each agent step as an iteration and verifying the result against a gate before declaring success.

  • Routed like ordinary dispatch: the loop's runner and model are resolved through the [routing] table using the issue's complexity label, exactly as a single-shot dispatch would — so a simple-labelled issue runs its loop on the simple tier's runner/model, not the [agent] default. The route is resolved from the effective config — kew.toml plus any config_overrides raised in the web UI, so a runtime agent.model / routing.* override governs the loop exactly as it governs every other dispatch kind. The resolved runner, model and complexity tier are all recorded on the loop, so kew loop resume continues on that same route instead of re-resolving the default.
  • Native runners only (v1): all supported runners (Claude Code, OpenCode, pi) declare loop_style = "native" and drive the loop themselves. If a [routing] entry ever resolves to a runner that is not native-loop-capable, --loop fails closed with that reason — it never silently degrades to a single-shot dispatch.
  • Guardrails come from config and are load-bearing: agent.timeout_minutes bounds the wall clock (threaded into the run timeout), and the loop is stamped needs_human if recorded steps exceed max_steps (scaled by issue complexity: simple=80, medium=200, complex=400). agent.max_budget_usd is passed to the runner as a best-effort dollar cap. The loop refuses to start if the resolved model is not in the pricing table (no silent $0 / unbounded run) and if no verify command (commands.verify_loop, falling back to commands.ci) is configured.
  • The loop and its iteration timeline are queryable in the run store; the read-only Loop card (Flight Recorder) renders status, the step timeline, the verification result, and the audit trail.

Not to be confused with kew run --loop. kew run --loop runs continuous dispatch — it keeps picking the next ready issue until the queue is empty. kew dispatch <issue> --loop runs one first-class, verified loop pursuing a single goal. Different flag, different command, different meaning.