BUILD / cancel-subagents-on-turn-cancel-in-grok-build

Build

Cancel subagents when you cancel a turn in Grok Build

Cancel subagents when you cancel a turn in Grok Build

cancel_subagents_on_turn_cancel controls what happens to running child sessions when you cancel the parent turn (Esc or Ctrl+C). Official: Settings reference. Subagent basics: Use Grok Build subagents.

Values

Value Behavior
ask (default when unset) Prompt before stopping child sessions
always_stop Stop child sessions as soon as the parent turn cancels

Set it in user config

[ui]
cancel_subagents_on_turn_cancel = "always_stop"

Put this in ~/.grok/config.toml or $GROK_HOME/config.toml. Project .grok/config.toml does not own [ui].

When to pick each

Use always_stop when Esc means "kill everything under this turn," including explore/plan/general-purpose children listed in /tasks or Ctrl+G. Leave ask when you often cancel the parent reply but want a child research session to keep finishing.

Canceling the parent turn advances the prompt queue; it does not flip combine_queued_prompts — that key is separate: Combine queued prompts.

Pitfalls

  • Expecting project .grok/config.toml to hold [ui] — use user config.
  • Confusing turn cancel with killing one background task from the tasks pane (x on the selected row) — that targets one task, not the cancel-subagents policy.