Skip to content

Add explicit model routing for subagent dispatch #32

Description

@WdBlink

Problem

OPC deliberately fans work out across multiple independent agents, but its dispatch prompts currently call the built-in general-purpose agent without choosing a model. Claude Code defaults an omitted subagent model to inherit, so running OPC from a premium main session can multiply premium-model usage across every discussion, build, review, test-design, and UX observer.

This is separate from OPC's flow topology: the multi-node and multi-role quality design should remain intact. The missing piece is an explicit model-routing policy between role selection and agent dispatch.

Proposed direction

  • Add layered agentRouting config under the existing ~/.opc/config.json / repo .opc/config.json mechanism.
  • Resolve a model for every dispatched node/role with a deterministic opc-harness model-route command.
  • Use host-native model identifiers. For Claude Code, sensible defaults can route economy work to haiku, standard implementation/review to sonnet, and reserve inherit/opus for explicit premium approval.
  • Allow users and future host adapters (including Codex) to replace tier model IDs without changing OPC's DAG or role definitions.
  • Detect CLAUDE_CODE_SUBAGENT_MODEL, since it has higher precedence than per-invocation routing.
  • Fail closed when no model can be resolved; never silently treat an unknown/inherited child as a cheap model.
  • Show the selected tier/model in OPC's dispatch preview and completion accounting.

Non-goals

  • Reducing OPC's node count, review-role count, discussion rounds, or UX observers.
  • Making MiniMax, a local proxy, or any third-party provider the public default.
  • Changing the root model selected by the user.

I can submit a focused PR with the resolver, tests, protocol documentation, and prompt updates if this direction looks reasonable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions