pi-multiagents-v2

extensionmaintained

Codex Multi-Agent V2-style hierarchical subagents for Pi

by — · v0.1.2 · published 3w ago

$ pi install npm:pi-multiagents-v2
downloads/mo
248
stars
1
last push
3w ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

496 downloads · last 12 weeks (weekly)

README

pi-multiagents-v2

A Pi extension implementing the core behavior of Codex Multi-Agent V2 with in-process AgentSession instances.

No markdown-backed agents are needed or configured by default.

Features

  • Hierarchical task paths (/root/research/api)
  • Recursive subagent spawning
  • Independent context windows with fork_turns: "none" | "all" | "N"
  • Shared working directory and filesystem
  • Asynchronous agent mailboxes and automatic final-answer delivery
  • Persistent child context for follow-up tasks
  • Configurable child-run concurrency (PI_MULTIAGENTS_MAX_CONCURRENCY, default 8)
  • Inherited model, reasoning level, active tools, extensions, skills, and context files

Tools

  • spawn_agent
  • send_message
  • followup_task
  • wait_agent
  • list_agents
  • interrupt_agent

Install

pi install npm:pi-multiagents-v2
# or install directly from GitHub
pi install git:github.com/YoungseokCh/pi-multiagents-v2

Or test without installing:

pi -e git:github.com/YoungseokCh/pi-multiagents-v2

Notes

Agents share a filesystem, so delegated coding tasks should use disjoint write scopes.

This is a behavioral port inspired by OpenAI Codex Multi-Agent V2, with these differences:

  • Uses Pi AgentSession instances instead of Codex's Rust ThreadManager
  • Copies messages for context forks instead of forking native Codex rollouts
  • Does not restore the agent tree after reload, session replacement, or process restart
  • Approximates Codex's scheduling, prompts, schemas, and edge-case behavior

Changelog

v0.1.2

  • Persist named child sessions under persisted parents, linked through parentSession for native /resume and /tree inspection.
  • Keep child sessions in-memory when the parent session is ephemeral.
  • Hide inter-agent mailbox envelopes from the root transcript while retaining them in model context.
  • Await final-answer delivery before releasing a child run.
  • Match Codex's TUI behavior by hiding list_agents and rendering wait_agent as waiting/finished lifecycle status.

Child-session navigation is intended after the team finishes because switching sessions shuts down an active team.

References