Repository navigation
fix(api-proxy): read Copilot reasoning efforts from live /models shape - #9225
Conversation
Copilot's /models advertises efforts under capabilities.supports.reasoning_effort and omits the key for models without effort control. The routing catalogue only read a top-level supportedReasoningEfforts, so every live Copilot model was excluded and routing failed with no_route. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation preserves fail-closed behavior and includes coverage for the reported failure.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Copilot routing to support the live /models reasoning-effort metadata shape.
Changes:
- Normalizes snake_case reasoning efforts and effortless models.
- Adds regression coverage for live Copilot metadata and candidate generation.
| File | Description |
|---|---|
containers/api-proxy/routing-catalogue.js |
Normalizes live Copilot effort metadata. |
containers/api-proxy/routing-catalogue.test.js |
Tests routing with representative live metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
✅ Build Test Suite completed successfully!
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✅ Security Guard completed successfully! PR #9225 security review: No security-weakening changes found. The refactoring of reasoning_effort metadata normalization in containers/api-proxy/routing-catalogue.js improves type safety without modifying firewall rules, capabilities, egress policies, or domain allowlists. PR passes security review.
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
❌ Smoke Claude failed
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "clients2.google.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass
Overall: PASS (triggered by @lpcox)
|
|
Smoke Copilot — PASS
|
Smoke Test: Cloud Hypervisor + Copilot
Overall: 2 PASS, 1 FAIL, 1 INCONCLUSIVE. No label applied since not all checks passed.
|
|
Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅
Running in direct BYOK mode (
|
|
OTEL smoke test
|
|
Smoke services: Redis PING ✅ | pg_isready ✅ | SELECT 1 ✅ — PASS
|
Chroot Version Comparison: ❌ Failed
Node.js differs between host and chroot, so the
|
🏗️ Build Test Suite Results
Overall: 6/8 ecosystems passed — FAIL Failures
|
Smoke Test
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "clients2.google.com"See Network Configuration for more information.
|
* ci: pin model-routing smoke to v0.28.28 images v0.28.28 includes the Copilot reasoning-effort metadata fix (#9225) that resolves the smoke's no_route failure. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b * ci: temporarily allow model-routing smoke on branch Co-authored-by: Copilot App <[email protected]> Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b * ci: restore main-only guard on model-routing smoke Co-authored-by: Copilot App <[email protected]> Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b --------- Co-authored-by: Copilot App <[email protected]> Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b
Problem
Released Model Routing Compatibility Smoke run 36622556364 failed with:
routing-catalogue.jsaccepted only two metadata shapes: a top-levelsupportedReasoningEfforts, orcapabilities.supports.reasoningEffort === false. The live Copilot/modelsresponse uses neither. I checked with a read-only metadata fetch:gpt-5-miniputs its efforts incapabilities.supports.reasoning_effort: ["low","medium","high"].claude-haiku-4.5has acapabilities.supportsobject with no effort key, andsupported_endpoints: ["/chat/completions","/v1/messages"].Because of this, every discovered Copilot model got
efforts: undefinedand was dropped from the candidate pool.Fix
In
normalizeModel, the catalogue now resolves efforts in this order:supportedReasoningEfforts(unchanged).capabilities.supports.reasoning_effort, when it is an array.supports.reasoningEffort === false(unchanged), or when asupportsobject is present with no effort key. That is how Copilot marks a model without effort control.undefined: no metadata, or a malformed effort value. The model is still excluded (fail closed).Tests
routing-catalogue.test.jscase built from the live Copilot shapes. It also checks thatallowedModels: [github-copilot/claude-haiku-4.5]now yields one effortlesschat-completionschoice.Follow-up
The smoke workflow pins the released api-proxy image
0.28.27, so it will keep failing until this ships in a release and the pin in.github/workflows/test-model-routing.ymlis bumped.