Skip to content

Add explicit model routing for subagent dispatch#33

Open
WdBlink wants to merge 1 commit into
iamtouchskyer:mainfrom
WdBlink:codex/model-aware-agent-routing
Open

Add explicit model routing for subagent dispatch#33
WdBlink wants to merge 1 commit into
iamtouchskyer:mainfrom
WdBlink:codex/model-aware-agent-routing

Conversation

@WdBlink

@WdBlink WdBlink commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • add deterministic opc-harness model-route resolution before subagent dispatch
  • preserve OPC's existing nodes, review counts, discussion rounds, and role topology
  • default Claude Code routes to haiku for economy work and sonnet for standard work
  • require explicit approval for inherit / opus premium routes
  • allow repository and user config to replace tier values with any host-native model IDs
  • wire the routing pre-flight into build, review, discussion, loop, and UX dispatch instructions

Motivation

Claude Code uses the parent model when a subagent model is omitted. In a multi-agent flow, that can silently fan a premium root model out across every implementation, test, observer, and review agent. The orchestration topology is valuable; the missing piece is an explicit, inspectable model-selection contract.

This change makes topology and model tier independent. A role or node resolves to economy, standard, premium, or none, then to a host-native model ID. Unknown routes fail closed instead of silently inheriting the root model. Claude Code's documented CLAUDE_CODE_SUBAGENT_MODEL override is honored and surfaced in the result.

Reference: https://code.claude.com/docs/en/sub-agents#choose-a-model

Public defaults and non-goals

  • The built-in defaults target Claude Code's native haiku / sonnet aliases because OPC currently dispatches through Claude Code's Agent tool.
  • Codex and other hosts can map the same tiers to their own model IDs through agentRouting.models; no flow definition needs to change.
  • This does not add MiniMax, a local proxy, or any third-party-model assumption.
  • This does not reduce OPC's evaluator count or bypass any quality gate.

Verification

  • node --test bin/lib/model-routing.test.mjs — 15 passed
  • related config and flow-core Node tests — 63 passed
  • all 125 shell test suites under test/ passed (excluding the helper file)
  • git diff --check
  • node --check on the resolver and harness entrypoint
  • npm pack --dry-run --json includes the resolver, tests, and routing protocol

Closes #32

@WdBlink WdBlink marked this pull request as ready for review July 13, 2026 08:25
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.

Add explicit model routing for subagent dispatch

1 participant