Repository navigation
ci(router): add live router-fallback smoke check - #12234
Conversation
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>
|
🚀 Security Guard has started processing this pull request |
There was a problem hiding this comment.
🔵 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)
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.
|
|
🔌 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 happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error.
|
|
✅ 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 happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
🚀 Security Guard has started processing this pull request |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
|
✅ Smoke Claude passed
|
|
✅ 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 happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error.
|
|
🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request... |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. Smoke ChrootOutcome: 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.
|
|
Smoke Test: Copilot Engine, PR #12234 (@rabeckett)
Overall: PASS
|
|
Cloud Hypervisor + Copilot smoke test
Overall: PASS
|
Smoke Test: Copilot Network Isolation ✅ PASSBoth egress checks passed successfully:
EGRESS_RESULT allow=pass deny=pass The firewall is correctly enforcing network isolation—whitelisted domains are accessible while non-whitelisted domains are blocked.
|
Smoke Claude Results
Overall result: PASS
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe 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
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Smoke Test: Copilot BYOK (Direct) Mode ✅
Status: PASS
|
Chroot version comparison
Result: Python and Node.js match. Go could not report a version inside the chroot, so the overall run did not pass. The
|
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Environment workarounds (not test failures):
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "169.254.169.254"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry TracingLocal validation: ✅ all scenarios passed. Collector delivery:
Scenario 5 is not a failure. Collector delivery needs backend span evidence before it can be reported as confirmed.
|
Smoke Test
|
|
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. |
Fixes #12230
Extends
.github/workflows/test-model-routing.ymlwith a live router-fallback smoke check against the locally builtapi-proxyandrouterimages 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
Run a fallback Copilot inference through AWFstep that restrictsapiProxy.allowedModelstogithub-copilot/claude-haiku-4.5(already exercised on the CI Copilot account in the cross-endpoint step, absent from all bundledcontainers/router/routing/*.jsontables, and mapped tolightweightincoding-tiers.json). Inside the container, the step reads/reflect, checksrouting.status === "selected"withwire_model === "claude-haiku-4.5",effort === null, andendpoint === "/chat/completions", and sends a live completion request expectingFALLBACK_OK.--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 inlineselection_source === "router"assertions in the multi-candidate audit step.scripts/ci/assert-model-routing-selection.cjs) and unit tests (scripts/ci/assert-model-routing-selection.test.ts) that verifymodel-routing.jsonlprovenance, no prompt leakage, no routing failure records, and workflow YAML/Bash syntax.containers/api-proxy/automatic-model-eligibility.js,containers/api-proxy/model-information.coding-tiers.generated.json, andscripts/ci/assert-model-routing-selection.cjstoon.push.pathsin.github/workflows/test-model-routing.yml.Concrete example
When the fallback step completes, the preserved per-run
model-routing.jsonlselection 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:
Validation
Validated on Linux (Node 22) against head
73429c0c1c25e09bf18e1090a8e9d7a3b664864c:checkssuite (type-check,build,lint,schema-generation,schema-parity): PASSscripts/ci/assert-model-routing-selection.test.tsandscripts/ci/reproducible-npm-installs.test.ts, includingbash -non every workflow step and realrecordSelection+writeRoutingRecordpersistence): 26/26 PASS