Repository navigation
Exclude non-agent models from automatic selection - #11749
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Model normalization drops supportedEndpoints, allowing WebSocket-only models with a supported reasoning effort to receive an HTTP Responses route despite being marked ineligible.
1 open issue
What changed in this PR
Adds provider-metadata eligibility checks to AWF’s API proxy so automatic selection avoids non-agent models while preserving explicit model choices.
Changes:
- Introduces shared eligibility checks across aliases, fallback, auto selection, routing, and recovery.
- Refreshes eligibility metadata during discovery and publishes the decision through
/reflect. - Adds regression coverage, documents the consumer contract, and packages the helper in the container.
| File | Description |
|---|---|
docs/awf-config-spec.md |
Specifies automatic-selection eligibility and explicit-choice exceptions. |
docs/api-proxy-sidecar.md |
Documents the new /reflect eligibility field. |
containers/api-proxy/server.model-recovery.test.js |
Adds utility-only and empty-endpoint recovery cases. |
containers/api-proxy/scoped-auto-model.js |
Applies shared eligibility to provider-scoped auto selection. |
containers/api-proxy/routing-candidates.js |
Adds an eligibility check to routing choices. |
containers/api-proxy/model-resolver.js |
Filters wildcard and family-replacement candidates. |
containers/api-proxy/model-recovery.js |
Applies shared eligibility to recovery candidates. |
containers/api-proxy/model-fallback.js |
Filters middle-power fallback using runtime metadata. |
containers/api-proxy/model-config.js |
Refreshes resolution metadata alongside model discovery. |
containers/api-proxy/model-body-rewriter.js |
Applies shared eligibility to Copilot Responses auto selection. |
containers/api-proxy/management.test.js |
Updates expected reflection metadata. |
containers/api-proxy/management.js |
Publishes per-model automatic-selection eligibility. |
containers/api-proxy/Dockerfile |
Includes the new helper in the sidecar image. |
containers/api-proxy/automatic-model-eligibility.test.js |
Covers eligibility, selection, reflection, and metadata refresh. |
containers/api-proxy/automatic-model-eligibility.js |
Defines the shared provider-metadata eligibility rule. |
Review effort: Max (adaptive)
|
|
||
| function getModelRoutingChoices(providerModel, provider) { | ||
| if (provider === 'copilot' && providerModel.modelPickerEnabled === false) return []; | ||
| if (!isAutomaticModelEligible(providerModel)) return []; |
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@copilot merge main and resolve conflicts then make sure all review feedback has been addressed |
…ds-fallback-checks # Conflicts: # containers/api-proxy/Dockerfile # containers/api-proxy/management.js # containers/api-proxy/model-body-rewriter.js # containers/api-proxy/model-recovery.js # containers/api-proxy/model-resolver.js # containers/api-proxy/scoped-auto-model.js # docs/api-proxy-sidecar.md # docs/awf-config-spec.md Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 657264e |
| expect(buildRoutingModelMetadata('openai', ['gpt-5.4', 'o3'], [])).toEqual([ | ||
| { | ||
| model_id: 'gpt-5.4', | ||
| automatic_selection_eligible: true, |
| }, | ||
| { | ||
| model_id: 'o3', | ||
| automatic_selection_eligible: true, |
| capabilities: { limits: { max_context_window_tokens: 900_000 } }, | ||
| }])).toEqual([{ | ||
| model_id: 'claude-opus-5-5', | ||
| automatic_selection_eligible: true, |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |

Wildcard aliases and fallback could select utility or evaluation models that cannot serve agent requests. Existing automatic-selection paths applied inconsistent eligibility checks.
routing_models[].automatic_selection_eligiblethrough/reflectfor harnesses resolvingautobefore calling AWF. Document the rule and field in the configuration spec and sidecar guide.