Repository navigation
Allow a top-level shortlist for router models - #79076
Conversation
Keep top-level router selection and its main-agent candidates independent of the engine. Preserve legacy routing, defaults, and sub-agent policy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Shared-import routing blocks bypass schema validation, silently discarding unsupported keys and allowing invalid workflows to compile with the router model's cost level instead of failing.
1 open issue
What changed in this PR
Adds top-level model-routing.allowed-models to gh-aw workflows, letting authors narrow explicit router choices for the main agent without restricting sub-agents. This implements the first phase of separating model routing from engine configuration.
Changes:
- Carries local and imported shortlists into the existing routing configuration.
- Adds selector, conflict, and firewall compatibility checks, with compilation tests.
- Documents the new syntax while retaining nested routing support.
| File | Description |
|---|---|
pkg/workflow/model_routing.go |
Checks firewall support for separate router candidates. |
pkg/workflow/model_router_value.go |
Resolves shortlists and attaches them to router selections. |
pkg/workflow/model_router_value_test.go |
Tests equivalence, imports, and invalid configurations. |
pkg/workflow/compiler_orchestrator_engine.go |
Integrates shortlist resolution into engine setup. |
pkg/parser/schemas/main_workflow_schema.json |
Defines the top-level shortlist schema. |
pkg/parser/import_processor.go |
Exposes imported shortlists to the compiler. |
pkg/parser/import_extract_engine.go |
Extracts shortlists from imported frontmatter. |
pkg/parser/import_accumulator.go |
Preserves separate imported shortlist declarations. |
docs/src/content/docs/specs/model-alias-specification.md |
Specifies shortlist scope and selector requirements. |
docs/src/content/docs/reference/model-routing.md |
Explains shortlist syntax, examples, and constraints. |
docs/src/content/docs/reference/frontmatter.md |
Introduces the top-level shortlist option. |
docs/src/content/docs/reference/frontmatter-full.md |
Includes the new field in the full reference. |
.github/aw/syntax-engine.md |
Updates engine syntax guidance for top-level shortlists. |
Review effort: Balanced
|
@copilot /pr-finisher Please address the Balanced review finding on this draft. An import that substitutes The PR’s N–R test shard failed on a raw |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
This comment has been minimized.
This comment has been minimized.
|
✅ PR Specification Reviewer completed successfully!
|
There was a problem hiding this comment.
Reviewed the current diff and changed-line behavior. No actionable correctness, performance, or maintainability issues found. The specialist pass was unavailable due to tool permission rejection; this verdict is based on independent static analysis of the pre-fetched diff and relevant source files. Tests were not run per the static-review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
There was a problem hiding this comment.
Reviewed head f60d22d8cc95c2b4f829a04b2b6816bca40041a6 against the Model Alias Format Specification v1.4.0 and related routing references.
Blocking finding: the PR adds a normative requirement in docs/src/content/docs/specs/model-alias-specification.md §9.4 for top-level model-routing.allowed-models, but leaves the formal document at Version 1.4.0 and adds no Change Log entry. Please synchronize the specification metadata and change log (or keep this behavior only in the informative reference).
One inline comment was posted. No implementation or tests were changed by this review.
Generated by PR Specification Reviewer for #79076 · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (review-history)History |
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.
|
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design. The core change is sound: the shortlist is kept separate from the router value, conflicts are rejected rather than merged, the firewall-version gate fails closed, and imported blocks are schema-checked after substitution. I found no blocking bugs. Two non-blocking items are inline.
📋 Key Themes & Highlights
Key Themes
- Dead test branch: the
empty shortlistcase is caught by schema first, so the code branch it names is unreachable from workflow input. - Hint noise: the new root
model-routingkey adds a misleading "belongs under the root level" hint for mistyped nested keys.
Positive Highlights
- ✅ Shortlist conflicts across imports fail with an error instead of silently widening the list.
- ✅ Top-level and nested paths both reject a non-router
modeland a fixed model with a shortlist. - ✅ Diamond imports are deduplicated by the BFS visited set, so one shortlist cannot be counted twice.
- ✅ The AWF pin-catalog gate matches the existing
model_routing_test.goexpectation.
Uncertainty
- I did not confirm the pre-PR output of the mistyped-key hint, so comment 2 is an inference.
- Expression-valued shortlists were not compared end to end. The fixtures needed
sandbox.agent.imagesto compile.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| {"imported opt-out", "model: router\n" + block, "engine:\n id: copilot\n model-routing: false\n", "engine.model-routing: false"}, | ||
| {"two shortlists", "model: router\n" + block, block, "more than one top-level router shortlist"}, | ||
| {"goal in new block", "model: router\n" + block + " goal: cost\n", "", "goal"}, | ||
| {"empty shortlist", "model: router\nmodel-routing: {allowed-models: []}\n", "", "allowed-models"}, |
There was a problem hiding this comment.
[/tdd] The empty shortlist case does not reach the branch it names. The schema rejects allowed-models: [] first (minItems: got 0, want 1), so this case only checks the schema message. I found no path that reaches the router shortlist is empty in model_router_value.go: top-level [] fails schema, and imports go through the same check (import_extract_frontmatter.go L18-23). Either assert the schema error directly, or drop the unreachable branch.
@copilot please address this.
| "description": "Default LLM model, overridden by nested engine.model. Sets the default model used by the agentic engine for this workflow. Acts as a fallback when an engine instance does not specify its own 'model'; a nested 'engine.model' (e.g. safe-outputs.threat-detection.engine.model) takes precedence over this field for that engine instance. Supports full model IDs (e.g. 'claude-3-5-sonnet-20241022', 'gpt-5.4') and model aliases (e.g. 'small', 'large'). Router values ('router', 'router/economy', 'router/balanced', 'router/robust') choose model routing for the main agent instead of a fixed model.", | ||
| "examples": ["gpt-5.4", "claude-3-5-sonnet-20241022", "gpt-4"] | ||
| }, | ||
| "model-routing": { |
There was a problem hiding this comment.
[/codebase-design] A mistyped nested value gets a misleading hint. With engine.model-routing.allowed-models: [1], the compiler reports Unknown properties: id, model-routing and suggests 'model-routing' belongs under the root level. The new root model-routing property adds a second schema location for that name, and the hint generator in pkg/parser/schema_suggestions.go (around L800) lists every location. Consider a distinct root-level name, or excluding it from the hint index. I did not confirm the pre-PR output.
@copilot please address this.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Superseded by dac599c. The sole finding is fixed: the Model Alias Format Specification now has draft version 1.5.0 and a matching section 9.4 changelog entry. The inline thread is resolved, and all checks on the fixed revision have completed with no failures.

Fixes #78928. This is the first step of #78927.
ADR: ADR-79076: Allow a Top-Level Shortlist for Router Models
A workflow can now put
model-routing.allowed-modelsnext to an explicitmodel: routeror named router level. The list narrows the main agent’s candidates without restricting sub-agents. It compiles to the same effective firewall configuration as the equivalent nested engine block. Existing workflows, opt-outs, model overrides and routing tables are unchanged. No smoke workflow is migrated or legacy setting deprecated here.The compiler tests cover local and imported shortlists, conflicting or missing selectors, and old firewall versions that cannot enforce a main-agent-only list. Focused routing tests and the native Linux intermediate pre-push gate passed on the submitted tree, including formatting, building the compiler, parser/workflow compile and vet, and embedded schema freshness. The full pre-push gate and hosted CI will be checked while this PR is in draft.
Smoke workflow validation
At
f60d22d8cc95c2b4f829a04b2b6816bca40041a6, I compiledsmoke-copilot-sdk-routedlocally twice: first with the existing nested routing block, then withmodel: router/economyand top-levelmodel-routing.allowed-models. Both compiles succeeded without warnings and emitted identical firewall configuration. The main agent still has justgithub-copilot/gpt-5.6-lunaas a candidate, and the declaredhaiku-whoamisub-agent still usesclaude-haiku-4.5outside that shortlist. The lock changed only in frontmatter-derived hashes and the audit metadata recording the explicitrouter/economyselector. No workflow was dispatched or migrated in this PR.Draft CI finished with 65 passed, 14 skipped, and one failure. The PR job and main job both report
TestNoRawOctalPermissionLiteralsInOSCallson the same0o600inpkg/cli/update_pr_release.go, which this PR does not touch.