Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 4.94 KB

helpers.md

File metadata and controls

9 lines (5 loc) · 4.94 KB

Its own helpers

Longer work does not keep it from talking. With its task tool the bot starts children: agents that work in the background with read, write, edit, bash, grep, find, screen, codemode and task, without the channel actions, on a brief it writes for them. It answers the person first, hands the work to a child, and stays free for the next message. A child starts from an empty conversation and its brief, so the bot's own context stays small; it sees the bot's memory index as it was when it started. When a child ends, its final message is kept, also across crashes and restarts, and wakes no one: the bot reads it with the task tool when it wants, and looks in on longer work with its own timed wakes. A child that cannot go on, such as when its model stops waiting (When the model cannot answer), wakes the bot once, also across restarts, with why and what it did last. A child wakes the bot itself with pots wake: when the bot hands it work, the brief says to wake the bot with pots wake when it is done; a child whose work someone waits for wakes it when done, and one that nobody waits for ends quietly. A child can also wake the bot with a question for a person. The bot checks what a child reports, passes on what matters, and sends the child the answer. While a child works for a place, new messages there go to the bot, so it can pass them on. A child takes the bot's messages only between its steps, so a message sent while it is in a long command waits until the command ends. Wherever the bot sees a child that works (its timed wakes, the wakes from the child's place, the task tool's list and the answer to a message it sends), it sees what the child does now: the tool call it is in and for how long, the start of the command, its last line of output and how old that is, and how many of the bot's messages wait for it. When a command hangs, the bot can interrupt the child's current tool calls: the child goes on with its work so far, sees that they were aborted, and takes the messages that waited. A stopped child does nothing more, also when the process dies in the middle of the stop.

A child can start children of its own with the same task tool, also from a codemode script, to the depth it needs; all of them share one cap. A grandchild works for its parent's place, with its parent's model unless the parent chooses another, and its brief says which child it came from. Its result goes to the child that started it, which reads it with task's result, or with wait: wait holds until all the children it names have ended, or any one of them, or until a time limit, then gives how each ended, with its final message then, also when Pots restarts in the meantime, and holds no process while it waits. A grandchild's failure goes to its parent too, as a message, while the parent works; once the parent no longer works, it wakes the bot as a child's failure does. The bot sees the whole tree, in task's list and in pots children, and can stop any of them; a stop also stops what that child started. A child manages only the children it started, also with pots children in its commands. The bot can wait too, but cannot answer anyone while it waits, so a batch of work to wait for goes to a child that starts and waits for the others.

The bot chooses each child's model and thinking level when it starts it: any model signed in on this computer, and any of pi's levels. A child it starts without a choice has the bot's model, also after a change in bot.json, and thinking xhigh. A child keeps the model chosen for it and its level for its whole life, also across restarts; a level the model does not have becomes the nearest one it has, as in pi. A model that is unknown or not signed in is refused before the child starts, with the reason, so the bot can take another or ask you to run pots login. By default the bot talks at the thinking of bot.json (medium), and its children do the work at xhigh or max. Every request carries Pots' notes on the models signed in on the computer, from their makers, independent tests and their work in Pots, updated with each release: what each does well, where it stands next to the other makers' models, and which subscription or price it comes with. So the bot chooses a model by the work and by the makers you are signed in to. What you say about which model, or which coding agent's command line, does which work comes first: the bot asks at its first start and keeps your answer in its AGENTS.md. settings.maxChildren (50 by default) caps how many work at once, counting the children that children started. pots children lists them, and pots children --stop <id> or --stop-all stops them.

It works like a pi session: it reads AGENTS.md and uses Agent Skills from the same places pi does, so the skills you give pi, the bot can use too. Screenshots and photos are shrunk to fit the model, as in pi.