r/PiGCodingAgent • • Oct 11 '26

Pig Subagents Setups?

What are some of the subagent patterns being used for development and Pig?

I've used https://github.com/nicobailon/pi-subagents in my pi workflow and it's been great - relatively issue free. I understand that I can use this extension with Pig, but I've noticed that background agents error out - and I'm wondering if people are still using the same subagent extensions, some are using the refactored pigpen subagents piglet (github.com/MichaelKinsy/pigpen/tree/main/components/subagents#readme)?

Just curious.

6 Upvotes

3 comments sorted by

1

u/async-monkey Oct 21 '26

Just a follow-up: 0.5.0 fixes the issue with subagents really well - now it's parity with pi when using the background subagents as an extension. Looking forward to speeding those up pigpen subagents too -

What a great project - thanks for all the hard work here!

1

u/Educational-Yak8793 Oct 12 '26

This was a real PiG bug actually, not your setup and not pi-subagents.

What was wrong was pi-subagents starts each background agent as a separate process. That process looks for Pi's packages (pi-agent-core, pi-ai, pi-tui, typebox), and PiG's extension runtime didn't provide them. Even past that, the background process had no way to stream model output back through PiG, so the run failed with "pig TS runtime not initialized". Foreground subagents were never affected, because they run inside the extension process.

PiG now bundles those Pi packages with its extension runtime and adds a small provider bridge, so a background process can stream through PiG with your normal auth and settings. I reproduced the failure and ensured the fix was verified on 0.5.0.

Fastest options until then:

  1. Foreground subagents work on your current PiG today with no changes.

  2. Build from source once the fix is on main. That gets it before the release:

git clone https://github.com/MichaelKinsy/PiG && cd PiG

make build

./bin/pig --version

make build also regenerates the bundled extension runtime, which this fix changes. A plain go build without go generate ./coding/extension/host/subprocess first would miss it.

3. Run background-heavy sessions in Pi for now if you need them today. Your pi-subagents setup carries straight over.

We'd skip patching packages into PiG's runtime folder yourself. It can get the process started, but the background agent would then call providers directly and bypass PiG's auth and settings.

Also I'll be updating the pigpen and go native options for subagents as well soon, sorry on the delay in response here as well been super busy :) 🐷

2

u/async-monkey Oct 12 '26

This is great - thank you for the reply! Excited for 0.5.0, I'll test it out in main.

Sincerely appreciate everything you're doing here - thank you!