Skip to content

Align Copilot reflection metadata with routing eligibility - #9381

Merged
lpcox merged 4 commits into
mainfrom
copilot/fix-model-routing-inconsistencies
Oct 2, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/fix-model-routing-inconsistencies

Conversation

Copilot AI commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Copilot /reflect could mark routable models incomplete, while routing candidates could include models disabled in the model picker. This made the reflection catalogue disagree with the choices available to the router.

  • Shared eligibility: Use routing catalogue normalization and choice logic for /reflect completeness, including Copilot’s reasoning_effort field and models with no effort control.
  • Picker filtering: Preserve model_picker_enabled in runtime metadata and exclude disabled Copilot models, even when explicitly allowlisted.
  • Explain exclusions: Add candidate_metadata_reason for picker-disabled models.
{
  "model_id": "internal-model",
  "candidate_metadata_complete": false,
  "candidate_metadata_reason": "Model is not enabled in the Copilot model picker"
}

Copilot AI and others added 2 commits October 2, 2026 19:11
Copilot AI changed the title [WIP] Fix model routing issues in /reflect API Align Copilot reflection metadata with routing eligibility Oct 2, 2026
Copilot AI requested a review from lpcox October 2, 2026 19:17
@lpcox
lpcox marked this pull request as ready for review October 2, 2026 19:34
Copilot AI balanced review requested due to automatic review settings October 2, 2026 19:34

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

🟡 Changes recommended

The real /reflect path still receives sanitized records without the routing metadata required by the new normalization.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Aligns Copilot reflection metadata and routing eligibility, including picker-disabled model filtering.

Changes:

  • Preserves and applies Copilot model-picker eligibility.
  • Shares routing-choice logic with /reflect.
  • Adds exclusion metadata and tests.
File Description
docs/​api-proxy-sidecar.md Documents exclusion reasons.
containers/​api-proxy/​runtime-model-catalog.js Retains picker eligibility.
containers/​api-proxy/​runtime-model-catalog.test.js Tests metadata normalization.
containers/​api-proxy/​routing-catalogue.js Propagates picker eligibility.
containers/​api-proxy/​routing-candidates.js Filters disabled models and shares choice logic.
containers/​api-proxy/​routing-candidates.test.js Tests picker filtering.
containers/​api-proxy/​management.js Derives reflection completeness from routing choices.
containers/​api-proxy/​management.test.js Tests reflection-routing consistency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

: (runtime?.capabilities?.supports?.reasoningEffort === false
? []
: (maintained?.reasoningEfforts ?? null));
const normalized = normalizeModel(id, runtime, provider);
@lpcox

lpcox commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Fixed in ba19f49. /reflect now uses private runtime metadata for routing eligibility while preserving the sanitized model_metadata response. The server-path regression test and full API-proxy suite pass.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-9381 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 4dd0fdc

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.07% 92.82% 📈 +0.75%
Statements 90.54% 91.29% 📈 +0.75%
Functions 88.88% 89.34% 📈 +0.46%
Branches 83.55% 84.71% 📈 +1.16%
📁 Per-file Coverage Changes (4 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/manager-stop.ts 91.0% → 92.1% (+1.12%) 85.8% → 86.7% (+0.83%)
src/cloud-hypervisor/manager.ts 85.9% → 88.7% (+2.82%) 84.3% → 87.1% (+2.72%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)
src/cloud-hypervisor/host-enclave-executor.ts 55.0% → 94.4% (+39.33%) 51.7% → 90.5% (+38.81%)

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

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Security Guard completed successfully!

Security review of PR #9381: No security issues found. The PR refactors model routing metadata handling in the API proxy sidecar, adding support for modelPickerEnabled field and consolidating routing logic into getModelRoutingChoices(). All changes maintain input validation rigor, preserve access control mechanisms, do not introduce new capabilities or expand firewall rules, and include safe fallback patterns. No secrets exposure, egress expansion, or ACL regression detected.

Generated by Security Guard for #9381

@github-actions

github-actions Bot commented Oct 2, 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 Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Oct 2, 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 Oct 2, 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 Oct 2, 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 Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor reports failed. Cloud Hypervisor + Copilot failed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

Smoke test incomplete: required binaries gh, npm/node, and playwright-cli are unavailable on PATH, so no PR/discussion comment or build verification was possible.

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #9381

@github-actions

github-actions Bot commented Oct 2, 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 Oct 2, 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 Oct 2, 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 Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9381

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #9381 · claude · haiku45 · 49.8 AIC · ⊞ 6.2K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PASS

  • MCP: ✅ (latest merged: "docs: add A29 ARC/DinD token-usage diagnostics")
  • github.com: ✅ (HTTP 200)
  • File write/read: ✅
    PR: "Align Copilot reflection metadata with routing eligibility" — author @Copilot, assignees @lpcox @Copilot

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): blocked (curl failed with TLS cert error, "OK: example.com was blocked")
  • Overall: PASS

cc @lpcox

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

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Oct 2, 2026
@lpcox
lpcox deployed to aoai-model October 2, 2026 20:15 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
  • ✅ S2: OTEL tests 68/68 pass (3 suites)
  • ✅ S3: Env forwarding OK (GITHUB_AW_OTEL_TRACE_ID/PARENT_SPAN_ID in env-passthrough.ts; OTLP vars + trace context in api-proxy-env-config.ts)
  • ✅ S4: onUsage callback present in token-tracker-http.js
  • ⚠️ S5: Only 1 line in local otel.jsonl; no api-proxy span export evidence (not enabled in this run)

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode

✅ GitHub MCP — PR listing verified (2 recent merged PRs)
✅ github.com Connectivity — HTTP 200
✅ File Write/Read — /tmp/gh-aw/agent/smoke-test-copilot-byok.txt confirmed
✅ BYOK Inference — Direct BYOK mode via api-proxy → api.githubcopilot.com

Status: PASS — Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY)

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Services smoke test:

  • Redis PING: ✅ PONG
  • pg_isready: ✅ accepting connections
  • psql SELECT 1: ✅ 1

Overall: PASS

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

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

Result: Not all tests passed. Node.js differs between host (v24) and chroot (v22), so the smoke-chroot label was not added.

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

@github-actions

github-actions Bot commented Oct 2, 2026

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 ok ✅ PASS
Go env ✅ 1/1 pkg ok ✅ PASS
Go uuid ✅ 1/1 pkg ok ✅ PASS
Java gson ❌ not run ❌ FAIL
Java caffeine ❌ not run ❌ FAIL
Node.js clsx ✅ passed ✅ PASS
Node.js execa ✅ passed ✅ PASS
Node.js p-limit ✅ passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 5/8 ecosystems passed — FAIL

Failure details

  • Bun / Deno: the installer step (curl ... | bash / | sh) was denied by the sandbox with "Permission denied and could not request permission from user". Bun and Deno are not preinstalled, so the tests could not run.
  • Java: Maven failed with Could not create local repository at /home/runner/.m2/repository (LocalRepositoryNotAccessibleException). This is an environment limitation. Neither compile nor test ran.

All 8 repositories cloned successfully. The build-test label was not added because of the failures.

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

@lpcox
lpcox merged commit 77911db into main Oct 2, 2026
128 of 135 checks passed
@lpcox
lpcox deleted the copilot/fix-model-routing-inconsistencies branch October 2, 2026 20:39

This branch was successfully deployed

1 active deployment
aoai-model — ba19f494 Deployed Oct 2, 2026 by lpcox via conclusion #1857
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.

Model routing: /reflect marks every Copilot model incomplete, and the candidate pool includes non-picker models

3 participants