Skip to content

feat(pi): first-class pi package with harness scaffolding and fleet subagent dispatch - #173

Open
rafmacalaba wants to merge 2 commits into
masterfrom
feat/pi-harness-subagents
Open

feat(pi): first-class pi package with harness scaffolding and fleet subagent dispatch#173
rafmacalaba wants to merge 2 commits into
masterfrom
feat/pi-harness-subagents

Conversation

@rafmacalaba

Copy link
Copy Markdown
Owner

Summary

Completes armada as a first-class pi extension and enables the fleet subagent workflow inside pi.

  • pi extension (pi/extensions/armada.ts): new armada_dispatch LLM tool dispatches fleet roles (backend-dev, qa, adversary, ... or ship names galleon, corvette, ...) as isolated pi subprocesses — single {role, task} and parallel {tasks: [...]} modes (max 8, 4 concurrent) so the orchestrator can run independent phases concurrently. resources_discover contributes the 14 bundled skills + prompt templates (/voyage, /contract, /fleet, /armada-status) in armada-managed repos.
  • Pi harness scaffolding: new project.harnesses manifest field (opencode default, pi opt-in, validated + deduped, rendered into armada.yaml). When pi is enabled, scaffold emits .pi/agents/<ship-name>.md per role: pi frontmatter (name, description, model where mappable), filled prompt body, and an Edit boundaries section derived from the permission matrix (pi has no SDK permission globs, so armada's file-ownership rules ride in the prompt body).
  • Model mapping: openrouter/* IDs pin the subagent model; opencode-* IDs are opencode-only and are omitted so agents inherit the dispatching session's model.
  • Uninstall removes armada-owned .pi/agents/ files.
  • Docs: README pi integration section documents the dispatch tool and harness opt-in; TODO logs the Wave 2 item.

Verification

  • Full suite: 605/605 pass, incl. 8 new tests in tests/pi-harness.test.js (manifest validation, renderer, scaffold/uninstall wiring).
  • Extension loads under pi 0.84.3 (pi -e smoke run).
  • Live end-to-end: scaffolded a temp repo with harnesses: ["opencode", "pi"], dispatched docs (single) and docs + architect (parallel) via armada_dispatch from a real pi session — both returned verbatim replies; parallel reported 2/2 succeeded.

…ubagent dispatch

- pi extension: armada_dispatch tool (single + parallel fleet subagent
  dispatch via isolated pi subprocesses), resources_discover contributing
  bundled skills + prompt templates in armada-managed repos
- manifest: project.harnesses field (opencode default, pi opt-in),
  validated, rendered into armada.yaml
- scaffold: .pi/agents/<ship-name>.md per role when pi harness enabled;
  openrouter models pinned, opencode-* inherit dispatcher; edit boundaries
  appended to the prompt body (pi has no SDK permission globs)
- uninstall: removes .pi/agents armada-owned files
- tests: tests/pi-harness.test.js (8); suite 605/605 green
- docs: README pi integration section, TODO wave-2 log
- renderPiAgentFile maps every role to its catalog OpenRouter fallback
  (opencode-* IDs are unusable in pi); openrouterModelFor helper
- scaffold writes .pi/settings.json with defaultProvider=defaultModel
  for the orchestrator session; merges into existing settings
- uninstall removes the armada-owned model keys
- verified live: subprocess JSON events report the pinned openrouter
  model; end-to-end dispatch receipt at $0.0016/turn
- tests: 606/606 green
@rafmacalaba

Copy link
Copy Markdown
Owner Author

Follow-up (4b82856): fleet defaults to OpenRouter in the pi harness

Previously pi subagents silently inherited the dispatching session's model (opencode-* IDs are unusable in pi, so budget tiers were ignored). Now:

  • Every role maps to its catalog openrouter/* fallback in .pi/agents/<ship>.md frontmatter (galleon/xebec/frigate/bark → openrouter/deepseek/deepseek-v4-pro, commodore → openrouter/z-ai/glm-5.2, corvette → openrouter/xiaomi/mimo-v2.5, clipper/caravel → openrouter/minimax/minimax-m3).
  • Scaffold writes .pi/settings.json with defaultProvider: "openrouter" + orchestrator model so the Commodore session defaults to OpenRouter too; uninstall removes the armada-owned keys.

Evidence: subprocess JSON events report the pinned model (deepseek/deepseek-v4-pro via OpenRouter); end-to-end armada_dispatch receipt for backend-dev returned OPENROUTER_GALLEON_OK at $0.0016/turn. Suite: 606/606.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant