Skip to content

ci: run the Copilot CLI on a routed selection in model-routing smoke - #9249

Merged
lpcox merged 1 commit into
mainfrom
ci/routing-smoke-copilot-cli
Sep 30, 2026
Merged

lpcox merged 1 commit into
mainfrom
ci/routing-smoke-copilot-cli

Conversation

@lpcox

@lpcox lpcox commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Refs #9238, covering step 4 (the AWF half). This runs the real Copilot CLI, pinned to 1.0.89 to match gh-aw's DefaultCopilotVersion, as the agent on a routed selection. That is the shape of a gh-aw Copilot engine step, so it shows what gh-aw has to do before end-to-end routing can work.

What's added

  • Install the Copilot CLI used by gh-aw: npm install -g @github/[email protected].

  • Run the Copilot CLI agent on the routed selection: allows claude-haiku-4.5 and gpt-5.4-mini. Inside AWF it:

    • reads the selection from /reflect;
    • sets COPILOT_PROVIDER_WIRE_API from the routed endpoint;
    • runs copilot --model <wire_model> [--reasoning-effort <effort>] --prompt …;
    • asserts ROUTED_OK.

    AWF exits 0 only if every request the CLI made matched the selection. Any stray model, effort or endpoint produces exit 78.

What this found

On the first run, the Copilot CLI was rejected with exit 78 (model_routing_mismatch; the CLI reported Authentication failed with provider … (HTTP 403)).

The cause is that AWF sets COPILOT_PROVIDER_WIRE_API=responses from COPILOT_MODEL at launch (copilot-credential-env.ts), before the router has chosen. Under routing there is no fixed COPILOT_MODEL, so the wire API is never set. The CLI then sent gpt-5.4-mini + effort to /chat/completions, and enforcement rejected it (/responses is required when an effort is present).

Once the wire API is set from the routed endpoint, the Copilot CLI complies fully:

ROUTED_SELECTION={"provider":"copilot","model":"github-copilot/gpt-5.4-mini","wire_model":"gpt-5.4-mini","effort":"xhigh","endpoint":"/responses"}
ROUTED_OK
ROUTED_COPILOT_CLI=passed model=gpt-5.4-mini effort=xhigh
Process exiting with code: 0

So a gh-aw engine step under routing must take model, effort and wire API from /reflect, not from its compile-time COPILOT_MODEL. Separately, gh-aw's compiler currently only validates the experimental.modelRouting gate (TestValidateAWFConfigJSON_ModelRoutingGate). It doesn't yet emit apiProxy.routing or write a routing conversation file. Both are tracked in #9238.

Validation

  • Validation run on the branch, with the main-only guard temporarily removed and the native-provider job disabled to avoid spend: run 36669199288. The Copilot job passed, including the new step.
  • The earlier failing runs (36668364575) show the rejection without the wire-API fix.
  • The branch is squashed to one commit; the guards are unchanged from main.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f9549be0-1ad6-4e3e-b641-b2f5f0485b1b

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 workflow change is consistent with existing routing coverage and passed the referenced live validation.

Review effort: Balanced
Findings: None

What changed in this PR

Adds live smoke coverage proving the real gh-aw-pinned Copilot CLI can consume AWF’s routed model, effort, and endpoint selection.

Changes:

  • Installs Copilot CLI 1.0.89.
  • Reads routing data from /reflect and configures the CLI accordingly.
  • Verifies routed execution returns ROUTED_OK.
File Description
.github/​workflows/​test-model-routing.yml Adds routed Copilot CLI installation and execution smoke steps.

💡 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 Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 92.71% 92.71% ➡️ +0.00%
Statements 91.22% 91.22% ➡️ +0.00%
Functions 89.30% 89.30% ➡️ +0.00%
Branches 84.29% 84.28% 📉 -0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-adapter.ts 83.5% → 82.9% (-0.60%) 80.3% → 79.8% (-0.56%)
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 30, 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 30, 2026 •

Copy link
Copy Markdown
Contributor

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

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 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Claude failed

Generated by Smoke Claude for #9249

@github-actions

github-actions Bot commented Sep 30, 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 30, 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 30, 2026 •

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 30, 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 Sep 30, 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 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9249

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 30, 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 30, 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

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 30, 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

Copy link
Copy Markdown
Contributor

Smoke Copilot — PASS

  • ✅ GitHub MCP: last merged/closed PR "chore: upgrade gh-aw workflows to v0.90.0"
  • ✅ github.com HTTP 200
  • ✅ File write/read
    Author: @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke services: ✅ Redis PONG, ✅ pg_isready accepting connections, ✅ SELECT 1 = 1. PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test (re-verified locally)

  • ✅ S1: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled (+ internals)
  • ✅ S2: OTEL tests 68/68 passed (3 suites)
  • ✅ S3: trace-context vars forwarded in env-passthrough.ts; OTEL vars forwarded in api-proxy-env-config.ts
  • ✅ S4: onUsage hook present in token-tracker-http.js
  • ⚪ S5: Post-step diagnostics not available to me; no export check performed

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

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com failed: TLS cert error, not reachable)
  • 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 Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 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

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 passed ✅ PASS
Go env ✅ 1/1 passed ✅ PASS
Go uuid ✅ 1/1 passed ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
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: 6/8 ecosystems passed — FAIL

Failures

  • Bun / Deno: the curl ... | bash / sh installer commands were rejected by the sandbox ("Permission denied and could not request permission from user"), so neither runtime was installed and no tests ran.
  • Java note: ~/.m2 was root-owned so Maven couldn't create its local repo. I used -Dmaven.repo.local=/tmp/gh-aw/agent/m2 as a workaround, and it passed.

The build-test label was not added because not all ecosystems passed.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Cloud Hypervisor + Copilot

  1. list_pull_requests (github/gh-aw-firewall): PASS — API call succeeded, returned PR data.
  2. curl https://github.com: FAIL — sandbox denied curl execution ("Permission denied and could not request permission from user"), not a firewall 200/301 response.
  3. Write/read /tmp/gh-aw/agent/smoke-cloud-hypervisor-*.txt: PASS — file written and read back successfully.
  4. curl (example.com/redacted): FAIL — same sandbox denial as check 2; could not verify block via curl.

Note: checks 2 and 4 were blocked at the tool-permission layer before any network request was attempted, so firewall behavior itself was not exercised for these two checks.

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 ✅

Test Result
GitHub MCP ✅ PR data verified
GitHub.com connectivity ✅ HTTP 200
File write/read ✅ File exists and readable
BYOK inference ✅ Running in direct mode via api-proxy → api.githubcopilot.com

Status: PASS — Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar

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

@github-actions

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 version mismatch), so the smoke-chroot label was not added.

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

@lpcox
lpcox merged commit 9701616 into main Sep 30, 2026
127 of 136 checks passed
@lpcox
lpcox deleted the ci/routing-smoke-copilot-cli branch September 30, 2026 15:46

This branch was previously deployed

1 inactive deployment
aoai-model — be0f584b Deployed Sep 30, 2026 by lpcox via conclusion #1833
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