Skip to content

ci(router): add live router-fallback smoke check - #12234

Merged
rabeckett merged 1 commit into
mainfrom
ci/live-fallback-smoke
Nov 27, 2026
Merged

rabeckett merged 1 commit into
mainfrom
ci/live-fallback-smoke

Conversation

@rabeckett

Copy link
Copy Markdown
Collaborator

Fixes #12230

Extends .github/workflows/test-model-routing.yml with a live router-fallback smoke check against the locally built api-proxy and router images and the live Copilot API, and adds host-side provenance checks to the existing routed inference steps so a silent fallback fails the routed smoke.

What changed

  • Added a Run a fallback Copilot inference through AWF step that restricts apiProxy.allowedModels to github-copilot/claude-haiku-4.5 (already exercised on the CI Copilot account in the cross-endpoint step, absent from all bundled containers/router/routing/*.json tables, and mapped to lightweight in coding-tiers.json). Inside the container, the step reads /reflect, checks routing.status === "selected" with wire_model === "claude-haiku-4.5", effort === null, and endpoint === "/chat/completions", and sends a live completion request expecting FALLBACK_OK.
  • Added --proxy-logs-dir "${ROUTING_DIR}/logs" to the fallback step and to every existing routed step that did not already pass it (single Copilot, effort-routed Copilot, Copilot CLI, and native OpenAI/Anthropic), plus inline selection_source === "router" assertions in the multi-candidate audit step.
  • Added a zero-dependency host-side validator (scripts/ci/assert-model-routing-selection.cjs) and unit tests (scripts/ci/assert-model-routing-selection.test.ts) that verify model-routing.jsonl provenance, no prompt leakage, no routing failure records, and workflow YAML/Bash syntax.
  • Added containers/api-proxy/automatic-model-eligibility.js, containers/api-proxy/model-information.coding-tiers.generated.json, and scripts/ci/assert-model-routing-selection.cjs to on.push.paths in .github/workflows/test-model-routing.yml.

Concrete example

When the fallback step completes, the preserved per-run model-routing.jsonl selection record matches:

{
  "stage": "selection",
  "selected_provider": "copilot",
  "selected_model": "github-copilot/claude-haiku-4.5",
  "wire_model": "claude-haiku-4.5",
  "endpoint": "/chat/completions",
  "selected_effort": null,
  "selection_source": "fallback",
  "fallback_reason": "no_route",
  "fallback_tier": "lightweight",
  "router": { "name": "gh-aw-router", "version": "0.4.0" },
  "ranked_choices": null,
  "classifier_attempts": 0
}

And the host-side audit step prints:

FALLBACK_COPILOT_AUDIT=passed source=fallback reason=no_route tier=lightweight model=claude-haiku-4.5

Validation

Validated on Linux (Node 22) against head 73429c0c1c25e09bf18e1090a8e9d7a3b664864c:

  • Local checks suite (type-check, build, lint, schema-generation, schema-parity): PASS
  • Focused Jest suites (scripts/ci/assert-model-routing-selection.test.ts and scripts/ci/reproducible-npm-installs.test.ts, including bash -n on every workflow step and real recordSelection + writeRoutingRecord persistence): 26/26 PASS

Add a live fallback Copilot inference check to test-model-routing.yml using
github-copilot/claude-haiku-4.5 (absent from bundled router tables, mapped to
the lightweight coding tier) and assert host-side model-routing.jsonl provenance
on both the fallback step and the existing routed inference steps.

Fixes #12230

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rabeckett rabeckett added the model-routing Model routing selection, compatibility, and diagnostics label Nov 27, 2026
@rabeckett
rabeckett marked this pull request as ready for review November 27, 2026 18:58
Copilot AI adaptive review requested due to automatic review settings November 27, 2026 18:58
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@rabeckett rabeckett changed the title ci(routing): add live router-fallback smoke check ci(router): add live router-fallback smoke check Nov 27, 2026

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.

🔵 Needs a closer look

The live smoke couples routing, proxy fallback, /reflect, and terminal request persistence, requiring cross-container validation beyond the scope of straightforward, locally reasoned CI edits.

No open issues 🎉

What changed in this PR

Adds live end-to-end coverage for deterministic model-router fallback in AWF’s existing routing workflow, addressing #12230.

Changes:

  • Adds a Copilot fallback smoke check that verifies /reflect, live inference, and preserved routing provenance.
  • Adds host-side assertions to existing routed checks so silent fallback fails the smoke tests.
  • Introduces a zero-dependency audit validator with tests for record validation, workflow wiring, and Bash syntax.
File Description
scripts/​ci/​assert-model-routing-selection.test.ts Tests audit validation, persisted records, and workflow integration.
scripts/​ci/​assert-model-routing-selection.cjs Validates routing provenance, fallback metadata, and optional completed-request evidence.
.github/​workflows/​test-model-routing.yml Adds the live fallback check, routed-selection audits, and relevant push triggers.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 95.10% 95.10% ➡️ +0.00%
Statements 93.82% 93.81% ➡️ -0.01%
Functions 94.19% 94.19% ➡️ +0.00%
Branches 88.60% 88.59% ➡️ -0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)
src/enclave/host-executor-socket.ts 95.9% → 95.9% (+0.00%) 90.2% → 91.5% (+1.22%)

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

@github-actions

github-actions Bot commented Nov 27, 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 Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Warning

Firewall blocked 1 domain

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

  • 169.254.169.254

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

network:
  allowed:
    - defaults
    - "169.254.169.254"

See Network Configuration for more information.

Generated by Build Test Suite for #12234 · copilot · routed: haiku55 xhigh · ~3 AIC · ⊞ 6.1K · ◷

@github-actions

github-actions Bot commented Nov 27, 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 Nov 27, 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

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Nov 27, 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 Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #12234 · claude · haiku45 · ~36 AIC · ⊞ 6.4K · ◷

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request...

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Smoke Chroot

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine, PR #12234 (@rabeckett)

Overall: PASS

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

@github-actions

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

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

@github-actions github-actions Bot added smoke-cloud-hypervisor smoke-copilot-network-isolation Copilot network-isolation egress smoke test labels Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Network Isolation ✅ PASS

Both egress checks passed successfully:

Check Result Details
Allowed Domain ✅ PASS api.github.com returned HTTP 200
Blocked Domain ✅ PASS example.com blocked by SNI guard

EGRESS_RESULT allow=pass deny=pass

The firewall is correctly enforcing network isolation—whitelisted domains are accessible while non-whitelisted domains are blocked.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Claude Results

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

Overall result: PASS

Generated by Smoke Claude for #12234 · claude · haiku45 · ~36 AIC · ⊞ 6.4K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Services smoke test: ✅ Redis PONG, ✅ 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

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Result
GitHub MCP ✅ PR #12227, #12226 fetched
HTTP Connectivity ✅ 200
File Write/Read ✅ Verified
BYOK Inference ✅ Working (running in direct mode)

Status: PASS
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

🔑 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.16 Python 3.12.16 ✅ YES
Node.js v24.22.3 v24.22.3 ✅ YES
Go go1.22.12 FAILED (no version output) ❌ NO

Result: Python and Node.js match. Go could not report a version inside the chroot, so the overall run did not pass. 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

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

🏗️ 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 (run OK) ✅ PASS
.NET json-parse ✅ N/A (run OK) ✅ 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 ✅ 1/1 script passed ✅ PASS
Node.js execa ✅ 1/1 script passed ✅ PASS
Node.js p-limit ✅ 1/1 script passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Environment workarounds (not test failures):

  • .NET: The first run failed in the CLI first-run setup because XDG_RUNTIME_DIR=/run/user/1001 does not exist on the runner. Re-ran with XDG_RUNTIME_DIR set to a private temp directory and DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1.
  • Java: Maven could not create ~/.m2/repository on the runner. Re-ran with -Dmaven.repo.local pointing at a temp directory. The proxy settings.xml was written as specified.
  • Go: The test modules have no external dependencies, so go mod download had nothing to fetch.
  • Node.js: Each project is a single node test.js script with one assertion, so there is no runner pass count.

Warning

Firewall blocked 1 domain

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

  • 169.254.169.254

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

network:
  allowed:
    - defaults
    - "169.254.169.254"

See Network Configuration for more information.

Generated by Build Test Suite for #12234 · copilot · routed: haiku55 xhigh · ~3 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Local validation: ✅ all scenarios passed. Collector delivery: ⚠️ unverified (no backend span evidence for this run).

# Scenario Result Details
1 Module loading ✅ otel.js loads; isEnabled() is true. Exports: startRequestSpan, getRequestTraceHeaders, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, routerCallTracing, shutdown, isEnabled, plus _-prefixed test helpers.
2 Test suite ✅ Jest --testPathPatterns=otel: 3 suites, 77/77 tests passed, 0 failed.
3 Env var forwarding ✅ env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID. api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and both trace-context vars.
4 Token tracker integration ✅ onUsage callback present in token-tracker-http-finalize.js (OTEL hook point).
5 OTEL diagnostics ⚠️ unverified No api-proxy-logs/otel.jsonl in the local sandbox path. That is expected in OTLP collector mode. Local files do not prove collector delivery, and no backend span evidence was checked.
6 File fallback ✅ uses FileSpanExporter when no OTLP config at all passed. It asserts tracing stays enabled and targets /var/log/api-proxy/otel.jsonl.

Scenario 5 is not a failure. Collector delivery needs backend span evidence before it can be reported as confirmed.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test

  • Warn when --env-all discards host TMPDIR
  • Preserve Runtime Doctor denial receipts and escalate evidence blockers
  • Merged PRs review: ✅
  • PR details read: ✅
  • Browser precheck acknowledged: ✅
  • File write/read: ✅
  • Discussion lookup/comment: ❌
  • Build (npm ci && npm run build): ✅
  • Overall status: FAIL

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

@rabeckett

Copy link
Copy Markdown
Collaborator Author

Triage note: the non-required \Smoke Codex\ conclusion failure (https://github.com/github/gh-aw-firewall/actions/runs/46055864586) is an inherited issue already tracked in #12211 and unrelated to this PR (which only touches .github/workflows/test-model-routing.yml\ and \scripts/ci/assert-model-routing-selection.*). All 19 required checks and Copilot code review are green on \73429c0c1c25e09bf18e1090a8e9d7a3b664864c.

@rabeckett
rabeckett merged commit b9c43c7 into main Nov 27, 2026
239 of 241 checks passed
@rabeckett
rabeckett deleted the ci/live-fallback-smoke branch November 27, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model-routing Model routing selection, compatibility, and diagnostics needs-review ready-for-aw smoke-claude smoke-cloud-hypervisor smoke-copilot smoke-copilot-network-isolation Copilot network-isolation egress smoke test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a live router-fallback smoke check to the model routing workflow

2 participants