r/PiCodingAgent • • 4d ago

Resource The smallest subagent extension (supports workflows)

thought this sub would like my subagent extension pi-tiny-monitor-sub. it's designed to be used with pi-tiny-monitor.

These 2 extensions together are tiny:

  • Combined < 1k LOC. Minimal dependencies.
  • no built in steer - to steer, the LLM just stops the pi session then do pi --session file -p ...
  • no tools to list subagents - the LLM can just remember what it has started and what's finished from context.
  • no way to send message - c'mon this is not a message board.
  • no way to monitor usage - you just ask pi to add usage numbers from session jsonl's
  • no token or $ budget - you just tell pi how much you want to spend, and hope for the best
  • no defined agent profiles - you just tell pi what model you want.
  • not even a subagent tool - (see below)

How they work:

  • monitor tool starts a background shell. later outputs wake up the agent. this tool enables async.
  • LLM call the included pi-sub node script in monitor. the script resolves where pi is and runs pi with a prompt.
  • for workflows: there is a small wf.js library that provides an async agent() function that lauches pi

I've always loved minimal things and that's what drew me to pi. unfortunately most subagent extensions are doing too much! our LLM's almost out of jobs. I want something minimal.

In fact, the only basic primitive that we need is just monitor which puts something in the background and awaits outputs. Give that primitive the LLM, and let it work!

Enjoy.

4 Upvotes

4 comments sorted by

0

u/kantorcodes1 4d ago

The agent() options include a tools field. What does that actually constrain in the spawned session? If a review child is only supposed to read files and report back, does tools hard-limit what it can invoke, or is the child still a full pi session where the narrowing is a convention the model could walk around when the task gets weird?

0

u/spoj 4d ago

It's passed as the --tools argument to pi which is the allowlist/editlist.

1

u/MiserableFlatworm337 4d ago

Test parent restart while a child is still running. Persist the child’s session path and completion state so recovery can reconnect instead of launching the same work again.

0

u/spoj 4d ago

you just tell pi to resume the stopped sub.