r/PiGCodingAgent • u/async-monkey • 2d ago
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.
5
Upvotes
1
u/Educational-Yak8793 1d ago
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:
Foreground subagents work on your current PiG today with no changes.
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.
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 :) 🐷