Docs/Tools

Background jobs

Start test suites, builds and servers without blocking the turn, then poll, read or cancel them through the same bash tool.

Source: crates/gray-tools/src/shell

The bash tool can start a command without waiting for it, or let a short command finish and only hand back a job id if it is still running.

bash arguments
{"command": "cargo test", "background": true, "timeout": 600}
{"command": "cargo test", "yield_ms": 1000, "timeout": 600}
actionWhat it does
listevery job in this session
statusstate of one job_id — returns immediately
outputcaptured output of one job_id — returns immediately
cancelkill the job's process tree
  • —Up to 32 jobs run concurrently per tool instance, with a bounded history of 128.
  • —Completion notices reach the model between rounds. If the turn already ended, they arrive with your next message — a job never holds a turn open or triggers an unprompted model call.
  • —Jobs are session-scoped: quitting Gray stops them, and they are not restored after a restart. Their logs remain.
  • —Without background or yield_ms, bash blocks as usual.

Join the Discord

Chat with the people building and running Gray. Show what you made with it.

Join Discord →

Need help?

Open an issue on GitHub, run /feedback from the REPL, or ask in Discord.

Open an issue →