Skip to content

Pi subagent discovery broken - agents not registered #1507

Description

@benwilson

Problem

The Compound Engineering plugin's native Pi extension only exposes skills, not agents. The README claims "OpenCode, Pi, and oh-my-pi (omp) use native package/plugin loading from this repository" but this is only true for skills.

What's Broken

When you try to invoke CE agents via Pi subagents (e.g., compound-engineering:ce-work, compound-engineering:lfg), you get:

Error: Run 'main' failed: Unknown agent: compound-engineering:ce-work

Root Cause

The package.json has:

"pi": {
  "extensions": ["./.pi/extensions/compound-engineering.ts"],
  "skills": ["./skills"]
}

But it's missing the pi-subagents configuration:

"pi-subagents": {
  "agents": ["./.agents/agents"]
}

Pi's agent discovery (extractSubagentPathsFromPackageRoot()) reads package.json for:

  • pi-subagents.agents array
  • pi.subagents.agents array (fallback)

The CE plugin was missing both, so Pi can't discover agent definitions even though the ./.agents/agents/*.md files exist.

Impact

Users trying to use the LFG pipeline or individual CE agents via Pi subagents get Unknown agent errors. The native Pi extension only registers skills, not agents.

Fix

Add to package.json:

"pi-subagents": {
  "agents": ["./.agents/agents"]
}

Files Created

I've already created agent definition files in ./.agents/agents/*.md:

  • ce-work.md
  • ce-plan.md
  • ce-code-review.md
  • ce-commit.md
  • ce-commit-push-pr.md
  • ce-babysit-pr.md
  • lfg.md

Next Steps

The fix is ready. Would you like me to:

  • Submit a PR with these changes?
  • Keep it as a local patch?
  • Update the README to document this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions