Skip to content

Route Sergo with balanced cost model routing on Copilot - #74204

Merged
SivaKesava1 merged 5 commits into
mainfrom
copilot/model-routing-route-sergo
Nov 3, 2026
Merged

SivaKesava1 merged 5 commits into
mainfrom
copilot/model-routing-route-sergo

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Sergo runs on a pinned claude-sonnet-5 billed to the Anthropic key. This PR switches it to cost-based model routing in balanced mode, with Claude billed through Copilot. The issue estimates this saves about 650–1,070 AIC/week. It uses balanced rather than economy because Sergo opens Go-fix PRs with the Serena language server.

Workflow source (.github/workflows/sergo.md)

engine:
  id: claude
  model-provider: github
  model-routing:
    goal: cost
    mode: balanced
  • The prompt, Serena tools, evals, safe outputs and triggers are unchanged.
  • No model pin, and no allowed or blocked model lists.

Generated lock (.github/workflows/sergo.lock.yml)

  • Routing on: routing is enabled with goal: cost, mode: balanced, and candidates limited to github-copilot/claude-*. The firewall (AWF) config turns on model routing and points the router at the prepared conversation file.
  • New step and image: adds a "Prepare model-routing conversation" step and pins ghcr.io/github/gh-aw-firewall/router:0.29.5@sha256:a3cc3d….
  • Credentials:
    • The lock no longer references secrets.ANTHROPIC_API_KEY. COPILOT_GITHUB_TOKEN is validated and passed instead.
    • Claude calls go to the firewall's API proxy via ANTHROPIC_BASE_URL, using a dummy key; the proxy authenticates to Copilot with COPILOT_GITHUB_TOKEN.
    • The allowed engine API hosts are now the Copilot endpoints.
  • Model outputs: the agent no longer defaults to claude-sonnet-5. It now reports the routed model, model_effort and model_routing_status to later jobs.
  • Threat detection: runs on the Copilot CLI with its default model (detection, falling back to auto) instead of Claude claude-sonnet-5.

Follow-up (not in this PR)

The issue's "Check" section comes after merge. Audit the first routed runs with gh aw audit against the ~205 AIC/run baseline. Check Serena tool use, fix correctness, test results and how useful the opened PRs are.

Test failures not caused by this PR

  • TestDoctorTokensRepositoryRegression (pkg/cli) also fails with this change removed.
  • TestDownloadWorkflowLogsForTargetsConcurrentAndResilient and …UsesOneWallClockTimeout are timing checks. They failed in the full parallel run but passed when run alone.

None of these three is on the list of failures already known on main.

Copilot AI linked an issue Nov 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update model routing for Sergo in workflow Route Sergo with balanced cost model routing on Copilot Nov 2, 2026
Copilot AI requested a review from SivaKesava1 November 2, 2026 19:05
Comment thread .github/workflows/sergo.md Resolved
Comment thread .github/workflows/sergo.lock.yml Resolved
@SivaKesava1
SivaKesava1 marked this pull request as ready for review November 2, 2026 19:29
Copilot AI adaptive review requested due to automatic review settings November 2, 2026 19:29
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

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 · sonnet50 · ~13 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 2, 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 · gpt56 · ~6 AIC · ⌖ ~6 AIC · ⊞ 15.2K · ◷

Generated by Ponytail Reviewer for #74204

@github-actions

github-actions Bot commented Nov 2, 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: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer failed during the skills-based review.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

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

@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.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Review: no new blocking findings

The changed workflow configuration is internally consistent with the stated routing migration. I found no additional actionable issue beyond the existing prompt-injection concerns already raised on the changed source and generated lock. The specialist pass completed; its remaining observations were about review visibility/verification limits rather than defects in the changed lines.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⊞ 1.7K
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.

🟢 Approval recommended

No active review issues are recorded for the update to balanced, cost-based Claude routing through Copilot.

No open issues 🎉

What changed in this PR

Updates Sergo’s Go-analysis and fix workflow to use balanced, cost-based Claude routing through Copilot, implementing #74191. The prompt, Serena tools, evals, safe outputs, and triggers remain unchanged.

Changes:

  • Replace the fixed model configuration with GitHub-backed Claude routing using goal: cost and mode: balanced.
  • Regenerate the lock file with Copilot authentication, router setup, and routed-model metadata.
  • Switch threat detection to the Copilot CLI and its default detection model.
File Description
.github/​workflows/​sergo.md Enables balanced cost routing through the GitHub provider without pinning a model.
.github/​workflows/​sergo.lock.yml Adds generated routing infrastructure, Copilot credentials, model reporting, and Copilot-based threat detection.

Review effort: Max (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.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Skills-Based Review 🧠

Applied /codebase-design — requesting changes because the routed candidate family is broader than Claude Code's supported-effort contract.

📋 Key theme

The generated github-copilot/claude-* pool includes Haiku, while the repository's Claude-on-Copilot smoke workflow documents that Haiku cannot accept the reasoning effort Claude Code sends. Targeted model-routing tests pass, but they do not cover this workflow-specific wildcard candidate set or the runtime incompatibility.

@copilot please address the inline comment above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routing failed · ~18 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread .github/workflows/sergo.md Resolved
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Note

The pull request was not created — a fallback review issue was created instead due to protected file changes: #74228

PR Finisher

  • Branch was 3 commits behind main; merged origin/main locally (no conflicts) — submitted for publication, not confirmed pushed.
  • Lock files recompile in sync; make agent-report-progress passed.
  • No unresolved in-scope review threads needed code changes (the haiku-4.5 candidate concern was already answered by a maintainer).
  • Remaining: CI is stale after the push and needs a maintainer re-trigger; earlier agent/conclusion failures show threat-detection engine errors that were not caused by this change.

Sous-chef head: bfc2676
Sous-chef work: merge-main
Sous-chef state: e21f9ecfbc7d0df2eea7bfcf1b9a6736f0d45aebc352ee958ba5aa6291639f77

Generated by 🏁 PR Finisher · copilot · auto · ~15 AIC · ⌖ ~1 AIC · ⊞ 10.5K · ◷

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

PR finisher dispatch 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. Fix failing check agent (FAILURE): https://github.com/github/gh-aw/actions/runs/41514103313/job/125534493940.
  3. Fix failing check agent (FAILURE): https://github.com/github/gh-aw/actions/runs/41510408550/job/125502372208.
  4. Fix failing check conclusion (FAILURE): https://github.com/github/gh-aw/actions/runs/41514103313/job/125538255034.

The dedicated pr-finisher workflow will apply the necessary fixes, 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 trigger CI.

Sous-chef head: bfc2676
Sous-chef work:
Sous-chef state: e21f9ecfbc7d0df2eea7bfcf1b9a6736f0d45aebc352ee958ba5aa6291639f77

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

Comment thread .github/workflows/sergo.lock.yml Resolved
…-route-sergo

# Conflicts:
#	.github/workflows/sergo.lock.yml

Co-authored-by: SivaKesava1 <[email protected]>
Comment thread .github/workflows/sergo.lock.yml Resolved
Comment thread .github/workflows/sergo.md Resolved
@SivaKesava1
SivaKesava1 dismissed github-actions[bot]’s stale review November 3, 2026 00:21

Points answered in the threads: Haiku 4.5 is never a top Claude choice in the current tables; prompt injection is latent (static prompt) and cost-only. Gate run 41549681735 with copilot-requests: write completed (fix PR + report).

@SivaKesava1
SivaKesava1 merged commit 98679b2 into main Nov 3, 2026
41 checks passed
@SivaKesava1
SivaKesava1 deleted the copilot/model-routing-route-sergo branch November 3, 2026 00:21
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

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.

Model routing: route Sergo

5 participants