Skip to content

fix(api-proxy): read Copilot reasoning efforts from live /models shape - #9225

Merged
lpcox merged 1 commit into
mainfrom
fix/copilot-routing-effort-metadata
Sep 29, 2026
Merged

lpcox merged 1 commit into
mainfrom
fix/copilot-routing-effort-metadata

Conversation

@lpcox

@lpcox lpcox commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

Released Model Routing Compatibility Smoke run 36622556364 failed with:

Model routing failed (no_route): No available Copilot model and effort is supported for routing

routing-catalogue.js accepted only two metadata shapes: a top-level supportedReasoningEfforts, or capabilities.supports.reasoningEffort === false. The live Copilot /models response uses neither. I checked with a read-only metadata fetch:

  • gpt-5-mini puts its efforts in capabilities.supports.reasoning_effort: ["low","medium","high"].
  • claude-haiku-4.5 has a capabilities.supports object with no effort key, and supported_endpoints: ["/chat/completions","/v1/messages"].

Because of this, every discovered Copilot model got efforts: undefined and was dropped from the candidate pool.

Fix

In normalizeModel, the catalogue now resolves efforts in this order:

  1. Top-level supportedReasoningEfforts (unchanged).
  2. capabilities.supports.reasoning_effort, when it is an array.
  3. An empty effort list when supports.reasoningEffort === false (unchanged), or when a supports object is present with no effort key. That is how Copilot marks a model without effort control.
  4. Otherwise undefined: no metadata, or a malformed effort value. The model is still excluded (fail closed).

Tests

  • New routing-catalogue.test.js case built from the live Copilot shapes. It also checks that allowedModels: [github-copilot/claude-haiku-4.5] now yields one effortless chat-completions choice.
  • Full api-proxy suite: 104 suites and 1993 tests pass.

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.yml is bumped.

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
Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.68% 92.69% ➡️ +0.01%
Statements 91.19% 91.20% 📈 +0.01%
Functions 89.25% 89.25% ➡️ +0.00%
Branches 84.30% 84.30% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9225

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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.

Generated by Security Guard for #9225

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Claude failed

Generated by Smoke Claude for #9225

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • clients2.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "clients2.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): failed (TLS cert error, no content served)

Overall: PASS (triggered by @lpcox)

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot — PASS

  • ✅ GitHub MCP: last merged PR "Centralize sensitive-path masking across runtimes"
  • ✅ github.com HTTP 200
  • ✅ File write/read
    cc @lpcox (author/assignee)

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Cloud Hypervisor + Copilot

  1. list_pull_requests (merged/closed): PASS — PR Centralize sensitive-path masking across runtimes #9220
  2. curl https://github.com: FAIL — sandbox denied curl execution ("Permission denied and could not request permission from user")
  3. write/read temp file: PASS — round-tripped smoke-cloud-hypervisor-36645263186.txt
  4. curl (example.com/redacted) blocked: INCONCLUSIVE — curl execution itself was denied by sandbox, not by firewall, so egress-blocking could not be verified

Overall: 2 PASS, 1 FAIL, 1 INCONCLUSIVE. No label applied since not all checks passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅

  • MCP connectivity: ✅
  • github.com HTTP 200: ✅
  • File I/O: ✅
  • BYOK inference (api-proxy → api.githubcopilot.com): ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar. All subsystems operational.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ 1. Module loading: otel.js loads and exports its functions (including _buildResourceSpans, _createOtlpWorkloadIdentity).
  • ✅ 2. Test suite: 3 suites, 68 tests, all passing.
  • ✅ 3. Env forwarding: trace context is in env-passthrough.ts (GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID). The OTEL vars are in api-proxy-env-config.ts.
  • ✅ 4. Token tracker: the onUsage callback exists in token-tracker-http.js.
  • ✅ 5. Diagnostics: /tmp/gh-aw/otel.jsonl has 1 line. I did not check what it contains, so I can't confirm any api-proxy spans were exported.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke services: Redis PING ✅ | pg_isready ✅ | SELECT 1 ✅ — PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison: ❌ Failed

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅
Node.js v24.21.0 v22.23.2 ❌
Go go1.22.12 go1.22.12 ✅

Node.js differs between host and chroot, so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ❌ not run ❌ FAIL
Bun hono ❌ not run ❌ FAIL
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak ❌ not run ❌ FAIL
Deno std ❌ not run ❌ FAIL
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ 1/1 pkg passed ✅ PASS
Go env ✅ 1/1 pkg passed ✅ PASS
Go uuid ✅ 1/1 pkg passed ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
Node.js clsx ✅ all passed ✅ PASS
Node.js execa ✅ all passed ✅ PASS
Node.js p-limit ✅ all passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 6/8 ecosystems passed — FAIL

Failures

  • Bun and Deno: the install scripts (curl https://bun.sh/install, https://deno.land/install.sh) were denied with "Permission denied and could not request permission from user". Bun and Deno were never installed, so no tests ran.
  • Java: ~/.m2 is root-owned, so Maven could not create ~/.m2/repository. I reran with -Dmaven.repo.local=/tmp/gh-aw/agent/m2, and both projects passed.

Generated by Build Test Suite for #9225 · copilot · auto · 29.7 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • clients2.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "clients2.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@lpcox
lpcox merged commit d2abd56 into main Sep 29, 2026
128 of 134 checks passed
@lpcox
lpcox deleted the fix/copilot-routing-effort-metadata branch September 29, 2026 23:44
lpcox added a commit that referenced this pull request Sep 30, 2026
* 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

This branch was previously deployed

1 inactive deployment
aoai-model — 5a99067e Deployed Sep 29, 2026 by lpcox via conclusion #1829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants