Fix model-policy config propagation to api-proxy and prevent exact-model family rewrites#6299
Conversation
There was a problem hiding this comment.
Pull request overview
Propagates API-proxy model policies through configuration assembly and adjusts model resolution precedence.
Changes:
- Preserves allowed/disallowed model lists through
WrapperConfig. - Prioritizes exact advertised models over GPT-5 family fallback.
- Adds regression tests for mapping, validation, building, and resolution.
Show a summary per file
| File | Description |
|---|---|
src/config-file-mapping.test.ts |
Tests policy-field mapping. |
src/commands/validators/log-and-limits.ts |
Passes policy fields through validation. |
src/commands/validators/log-and-limits.test.ts |
Tests validator propagation. |
src/commands/validators/config-assembly.ts |
Forwards policies into config construction. |
src/commands/validators/config-assembly.test-utils.ts |
Updates assembly fixtures. |
src/commands/build-config.ts |
Adds policies to WrapperConfig. |
src/commands/build-config.test.ts |
Tests config output. |
containers/api-proxy/model-resolver.js |
Adds exact-match precedence. |
containers/api-proxy/model-resolver.test.js |
Tests exact-match behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Medium
| const direct = providerModels.find(m => m.toLowerCase() === key); | ||
| if (direct && _isModelPermittedByPolicy(direct, modelPolicyConfig)) { | ||
| log.push(`[model-resolver] direct match: "${requestedModel}" → "${direct}"`); | ||
| return { | ||
| resolvedModel: direct, | ||
| log, | ||
| fallback: fallbackConfig.enabled | ||
| ? { activated: false, selection_method: 'middle_power_median', reason: 'direct_match' } | ||
| : undefined, | ||
| }; | ||
| } |
| allowedModels: logAndLimits.allowedModels, | ||
| disallowedModels: logAndLimits.disallowedModels, |
|
@copilot address review feedback |
- model-resolver.js: when an advertised model is policy-blocked, return null instead of falling through to GPT-5 family alias - Add regression test for exact-but-denied model behavior - Add assembly handoff test for allowedModels/disallowedModels
Both review issues addressed in the latest commit: model-resolver.js (lines 288-298): The direct-match block now checks policy first and returns config-assembly.ts (lines 54-55): Added a |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Contribution Check completed successfully! |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
🔌 Smoke Services — All services reachable! ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Claude passed |
|
✅ Build Test Suite completed successfully! |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
❌ Security Guard failed. Please review the logs for details. |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed... |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
Thanks for the clear description and regression coverage. One contribution-guideline item is still missing: please reference any related issue, as required under Pull request requirements in Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Copilot PAT Auth
Overall: PARTIAL — PR author: Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔬 Smoke Test Results
Overall: PARTIAL — MCP connectivity confirmed; pre-step template vars were not substituted. Author: Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall Result: PASS ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Direct) — PASS
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Overall: PASS | Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios pass. The OTEL tracing integration is fully functional. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test Results
Overall status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL Agent runs inside AWF sandbox ( Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test Results — Docker Sbx
Overall: INCONCLUSIVE — pre-step template variables (
|
|
Smoke test results:
Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Chroot Version Comparison
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
apiProxy.allowedModelsandapiProxy.disallowedModelsfrom--configwere mapped but dropped beforeWrapperConfig, soAWF_ALLOWED_MODELS/AWF_DISALLOWED_MODELSnever reached the api-proxy container. Separately, resolver family fallback could rewrite a specifically requested model even when the provider advertised that exact model.Config pipeline: preserve model policy fields end-to-end
allowedModels/disallowedModelsto the validation→assembly path:validateLogAndLimitsresultassembleAndValidateConfig(...)inputs tobuildConfig(...)buildConfig(...)outputWrapperConfigbuildModelPolicyEnv(...)support.Resolver behavior: exact advertised model wins
containers/api-proxy/model-resolver.js,resolveModel(...)now checks for an exact provider-advertised match before GPT-5 family alias fallback.gpt-5.6-sol→gpt-5.6-lunawhengpt-5.6-solis already available.Regression coverage
allowedModels/disallowedModels