Skip to content
pi-c Tools
Login

Tools

A reply can call the tools a request offers (--tools, setting defaultTools; see the command line reference). How each call is journaled is in durability. Beside Pi's tools, send_message lets a conversation message another (peers).

Parallel tool calls

The tool calls of one reply run at the same time, as in Pi (its toolExecution "parallel", the default). Each call's PreToolUse hooks run first, one call after another in call order; then the calls run together, each in a process forked from pic, and each is journaled as a lone call is: intent, started, result, every step its own short transaction. Results commit as calls finish, but reach the transcript (and the model) in call order. tool_execution_start comes for every call before any runs; tool_execution_update and tool_execution_end come as each call goes. A crash mid-batch is recovered per call: a started command becomes unknown and is never run again, a started read, write or edit runs again, and a finished call keeps its one result. Esc, Ctrl-C and the RPC abort abort every running call. Calls on the same file wait for each other in call order when either changes it (Pi queues only edits and writes to one file; pic also keeps a read of that file in its place). pic settings toolExecution sequential (or Tool execution in /settings) runs the calls one by one instead.

A file another conversation changed

When several pics work in one project, two conversations can change the same file. pic does not merge. It knows from the journal which conversation edited or wrote which file, and tells the agent when it meets another's change: one made while this pic was running the request, after this conversation last read, edited or wrote the file.

Changes made by commands (bash) are not tracked, nor are changes made while this conversation was idle. With one pic at a time none of this happens, forks included, and the tools behave as Pi's.