Add explicit model routing for subagent dispatch#33
Open
WdBlink wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opc-harness model-routeresolution before subagent dispatchhaikufor economy work andsonnetfor standard workinherit/opuspremium routesMotivation
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, ornone, then to a host-native model ID. Unknown routes fail closed instead of silently inheriting the root model. Claude Code's documentedCLAUDE_CODE_SUBAGENT_MODELoverride is honored and surfaced in the result.Reference: https://code.claude.com/docs/en/sub-agents#choose-a-model
Public defaults and non-goals
haiku/sonnetaliases because OPC currently dispatches through Claude Code's Agent tool.agentRouting.models; no flow definition needs to change.Verification
node --test bin/lib/model-routing.test.mjs— 15 passedtest/passed (excluding the helper file)git diff --checknode --checkon the resolver and harness entrypointnpm pack --dry-run --jsonincludes the resolver, tests, and routing protocolCloses #32