Skip to content

Support COPILOT_MODEL=auto in AWF validation and api-proxy resolution#6474

Merged
lpcox merged 4 commits into
mainfrom
copilot/support-for-copilot-auto-model
Jul 21, 2026
Merged

Support COPILOT_MODEL=auto in AWF validation and api-proxy resolution#6474
lpcox merged 4 commits into
mainfrom
copilot/support-for-copilot-auto-model

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

AWF rejected the Copilot auto model before request handling, even though upstream now treats auto as a valid first-class model selector. This change lets auto pass host-side validation and remain intact through api-proxy resolution.

  • Host-side model validation

    • Add auto to the accepted Copilot model catalog in src/copilot-model.ts
    • Allow COPILOT_MODEL=auto in config assembly without tripping unsupported-model errors
  • API proxy model resolution

    • Treat auto as a special pass-through in containers/api-proxy/model-resolver.js
    • Preserve auto instead of rewriting it to a concrete model or applying fallback heuristics
  • Startup model checks

    • Update startup requested-model validation to recognize auto as valid even when it does not appear in fetched provider model lists
  • Targeted coverage

    • Add focused tests for:
      • host-side COPILOT_MODEL=auto acceptance
      • resolver pass-through behavior
      • no-rewrite behavior for request bodies containing model: "auto"
      • startup validation behavior for AWF_REQUESTED_MODEL=auto

Example:

{
  "env": {
    "COPILOT_MODEL": "auto"
  }
}

With this change, AWF accepts that configuration and forwards auto unchanged to the Copilot path.

Copilot AI linked an issue Jul 21, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for copilot auto model Support COPILOT_MODEL=auto in AWF validation and api-proxy resolution Jul 21, 2026
Copilot finished work on behalf of lpcox July 21, 2026 12:35
Copilot AI requested a review from lpcox July 21, 2026 12:35
@lpcox
lpcox marked this pull request as ready for review July 21, 2026 13:56
Copilot AI review requested due to automatic review settings July 21, 2026 13:56

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.

Pull request overview

Adds first-class support for Copilot’s auto model selector across validation and proxy resolution.

Changes:

  • Accepts COPILOT_MODEL=auto.
  • Preserves auto through proxy resolution.
  • Adds targeted validation and pass-through tests.
Show a summary per file
File Description
src/copilot-model.ts Adds auto to supported Copilot models.
src/copilot-model.test.ts Tests normalized auto validation.
src/commands/validators/config-assembly-model-detection.test.ts Tests configuration acceptance.
containers/api-proxy/model-resolver.js Implements special pass-through resolution.
containers/api-proxy/model-resolver.test.js Tests resolution and body preservation.
containers/api-proxy/server.startup-model-validation.test.js Tests startup validation without provider-list inclusion.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread containers/api-proxy/model-resolver.js Outdated
Comment thread containers/api-proxy/model-resolver.js Outdated
const key = requestedModel.toLowerCase();
const fallbackConfig = normalizeFallbackConfig(modelFallbackConfig);

if (key === 'auto') {
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

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.

@lpcox

lpcox commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.74% 98.78% 📈 +0.04%
Statements 98.69% 98.72% 📈 +0.03%
Functions 99.28% 99.28% ➡️ +0.00%
Branches 94.95% 94.95% ➡️ +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

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed in 78ad4ef.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK reports failed. BYOK mode investigation needed...

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Status
GitHub MCP ❌ Filtered by secrecy policy
GitHub.com Connectivity ✅ HTTP 200
File Write/Read ❌ Template variables not expanded (pre-step data unavailable)

Overall: FAIL — Pre-computed step data was not available (template variables unexpanded), and MCP access was filtered by secrecy policy.

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

@github-actions

Copy link
Copy Markdown
Contributor

One thing looks missing for CONTRIBUTING.md: Documentation. This PR changes user-facing model validation/handling (COPILOT_MODEL=auto / AWF_REQUESTED_MODEL=auto), so the repo docs should be updated to reflect that auto is now an accepted Copilot model selector. The contribution guide calls out both “Update documentation for any new features” and “Update documentation if needed” in the PR process.

The tests and PR description look good, but I’d add a small README/docs note so users know auto is supported.

Generated by Contribution Check for #6474 · 1.53 AIC · ⊞ 23.6K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results — FAIL ❌

Check Result
Redis PING ❌ Name resolution / connection failed
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ Connection failed

host.docker.internal could not be resolved (DNS failure), and fallback attempts via 172.17.0.1 and localhost also failed — services appear unreachable from this runner environment.

Overall: FAIL

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

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Detail
1. Module Loading otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite 59 tests passed, 0 failed (2 suites: otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME
4. Token Tracker Integration onUsage callback exists in token-tracker-http.js (line 285, invoked at line 343)
5. OTEL Diagnostics isEnabled() returns true; file fallback to /var/log/api-proxy/otel.jsonl when no OTLP endpoint configured
6. Graceful Degradation Module loads without errors when no OTLP endpoint set; falls back to local NDJSON file

All 6 scenarios pass. OTEL tracing integration is fully functional.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test: Copilot Network Isolation — @lpcox

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): connection denied (403 from proxy)

Overall: PASS

Warning

Firewall blocked 1 domain

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

  • example.com

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

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison ✅

All runtimes match between host and chroot environments.

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13
Node.js v24.18.0 v24.18.0
Go go1.22.12 go1.22.12

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

@github-actions github-actions Bot added smoke-copilot-network-isolation Copilot network-isolation egress smoke test smoke-chroot labels Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API Status ✅ PASS
GH Check ✅ PASS
File Status ✅ PASS

Overall Result: PASS

Generated by Smoke Claude for #6474 · 36.7 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

  • GitHub MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

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
Overall status: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • PR Titles: Access Denied (Filtered by secrecy policy)
  • GitHub MCP Testing: ❌
  • GitHub.com Connectivity: ❌ (HTTP 000)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: FAIL

Warning

Firewall blocked 1 domain

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

  • localhost

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

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox
❌ Test 1 (PR Data): MCP error: filtered by secrecy policy
✅ Test 2 (GitHub.com): HTTP 200
✅ Test 3 (File I/O): 'test123'
✅ Test 4 (BYOK mode): Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: FAIL

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
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 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson N/A ❌ FAIL
Java caffeine N/A ❌ FAIL
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: 7/8 ecosystems passed — ❌ FAIL


❌ Failure Details

Java (gson, caffeine) — Both projects failed during mvn compile with a network error:

Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.4.0
from/to central (https://repo.maven.apache.org/maven2): Network is unreachable

Maven cannot reach Maven Central (repo.maven.apache.org) from this environment. The AWF firewall is blocking outbound connections to repo.maven.apache.org since it is not in the allowed domains list.

Generated by Build Test Suite for #6474 · 34.6 AIC · ⊞ 8.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test: Copilot PAT Auth — PR #6474

Test Result
GitHub MCP ✅ (PR list accessible)
GitHub.com connectivity ✅ HTTP 200
File write/read ⚠️ Template vars not expanded (pre-step skipped)

Overall: PASS
Auth mode: PAT (COPILOT_GITHUB_TOKEN)

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test results:

  • GitHub reads: ❌ (authenticated wrapper unavailable in this shell)
  • Playwright title check: ✅
  • File write/read: ✅
  • Build (npm ci && npm run build): ✅
  • Overall: FAIL

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

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results — Docker Sbx

Test Status
GitHub MCP connectivity ⚠️ filtered by secrecy policy
GitHub.com HTTP ⚠️ pre-step data unavailable (template not expanded)
File write/read ⚠️ pre-step data unavailable (template not expanded)

Overall: INDETERMINATE — pre-step outputs were not injected into the prompt (template variables unexpanded). MCP PR data filtered by secrecy policy.

/cc @lpcox

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

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.

Support for copilot auto model

3 participants