Skip to content

ci: enable model router for failure-prone and high-burn workflows - #11918

Merged
lpcox merged 3 commits into
mainfrom
enable-model-router-gh-aw-v1.3.1
Nov 21, 2026
Merged

lpcox merged 3 commits into
mainfrom
enable-model-router-gh-aw-v1.3.1

Conversation

@lpcox

@lpcox lpcox commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Turns on the gh-aw model router (model: router, gh-aw v1.3.1) for the 12 Copilot workflows that fail most often (mainly engine timeouts) or burn the most AI credits.

Routed workflows: auth-doctor-updater, claude-token-optimizer, config-consistency-auditor, copilot-token-optimizer, copilot-token-usage-analyzer, dependency-security-monitor, duplicate-code-detector, issue-duplication-detector, pelis-agent-factory-advisor, refactoring-scanner, security-guard, security-review.

Each lock now sets GH_AW_MODEL_ROUTING_ENABLED: "true" and experimental.modelRouting: true, and pins the AWF router image.

Notes for reviewers

  • Overrides fix: use auto for Copilot workflow models #10854 for 4 workflows: copilot-token-usage-analyzer, duplicate-code-detector, pelis-agent-factory-advisor and security-guard move from model: auto to model: router.
  • Short usage window: credit-burn ranking used only ~4 days of usage data. Failure rates use 30 days.
  • pelis-agent-factory-advisor is still limited by max-turns: 4. Routing lowers cost but won't fix turn-limit failures.

Test updates

  • copilot-auto-model-workflows.test.ts: removes the 4 routed workflows from the auto list and adds router assertions for all 12.
  • refactoring-scanner-workflow.test.ts: routed locks pin per-image tags under container.images instead of a shared imageTag. The test checks that each pin matches the installed AWF version.
  • security-guard, pelis and duplicate-code-detector tests now expect router.

Locally, npx jest scripts/ci shows the same 243 environment-specific failures as unmodified main on macOS, with no new failures.

Set `model: router` on 12 Copilot workflows selected for high failure
rates (engine timeouts) or high AI-credit burn, recompile on gh-aw
v1.3.1, and update CI tests for router output.

Co-authored-by: Copilot App <[email protected]>
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 18:57

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

Mandatory routing changes model overrides and model/effort selection across security and maintenance workflows, requiring broader review of router availability, execution budgets, and task-quality tradeoffs.

No open issues 🎉

What changed in this PR

Enables explicit model routing for 12 failure-prone or high-credit-use Copilot workflows in AWF’s repository automation. This replaces auto for four workflows migrated in #10854 while preserving existing turn limits.

Changes:

  • Sets model: router and updates compiled workflows to enable routing unconditionally.
  • Adds routing configuration, model reporting, and diagnostic artifacts where needed.
  • Updates regression checks for routing, image-version consistency, install-script controls, and token exclusion.
File Description
scripts/​ci/​workflow-engine-install-security.test.ts Recognizes environment-based install-script suppression.
scripts/​ci/​test-coverage-reporter-workflow.test.ts Checks compiled author-file metadata.
scripts/​ci/​smoke-enclave-workflow.test.ts Strengthens GH_TOKEN exclusion checks.
scripts/​ci/​security-guard-workflow.test.ts Expects routing while preserving security checks and turn limits.
scripts/​ci/​refactoring-scanner-workflow.test.ts Validates per-image tags against the installed AWF version.
scripts/​ci/​pelis-agent-factory-advisor-workflow.test.ts Checks routing and the four-turn budget.
scripts/​ci/​duplicate-code-detector-workflow.test.ts Changes the expected model selector to router.
scripts/​ci/​copilot-auto-model-workflows.test.ts Adds routing assertions for all 12 workflows.
.github/​workflows/​security-review.md Enables explicit routing.
.github/​workflows/​security-review.lock.yml Makes routing configuration and reporting unconditional.
.github/​workflows/​security-guard.md Replaces auto with router.
.github/​workflows/​refactoring-scanner.md Enables explicit routing.
.github/​workflows/​refactoring-scanner.lock.yml Makes routing unconditional and retains per-image pins.
.github/​workflows/​pelis-agent-factory-advisor.md Replaces auto with router.
.github/​workflows/​issue-duplication-detector.md Enables explicit routing.
.github/​workflows/​issue-duplication-detector.lock.yml Removes conditional routing selection.
.github/​workflows/​duplicate-code-detector.md Replaces auto with router.
.github/​workflows/​duplicate-code-detector.lock.yml Adds router setup, model reporting, and diagnostic artifacts.
.github/​workflows/​dependency-security-monitor.md Enables explicit routing.
.github/​workflows/​dependency-security-monitor.lock.yml Makes routing configuration and reporting unconditional.
.github/​workflows/​copilot-token-usage-analyzer.md Replaces auto with router.
.github/​workflows/​copilot-token-optimizer.md Enables explicit routing.
.github/​workflows/​copilot-token-optimizer.lock.yml Removes conditional routing selection.
.github/​workflows/​config-consistency-auditor.md Enables explicit routing.
.github/​workflows/​config-consistency-auditor.lock.yml Makes routing configuration and reporting unconditional.
.github/​workflows/​claude-token-optimizer.md Enables routing for its Copilot engine.
.github/​workflows/​claude-token-optimizer.lock.yml Removes conditional routing selection.
.github/​workflows/​auth-doctor-updater.md Enables explicit routing.
.github/​workflows/​auth-doctor-updater.lock.yml Makes routing unconditional and retains per-image pins.

Review effort: Balanced (adaptive)

…est'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@lpcox

lpcox commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/44941466040/job/136959378609?pr=11918

The job failed because /tmp/gh-aw was not writable by the runner. The preceding run passed and the intervening commit does not affect chroot; I requested a retry, which is currently queued. The logs do not establish what created the directory, and local reproduction was blocked by registry DNS failure.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Testing chroot feature Smoke Chroot is validating functionality...

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

--build-local recompiled Squid from source (~575s) and exhausted the
600s test timeout. The build-images job already builds the patched
Squid image from this tree, so use it with --skip-pull instead.

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

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

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

Smoke Codex

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.

🔮 The oracle has spoken through Smoke Codex

@github-actions

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

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

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

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Smoke OTel Tracing

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.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Nov 21, 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 21, 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 21, 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 #11918 · copilot · routed: haiku55 xhigh · ~4 AIC · ⊞ 6.1K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine (trigger: pull_request)

Overall status: PASS

cc @lpcox (author). No assignees.

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

@github-actions

Copy link
Copy Markdown
Contributor
  • Meter GitHub API point budgets per HTTP request ✅
  • Bound security-review evidence and clarify completion criteria ✅
  • PR detail lookup ✅
  • Playwright title check ❌
  • Temp file write/read ✅
  • Build (npm ci && npm run build) ✅
  • Discussion comment ✅
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
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

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing: scenario results

# Scenario Result Details
1 Module loading ✅ otel.js loads. isEnabled() is true (init is unconditional; with no endpoint it falls back to the file exporter). Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, routerCallTracing, shutdown, isEnabled, plus _ internals. Start/end/shutdown run cleanly with no config.
2 Test suite ✅ 75/75 passed across 3 suites (otel, otel-fanout, otel-workload-identity). Caveat: the workflow's --testPathPattern flag is rejected by the installed Jest, and || true hides the failure, so CI runs zero tests. Passing with --testPathPatterns locally.
3 Env var forwarding ✅ All 6 checks pass: GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID in env-passthrough.ts and api-proxy-env-config.ts; GH_AW_OTLP_ENDPOINTS and OTEL_EXPORTER_OTLP_ENDPOINT in api-proxy-env-config.ts.
4 Token tracker integration ✅ onUsage hook present in token-tracker-http.js (invoked at ~line 476).
5 OTEL diagnostics ⚠️ /tmp/gh-aw/otel.jsonl has 1 span (gh-aw.agent.setup, parent b338e4d17d5a1cf6). No api-proxy request spans were seen. The post-step checks /tmp/gh-aw/sandbox/firewall/logs/api-proxy/otel.jsonl, which doesn't exist, so it reports "not found". The real api-proxy log dir comes from src/log-paths.ts. This is a diagnostics path mismatch, not an exporter failure.

Overall: the OTEL integration points validate. Two smoke-workflow defects need follow-up: the outdated Jest flag (--testPathPattern → --testPathPatterns) masked by || true, and the diagnostics path in the post-step.

📡 OTel tracing validated by Smoke OTel Tracing

📡 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 ✅

Both egress checks passed successfully:

Check Status Details
Allow Check ✅ PASS HTTP 200 from api.github.com/zen (allowlisted domain accessible)
Deny Check ✅ PASS SSL certificate rejection from example.com (non-allowlisted domain blocked)

Overall Result: PASS

The firewall correctly:

  • Allowed traffic to whitelisted domain (api.github.com)
  • Blocked traffic to non-whitelisted domain (example.com) with SNI guard interception
EGRESS_RESULT allow=pass deny=pass

🛡️ Egress verdict from Smoke Copilot Network Isolation
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) ✅ PASS

Test Result
GitHub MCP ✅ PR #11915, #11911 fetched
GitHub.com Connectivity ✅ HTTP 200
File Write/Read ✅ smoke-test-copilot-byok.txt exists
BYOK Inference ✅ Direct mode via api-proxy → api.githubcopilot.com

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy sidecar → api.githubcopilot.com with credential isolation.

🔑 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 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: not all tests passed (ALL_TESTS_PASSED=false). The Node.js version inside the chroot differs from the host, so the smoke-chroot label was not applied.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
GitHub check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #11918 · 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 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

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 ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ 1/1 pkgs ok ✅ PASS
Go env ✅ 1/1 pkgs ok ✅ PASS
Go uuid ✅ 1/1 pkgs ok ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS
Java caffeine ✅ 1/1 passed ✅ PASS
Node.js clsx ✅ Script passed ✅ PASS
Node.js execa ✅ Script passed ✅ PASS
Node.js p-limit ✅ Script passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

All eight repositories cloned successfully. Node.js test scripts print only "All tests passed!", so no per-test counts are available for them.

Runner setup workarounds (test results unaffected):

  • .NET: the default /run/user/1001 runtime dir does not exist on the runner, so XDG_RUNTIME_DIR was pointed at a private temp directory.
  • Java: ~/.m2 is root-owned, so Maven used a temp -Dmaven.repo.local. The JDK cacerts symlink is dangling, so Maven used a temporary truststore built from the system CA bundle via MAVEN_OPTS.

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 #11918 · copilot · routed: haiku55 xhigh · ~4 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@lpcox
lpcox merged commit cc1f797 into main Nov 21, 2026
138 of 139 checks passed
@lpcox
lpcox deleted the enable-model-router-gh-aw-v1.3.1 branch November 21, 2026 22:31
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.

4 participants