Skip to content

Epic: Model tag routing for spawn specialization #4

@grzegorznowak

Description

@grzegorznowak

Problem

pi-agenticoding spawn always inherits the parent model — there is no way to route a child agent to a specialized model. The operator has to remember and manually switch models before spawning, or accept that review/planning/quick-scan children all run on the same model.

Design approach

This is not automatic model routing (where an LLM decides which model is best for a given task). That pattern has known weaknesses — a router model lacks the domain context needed to make informed decisions, and by the time it has grounded in the codebase it might as well do the work itself.

Instead the proposal is operator-defined model groups that the operator explicitly selects when spawning. Each group bundles both a model (or set of models) and a thinking level, replacing the existing thinking parameter when a group is specified.

Key properties:

  • Operator-driven: the user picks the group (small-and-fast, big-and-slow, computer-vision, etc.) — no automatic task-to-model inference
  • Bundled thinking level: each group defines both model(s) and thinking effort; these replace spawns existing thinking` param when a group is active
  • Flexible cardinality: a group with one model is deterministic (always that model). A group with multiple models enables weighted selection or rotation
  • Meta-model proxy (stretch): registering each group as a logical model/provider (e.g. group/small-and-fast) would give the deepest integration — the group appears as a selectable model everywhere, not just spawn

What we want

User-defined model groups with a TUI settings panel for managing them (add, edit, delete, reorder). Spawn accepts a group (or modelTag) parameter. The plugin resolves the group to a concrete model + thinking level and the child runs with it. Sensible fallback when a group is missing or unresolvable.

Research

  • No existing Pi plugin provides arbitrary model grouping with a TUI (searched pi.dev, npm, GitHub)
  • Closest packages: pi-model-router (tier-based heuristic routing, ~250-550 downloads/mo, 0 stars), pi-prompt-template-model (frontmatter model switching, ~6.6K downloads/mo, 257 stars)
  • pi-agenticoding spawn currently only accepts { prompt, thinking? } — no model or group parameter
  • Existing /agenticoding-settings TUI pattern is a good reference for the group management panel

Epic plan

Full epic in: agent_coordination/epics/model-tag-router/MASTER.md (local coordination repo)

Three discrete story silos:

  1. Group data layer — JSON schema, persistence (global/project override), group resolution (single-model deterministic, multi-model weighted), thinking-level bundling
  2. TUI group management panel — Settings-list UI, add/edit/delete/reorder groups, model assignment, thinking-level per group, override warnings
  3. Spawn integrationgroup parameter on spawn, wiring to resolution from the data layer, system-prompt hints, command registration

Open for discussion

  • Should this live inside pi-agenticoding or as a standalone companion plugin?
  • Group resolution failures: silent fallback to ctx.model or visible warning?
  • Group naming: prefix convention (e.g. group/) to avoid collision with real model IDs?
  • Meta-model proxy: worth scoping into the initial epic, or a follow-up?
  • Should handoff also support model groups, or spawn-only initially?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions