Tools of an agent
The model gets these tools. Each path is relative to the work folder. A file tool refuses each path outside the work folder, also through a symbolic link, and each path with a NUL byte.
The system prompt tells the model to work only through tool calls, to keep each input small, to call ask_coordinator for a decision, and to call finish at the end.
| Tool | Input | What it does |
|---|---|---|
read_file |
path, offset, limit |
Gives the lines of a text file, from the line offset (from 1), at most limit lines. A text longer than 60000 characters is cut. A file larger than 16 MiB is refused. |
write_file |
path, content |
Writes the full text of a file, and makes the folders of the path. A file that exists keeps its permissions. |
edit_file |
path, old, new |
Replaces the text old, which must occur exactly once. |
list_files |
path |
Lists the files below a folder, at most 400. A folder ends with /. It skips .git and does not follow a link to a folder. |
search |
pattern, path |
Gives FILE:LINE: TEXT for each line that matches the regular expression (Tcl syntax), at most 200. It skips files larger than 1 MB. |
run |
command |
Only with --run. Runs the command in the work folder at the isolation level, and gives the exit code and the output. |
check |
name |
Only with --check. Runs a check of the coordinator. |
finish |
report |
Ends the work. The state goes to done, and the report is the last entry. |
ask_coordinator |
question |
The state goes to asks until the coordinator answers with send. |
run
--run all gives a shell: sh -c COMMAND in the work folder. --run git,make gives only commands whose first word is git or make, run with no shell, so ;, |, and $( ) are plain text.
A command ends with the exit code 137 when:
- it has no output for the idle time (
--idle-timeout, 300 s by default); - it runs longer than
--exec-timeout(1800 s by default); - the coordinator calls
interruptorstop.
The kill reaches the command and each process of its process group. At the level process, TMPDIR is a writable folder of the state of the agent.
check
--check unit='zig build test' gives the tool check with the name unit. The check runs on the host, at the level none, in the work folder, with the idle and time limits of the agent. The agent gives only the name, so it cannot change the command. It can change the files that the command reads, such as a test or a Makefile.