# Pi Pocket's subagent implementation

By Saurabh Kumar · TIL note, Oct 9, 2026 · Tags: pi-agent

Source: https://saurabh-kumar.com/til/1791547202/

[Pi Pocket's subagent implementation](https://github.com/TannerMidd/pi-pocket/blob/3e6046612db4358b599da302d5c96bd407d9de5c/src/server/extensions/subagents.ts) gives each worker a retained conversation and uses durable tasks to deliver messages and report answers. Request IDs and recorded answer IDs prevent duplicate delivery and reporting after restart. The idea worth stealing: make the handoff durable, not just the worker.
