Repository navigation
Expand aliases in engine.model-routing.allowed-models - #70942
Conversation
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved candidate-resolution and alias-traversal regressions can change model selection or prevent workflows from starting.
5 open issues
Keep exact Copilot IDs from expanding as aliases · New Preserve empty-key aliases during pattern expansion · New Intersect family constraints without duplicating family prefixes · New Support all case-insensitive Copilot provider aliases · New Normalize model pattern comparisons case-insensitively · New
What changed in this PR
Adds alias-aware routing shortlists to gh-aw’s workflow compiler and records the emitted candidate pool for auditing.
Changes:
- Expands routing aliases with provider, engine-family, and model-policy constraints.
- Carries authored and expanded candidates through run metadata and unified-session schemas.
- Adds regression coverage, updates documentation, and refreshes routed smoke lock files.
| File | Description |
|---|---|
pkg/workflow/model_routing.go |
Refactors alias traversal and routing validation. |
pkg/workflow/model_routing_subagents_test.go |
Updates expression-policy test inputs. |
pkg/workflow/model_routing_candidates.go |
Adds candidate expansion and policy intersection. |
pkg/workflow/model_routing_aliases_test.go |
Adds compilation and metadata regression coverage. |
pkg/workflow/awf_config_build.go |
Uses shared candidate resolution for AWF configuration. |
pkg/workflow/aw_info_model_config.go |
Records authored and emitted routing candidates. |
pkg/workflow/aw_info_model_config_test.go |
Checks expanded-candidate metadata. |
pkg/parser/schemas/main_workflow_schema.json |
Documents alias support in shortlist descriptions. |
docs/src/content/docs/specs/unified-agent-session-specification.md |
Adds effective candidates to the session contract. |
docs/src/content/docs/reference/model-routing.md |
Explains alias shortlists and policy interactions. |
docs/src/content/docs/reference/frontmatter-full.md |
Updates shortlist field comments. |
docs/public/schemas/unified-session.schema.json |
Allows effective candidates in routing metadata. |
actions/setup/js/types/unified_session.d.ts |
Types effective routing candidates. |
actions/setup/js/routing_analytics.test.cjs |
Updates routing metadata expectations. |
actions/setup/js/routing_analytics.cjs |
Sanitizes and projects effective candidates. |
.github/workflows/smoke-pi-routed.lock.yml |
Refreshes Pi routing metadata. |
.github/workflows/smoke-pi-routed-claude.lock.yml |
Refreshes Pi/Claude routing metadata. |
.github/workflows/smoke-copilot-sdk-routed.lock.yml |
Refreshes Copilot SDK routing metadata. |
.github/workflows/smoke-copilot-sdk-routed-claude.lock.yml |
Refreshes SDK/Claude routing metadata. |
.github/workflows/smoke-copilot-routed.lock.yml |
Refreshes Copilot routing metadata. |
.github/workflows/smoke-copilot-routed-steering.lock.yml |
Refreshes steering-workflow routing metadata. |
.github/workflows/smoke-copilot-routed-claude.lock.yml |
Refreshes Copilot/Claude routing metadata. |
.github/workflows/smoke-claude-routed.lock.yml |
Refreshes Claude routing metadata. |
Review effort: Max
|
Review findings (round 2): Round 2 for this PR (#70942, issue #70936). Review findings to address:
Keep the PR to this one fix. Before fixing a failing check, compare it with the same check on main; if it also fails on main, leave it and note it in the PR. Run |
…licy like AWF Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Round 2 is done in ba345dd (pushed by a parallel session while I was working) and 2944b8c.
|
|
Review findings: Round 4 for this PR (#70942). Two gaps from our verification of rounds 2 and 3:
Don't change anything else. Keep the PR to this one fix. Before fixing a failing check, compare it with the same check on main; if it also fails on main, leave it and note it in the PR. Regenerated-file drift from main is fine. Reply on the PR with what changed. |
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Round 4 is in dc1d9b6.
The full On checks: the local pre-push gate fails because |
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: dc1d9b6
|
… spec changes to 2.3.0 Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
…s-in-allowed-models Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Branch is up to date with
No review threads were open, so there was nothing to reply to or resolve. What's left is CI and human review. |
|
Verified at
|
|
🎉 This pull request is included in a new release. Release: |


engine.model-routing.allowed-models: [small, sonnet]compiled without error but was emitted asgithub-copilot/smallandgithub-copilot/sonnet. Those names match no live model, so AWF exited 78 withno_routebefore the agent started. This change expands gh-aw aliases at compile time, using the existing shared alias table andexpandModelPatterns, so a shortlist can survive model retirements.Candidate resolution (
pkg/workflow/model_routing_candidates.go, new)smalfails at compile time instead of at run time. Exact IDs are not checked against the live model catalogue.walkModelPatternshelper, which now backsexpandModelPatterns. Onlycopilot/patterns are kept, rewritten togithub-copilot/. This applies to Copilot, Claude, Codex and Pi, since all four routing engines use Copilot inference.*pattern is narrowed to the family prefix only when the alias's own direct entries include that engine's native provider (*sonnet*becomesclaude-*sonnet*). An alias left with no compatible patterns is an error, so Codex with[sonnet]fails and cites the Responses API.gpt-5,gpt-5.4,gpt-5.6,gpt-6) now expand, matching howengine.modelresolves them. No existing workflow uses them in a shortlist.Policy intersection with
models.allowed/models.blockedcandidateModels; candidates replaceallowedModels), partial overlaps are dropped somodels.allowedis never widened.excluded: small.modelRoutingAWFCandidates, now feeds bothBuildAWFConfigJSONand the run metadata, so the two cannot disagree.Metadata and audit
GH_AW_INFO_MODEL_CONFIGandaw_info.model_configkeeprouting.allowed_modelsas authored and gainrouting.candidate_models, the exact list emitted to AWF. It is omitted when any candidate is an expression.routing_analytics.cjskeeps the new field when sanitizing and projects it tomodel.configasrouting.candidateModels. The d.ts types and the regenerated session schema are updated, and the unified session spec is bumped to 2.2.0.candidate_modelsfield): smoke-claude-routed, smoke-copilot-routed, smoke-copilot-routed-claude, smoke-copilot-routed-steering, smoke-copilot-sdk-routed, smoke-copilot-sdk-routed-claude, smoke-pi-routed and smoke-pi-routed-claude.Docs
allowed-modelsdescription in the main workflow schema andfrontmatter-full.mdnow mentions aliases.Tests
pkg/workflow/model_routing_aliases_test.goadds the issue's named tests. They compile real workflows and read the AWF JSON from the lock file.RoutingModelConfigRecordsAuthoredAndExpandedCandidatesruns the compiledGH_AW_INFO_MODEL_CONFIGthroughparseCompiledModelConfigandprojectModelConfigin node, and checks the result against the emitted AWF candidates.routing_analytics.test.cjsare updated because they read the recompiled lock files.RoutingAliasesSandboxEndToEndis left for the sandbox owners to run on this branch.Known failures on main (not addressed)
embedlitinclaude_engine.go,codex_engine.goandcomment_memory.go.TestAgyProductionConformancePermissionsAreBoundedAndScoped,TestAgyConformanceEntryPointsShareConfiguration,TestDryRunCompiledCacheModeandTestEngineConformanceCatalogCoverage.