Add CI guard to prevent SUPPORTED_COPILOT_MODELS drift from pricing catalog#6039
Conversation
Implements the three-part fix from issue #6024: 1. Single source of truth comment — SUPPORTED_COPILOT_MODELS in src/copilot-model.ts now documents exactly which related files must be updated when adding or retiring a model. 2. CI guard — new src/copilot-model-catalog-sync.test.ts fails if any model added to ai-credits-pricing.js is missing from SUPPORTED_COPILOT_MODELS and not explicitly excluded. This catches the class of bug fixed in #5831 (mai-code-1-flash) before it ships. 3. Pointer comment in ai-credits-pricing.js — directs contributors to add new Copilot CLI models to SUPPORTED_COPILOT_MODELS as well. testHelpers export added to copilot-model.ts (@internal / ts-prune-ignore-next) to give the sync test access to the internal Set.
There was a problem hiding this comment.
Pull request overview
Adds a CI-level guard to prevent drift between the api-proxy pricing catalog and the host-side Copilot model allowlist, so valid COPILOT_MODEL values aren’t rejected pre-container with misleading errors.
Changes:
- Documented
SUPPORTED_COPILOT_MODELSas the “single source of truth” and added guidance on which related catalogs/guards must be updated when adding/retiring models. - Added
src/copilot-model-catalog-sync.test.tsto fail CI whencontainers/api-proxy/ai-credits-pricing.jscontains a model missing fromSUPPORTED_COPILOT_MODELS(unless explicitly excluded with justification). - Added a sync-pointer comment in
ai-credits-pricing.jsand exportedtestHelpersfromcopilot-model.tsfor focused tests.
Show a summary per file
| File | Description |
|---|---|
| src/copilot-model.ts | Adds a “single source of truth” doc comment and exposes testHelpers for the sync test. |
| src/copilot-model-catalog-sync.test.ts | New CI guard test to enforce parity between pricing catalog and supported Copilot CLI models. |
| containers/api-proxy/ai-credits-pricing.js | Adds an in-file note pointing contributors to the allowlist and CI guard to avoid drift. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Low
| /** Mirror of the separator normalisation in copilot-model.ts. */ | ||
| function normalizeSeparators(s: string): string { | ||
| return s.replace(/[._]/g, '-').toLowerCase(); | ||
| } |
|
@copilot address review feedback |
- Export testHelpers.supportedCopilotModels as a ReadonlySet defensive copy to prevent accidental mutation of the production singleton in tests - Update normalizeSeparators() comment to accurately describe full canonicalization (lowercase + separator replacement), not just separator normalization
Done in the latest commit. Both review items addressed:
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
❌ Security Guard failed. Please review the logs for details. |
|
🔌 Smoke Services — All services reachable! ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Contribution Check completed successfully! PR #6039 follows the applicable CONTRIBUTING.md guidelines: it includes a clear description with related issue reference, adds a relevant test for the new CI guard, keeps files in appropriate locations, and does not require additional documentation beyond inline guidance for this internal test invariant. |
|
✅ Build Test Suite completed successfully! |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Gemini completed. All facets verified. 💎 Smoke test complete. Results reported to PR #6039. Overall status: FAIL. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 98.98% | 98.98% | ➡️ +0.00% |
| Statements | 98.94% | 98.94% | ➡️ +0.00% |
| Functions | 99.44% | 99.44% | ➡️ +0.00% |
| Branches | 95.64% | 95.60% | 📉 -0.04% |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test: Copilot BYOK (Direct) ✅ PASSTests:
Mode: Direct BYOK via COPILOT_PROVIDER_API_KEY (api-proxy sidecar injection) All systems operational. 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 PAT Auth ✅ PASS
Auth mode: PAT (COPILOT_GITHUB_TOKEN) All tests passed. 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: FAIL — 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 Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments. 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: PASS (connectivity verified)
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 summary
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.
|
Smoke Test: Gemini Engine Validation
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: API Proxy OpenTelemetry Tracing
All 5 scenarios pass. OTEL tracing integration is 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.
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra 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.
|
When a new model is added to
containers/api-proxy/ai-credits-pricing.jsbut not toSUPPORTED_COPILOT_MODELSinsrc/copilot-model.ts, AWF rejects validCOPILOT_MODELvalues with a misleading "retired or unsupported" error before containers start. This recurred withmai-code-1-flash(#5831).Changes
Single source of truth comment —
SUPPORTED_COPILOT_MODELSnow documents exactly which related files need updating when adding or retiring a model:CI guard (
src/copilot-model-catalog-sync.test.ts) — fails if any key inai-credits-pricing.jsis absent fromSUPPORTED_COPILOT_MODELSand not in an explicitINTENTIONALLY_EXCLUDED_FROM_SUPPORTEDset. The exclusion set requires an inline comment explaining why the model isn't a Copilot CLI completion model (e.g. embedding models, BYOK-only variants). Error message tells contributors exactly what to do.testHelpersexport oncopilot-model.ts(following the repo's@internal/ts-prune-ignore-nextpattern) to expose the internalSetto the sync test without widening the public API.Pointer comment in
ai-credits-pricing.jsdirecting contributors toSUPPORTED_COPILOT_MODELSand the CI guard.