]> git.giacomolli.uk - onechat/commitdiff
Run the tools of an agent and log each call
authorAnderson A. Giacomolli <redacted>
Fri, 6 Nov 2026 22:12:48 +0000 (19:12 -0300)
committerAnderson A. Giacomolli <redacted>
Fri, 6 Nov 2026 22:12:48 +0000 (19:12 -0300)
The agent gets four more tools after zoom and date: shell, read, write,
and edit. Turns and compactions send all six, so they keep one cached
prefix. shell runs a command with bash as the user in the working
directory of the agent, with no input and no sandbox, in its own process
group, so an interrupt kills the command and its children. read, write,
and edit take a path relative to the working directory or an absolute
one, and edit replaces a text that occurs exactly once.

Each call goes to the log as a tool message, the log is flushed, and
only then does the tool run, so the log never misses an action outside
the agent. The result goes to the log as an echo message. An interrupt
before the flush logs that the tool did not run. A tool error is the
output, so the model sees it.

Each output keeps its first and last 15,000 characters, 30,000 in all,
with a mark of the cut bytes between them. shell and read keep only the
ends while they read, so a long output does not fill the memory.

Issue: 5daf23e


No differences found