Skip to content

Route four Claude Code analysis workflows through Copilot model routing (economy) - #75471

Merged
SivaKesava1 merged 4 commits into
mainfrom
copilot/route-claude-code-workflows
Nov 6, 2026
Merged

SivaKesava1 merged 4 commits into
mainfrom
copilot/route-claude-code-workflows

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Four Claude Code analysis workflows currently use claude-sonnet-5 through Anthropic, which costs about 2,300 AIC/week. This PR routes them through Copilot model routing with economy, following #74666. The runtime engine stays Claude Code.

Workflow changes

The four workflows are daily-aw-cross-repo-compile-check, daily-grader-audit, prompt-clustering-analysis and example-workflow-analyzer. Each one gets:

  • copilot-requests: write added to permissions. The other permissions are unchanged.
  • This engine configuration:
engine:
  id: claude
  model-provider: github
  model-routing:
    goal: cost
    mode: economy

How each engine config was changed:

  • prompt-clustering-analysis and example-workflow-analyzer: the engine: claude shorthand is replaced with the block above.
  • daily-aw-cross-repo-compile-check and daily-grader-audit: the existing blocks are extended. daily-grader-audit keeps its mcp.tool-timeout: 10m.

There are no model pins, allowed-models or other model restrictions. Prompts, steps, triggers, imports and safe outputs are unchanged.

Lock files

Only these four are recompiled. Each lock diff:

  • turns routing on (candidate_models: ["github-copilot/claude-*"]);
  • sets experimental.modelRouting: true in the AWF config;
  • adds the "Prepare model-routing conversation" step and the gh-aw-firewall/router image;
  • sets COPILOT_GITHUB_TOKEN: ${{ github.token }}, points ANTHROPIC_BASE_URL at the API proxy and uses a placeholder BYOK key;
  • removes all secrets.ANTHROPIC_API_KEY references and the ANTHROPIC_API_KEY validation step;
  • adds the routed-model and effort outputs used by the audit and conclusion steps.

Before merging

  • Test-run each workflow on this branch. All four have workflow_dispatch. For each run, record the routed model, effort, AIC/run, and whether the issue or report was produced.

  • Drop any workflow that picks claude-opus-5.5 and costs more than its baseline:

    Workflow Baseline AIC/run
    daily-aw-cross-repo-compile-check ~164
    daily-grader-audit ~102
    prompt-clustering-analysis ~89
    example-workflow-analyzer ~143

    For analysis prompts, economy often ranks Opus first. Three workflows routed in earlier batches cost 21–77% more because of this.

  • Don't blame routing for prompt-clustering-analysis's existing failures. Before this PR it failed in Download workflow logs for PR analysis (data fetch) and Upload Safe Outputs Assets (asset publication).

…ng (economy)

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Copilot AI changed the title [WIP] Route four Claude Code analysis workflows through Copilot model routing Route four Claude Code analysis workflows through Copilot model routing (economy) Nov 6, 2026
Copilot AI requested a review from SivaKesava1 November 6, 2026 19:16
@SivaKesava1
SivaKesava1 marked this pull request as ready for review November 6, 2026 19:41
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 19:41
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

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

Generated from Ponytail Reviewer · routed: gpt56 max · ~2 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #75471

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

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

Generated from Design Decision Gate 🏗️ · routed: opus55 medium · ~11 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

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

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

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

Generated from PR Specification Reviewer · gpt56 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75471

@github-actions github-actions Bot 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.

No additional actionable correctness issues found in the changed workflow frontmatter. The existing security concern on the generated routing conversation remains the relevant review item; the specialist pass was unavailable because its file-read invocation was denied, so this review is based on the provided diff and repository files.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

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

Missing PR-branch runtime evidence for all four workflows leaves model/effort routing, AIC against rollback baselines, and report output unverified, particularly given economy routing’s potential to increase costs.

No open issues 🎉

What changed in this PR

Extends the Copilot model-routing rollout from #74666 to four gh-aw analysis workflows, aiming to reduce inference costs while retaining Claude Code as the agent runtime.

Changes:

  • Adds copilot-requests: write and GitHub-backed routing with goal: cost and mode: economy.
  • Preserves prompts, triggers, safe outputs, and existing engine settings, including the grader audit’s MCP timeout.
  • Updates the supplied generated locks with router setup, GitHub-token authentication, routed-model metadata, and Copilot-based threat detection.
File Description
.github/​workflows/​prompt-clustering-analysis.md Enables economy routing for prompt analysis.
.github/​workflows/​example-workflow-analyzer.md Enables economy routing for weekly workflow analysis.
.github/​workflows/​example-workflow-analyzer.lock.yml Updates generated routing, authentication, detection, and reporting.
.github/​workflows/​daily-grader-audit.md Enables economy routing while preserving the MCP timeout.
.github/​workflows/​daily-grader-audit.lock.yml Updates generated routing, detection, metadata, and evaluation credentials.
.github/​workflows/​daily-aw-cross-repo-compile-check.md Enables economy routing for cross-repository compile checks.
.github/​workflows/​daily-aw-cross-repo-compile-check.lock.yml Updates generated routing, detection, metadata, and evaluation credentials.

Review effort: Balanced (auto)

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /codebase-design (shared config drift) and a cost-guard check. The routing switch is correct and the committed locks are consistent. Two non-blocking suggestions are posted inline.

📋 Verification and findings

Verified

  • Recompiled all four workflows from HEAD (4b304bb) with the gh-aw compiler. Each lock matches the committed file except for the cron scatter value, which varies by repo.
  • Each lock has COPILOT_GITHUB_TOKEN, a github-copilot/claude-* candidate list, modelRouting, and the Prepare model-routing conversation step. No secrets.ANTHROPIC_API_KEY references remain.
  • copilot-requests: write is set on all four. Other permissions are unchanged. daily-grader-audit keeps mcp.tool-timeout: 10m.

Findings

  • Cost guard (inline): example-workflow-analyzer and prompt-clustering-analysis have no max-ai-credits. daily-aw-cross-repo-compile-check has only max-daily-ai-credits. The PR body says economy can route to Opus, so a per-run cap would bound the downside.
  • Duplicated routing block (inline): the same engine block is copied into four files.

Open bot comment (out of scope for this PR)

The github-advanced-security comment on example-workflow-analyzer.lock.yml:1136 flags the routing conversation step. That step is generated by pkg/workflow/model_routing.go (generateModelRoutingConversationStep), so it applies to all 40 routed workflows, not just this PR. Fixing it belongs in the generator, not in these four lock files.

Uncertainty

The local working tree differs from HEAD for these files. I reviewed the committed state only. I did not run the workflows, so routed model and AIC/run are unverified. The PR test-run plan covers that.

@copilot please address the inline review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (.github/workflows/example-workflow-analyzer.md:19): Economy routing can pick Opus, and the PR body reports that costs more than baseline. This workflow has no per-run max-ai-credits cap and no max-daily-ai-credits cap, so one expensive routed run is uncapped. Add a per-run cap sized from its baseline AIC/run. - Route four Claude Code analysis workflows through Copilot model routing (economy) #75471 (comment)
  3. Review (.github/workflows/daily-aw-cross-repo-compile-check.md:23): [/codebase-design] The same four-line model-routing block is now copied into each of the four workflows, so the routing policy can drift per file. - Route four Claude Code analysis workflows through Copilot model routing (economy) #75471 (comment)

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 4b304bb
Sous-chef requested-work: 319927d3f0358ba9ad1797fd15b0056ae054ea41832927aca02a5065b1fba696 441540389b186acfc1f10b496322e7cd995edabf1d7da01847f207da3f1ca6ab
Sous-chef requested-state: 1316c78092ab63074acd545373a2f7b73f6222c8fec779549af2136e9e8a0b98

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~7 AIC · ⌖ ~13 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits November 6, 2026 21:29
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot November 6, 2026 21:48
@SivaKesava1
SivaKesava1 merged commit 97cb0d6 into main Nov 6, 2026
77 checks passed
@SivaKesava1
SivaKesava1 deleted the copilot/route-claude-code-workflows branch November 6, 2026 21:57
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route four remaining Claude Code analysis workflows through Copilot model routing (economy)

5 participants