BUILD / set-bash-tool-timeouts-in-grok-build

Build

Set bash tool timeouts in Grok Build

Set bash tool timeouts in Grok Build

Foreground bash commands from the agent have configurable timeouts and output caps. Official keys: Settings reference under [toolset.bash].

Defaults

Setting Default Meaning
timeout_secs 120 Foreground bash command timeout (seconds)
max_timeout_secs 36000 Cap on model-requested foreground timeouts
output_byte_limit 20000 Max captured bash output (bytes)
auto_background_on_timeout true Auto-background the command when it hits the timeout

Pin values in user config

[toolset.bash]
timeout_secs = 180
max_timeout_secs = 36000
output_byte_limit = 40000
auto_background_on_timeout = true

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

Long-running work

When a command should keep going past the foreground timeout:

  1. Leave auto_background_on_timeout = true so the client demotes it when the foreground timer fires.
  2. Or ask the agent to start it in the background, press Ctrl+B on a running foreground command, or manage it from /tasks / Ctrl+GRun background tasks and loops.

Raise timeout_secs for slow installs or builds you still want to finish in the foreground. Raise output_byte_limit when truncated logs hide the failure line.

Pitfalls

  • max_timeout_secs caps what the model can request; setting timeout_secs above that cap still respects the max.
  • Backgrounded commands are not sandbox escapes — filesystem and network limits still come from Enable the Grok Build sandbox.
  • Truncated output at output_byte_limit can look like a silent failure; bump the limit or read the on-disk log the agent wrote.