timeoutSeconds limit. The default is 30 seconds. The maximum is 600 seconds (10 minutes). For a longer job or a server that does not end, start the command detached, then poll for its result. Examples are builds, installs, data processing and dev servers.
A long job that you want to wait for needs no polling:
- CLI:
boat exec <id> --timeout 0 -- <command>runs it detached, prints its output live until it ends, and exits with its exit code. - SDK:
run_command(Python) andrunCommand(TypeScript) do the same and yield the output. - API: start the command with
detached: true, then attach to it.
nohup ... & pattern for simple cases. You do not keep an SSH session open. You do not write a unit file.
The flow is: start, then poll, then collect.
Start a command and read its status
- The command continues on the sandbox after the start call returns.
- boat appends stdout and stderr to
~/.ascii/processes/<pid>.logon the sandbox. The folder keeps an older internal name. - The status call gives
running, theexitCodewhen the command ends, and the last part of each log.
Read only new output
- Give
stdoutOffsetandstderrOffsetto the status call. Start at 0. - The answer holds only the output written after those byte offsets.
- The answer also holds
stdoutNextOffsetandstderrNextOffset. Use them in the next call. - When
moreistrue, call again immediately.
Attach to a background process
Attach opens one stream. The stream sends the output while the command writes it, until the command ends. Use attach instead of polling. The API allows 10,000 requests in 60 seconds per IP address. A stream counts once, when it opens, however long it stays open. Polling each of many processes every second reaches the limit. One open stream per process does not. Each line of the stream is one JSON object:
After a
reconnect line, open the stream again with those offsets. You get no gap and no repeat, for as long as the command runs. The CLI reconnects for you.
- A sandbox on an older agent answers
409 agent_outdateduntil its next agent upgrade. - To read output after the sandbox stops, use the command history.
Stop a background command
Stop the command by its process id. This also stops every process that the command started.- boat sends
SIGTERMto the whole process group. - After 5 seconds, boat sends
SIGKILLto the processes that remain. - The response holds the history record of the command, with status
killedand its last output.
When the agent restarts
The process runs under the systemd user manager of the sandbox user. Thus a restart of the agent of the sandbox does not interrupt it. A platform upgrade is an example of such a restart. The agent keeps a record of each process on disk. After a restart the status still shows the command, its directory and whether it runs:- A process that ends before the restart keeps its
exitCode. - A process that runs during the restart shows
exitedwithexitCodenullwhen it ends. - A process started by an agent older than the record shows
lost, andrunningis a best-effort check.
Timeouts and retries
Synchronous commands accepttimeoutSeconds from 1 to 600. The default is 30. boat refuses values outside that range with a 400 invalid_timeout error.
boat never retries a command call automatically. A command is not idempotent. After a timeout (retryable: false) or a network failure during the call, the command can already run on the sandbox. You decide what to do next.