Refactor COPILOT_MODEL resolution to remove duplicated env precedence logic#3325
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors src/services/api-proxy-service.ts to centralize COPILOT_MODEL environment resolution logic, reducing duplication and drift risk while preserving the existing precedence order and normalization.
Changes:
- Removed the dedicated
getCopilotModel(config)helper. - Reused the existing
getConfigEnvValue(config, key)helper forCOPILOT_MODELresolution at the single call site.
Show a summary per file
| File | Description |
|---|---|
| src/services/api-proxy-service.ts | Removes duplicated COPILOT_MODEL resolution helper and updates the call site to use the shared config/env lookup utility. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
🔬 Smoke Test Results
Overall: PASS — Run: 26037938747
|
🔍 Smoke Test Results
Result: 2/3 PASS — GitHub API authentication failed (pre-auth may not be configured for this context)
|
🧪 Smoke Test: Copilot BYOK Offline Mode
Running in BYOK offline mode ( Overall: PASS (GitHub MCP 401 is a sandbox constraint, not a BYOK failure)
|
|
✅ GitHub PR review: fix: resolve test failures on macOS; fix: postprocess claude-token-optimizer lock file to use local awf build Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: FAILED — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results
Overall: FAIL —
|
|
Gemini Engine Smoke Test: PASS 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
src/services/api-proxy-service.tshad two near-identical helpers implementing the same env precedence (additionalEnv ?? envFile ?? process.env) forCOPILOT_MODEL. This created avoidable drift risk for future precedence changes.Consolidation
getCopilotModel(config)(duplicate implementation).getConfigEnvValue(config, key)as the single source of truth for config/env resolution.Call site update
getCopilotModelusage inbuildApiProxyServicewithgetConfigEnvValue(config, 'COPILOT_MODEL').Behavioral intent