Skip to content

audit: make model_downgrade_available routing-aware - #77206

Merged
SivaKesava1 merged 4 commits into
mainfrom
copilot/audit-make-smaller-model-recommendations-routing-a
Nov 13, 2026
Merged

SivaKesava1 merged 4 commits into
mainfrom
copilot/audit-make-smaller-model-recommendations-routing-a

Conversation

Copilot AI commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

gh aw audit gave every qualifying triage, maintenance or issue-response run the same advice: set engine.model: gpt-4.1-mini or claude-haiku-4-5. Runs already routed at economy got this advice too. Following it swaps per-task routing for a fixed model. This PR keys the assessment off the run's routing evidence and recommends routing instead of a specific model.

Behavior

The domain, resource-profile and actuation conditions are unchanged. So are the kind, the low severity and the finding code agentic_model_downgrade_available. Within those conditions:

Routing evidence Result
Selected route with mode: economy, including an auto objective resolved to economy No assessment, finding or recommendation
Selected route with mode: balanced or robust Says the run was already routed and suggests model: router/economy
Missing, unreadable, incomplete, failed, unknown or unresolved auto mode, or outcome-only Neutral: suggests top-level model: router/economy; omitting the model is offered only for workflows eligible for default routing; links the Model Routing docs

No case names a concrete model or engine.model, and the neutral wording never claims routing was off.

Implementation

  • appendModelDowngradeAssessment now takes processedRun.ModelRouting. Both the audit and logs paths already fill this field from analyzeModelRouting before building assessments, so there is no new parsing, field or artifact read.

  • New confirmedModelRoutingLevel returns a level only when all of these hold:

    • Status == "selected"
    • Failure == nil
    • a selected model or ID is present
    • Mode is economy, balanced or robust

    The level never comes from a model name, price, workflow name or the requested ObjectiveMode.

  • The finding's impact text now refers to economy routing instead of "a smaller model". The title "Cheaper Model Available" is unchanged.

  • Updated the agentic_model_downgrade_available row in reference/audit.md.

Tests (pkg/cli/audit_agentic_analysis_test.go)

Case Coverage
A, unrouted TestModelDowngradeAssessmentIsRoutingAware/A_*; updated TestBuildAgenticAssessmentsFlagsModelDowngrade
B, above economy .../B_*: balanced and robust with an auto objective, plus an explicit balanced objective
C, already economy .../C_*: the checked-in copilot-routed-gpt-responses fixture, plus an explicit economy objective. TestModelDowngradeEconomyRouteSuppressesFinding checks that no finding or recommendation is generated
D, ambiguous .../D_*: missing, unreadable, wrong schema, no mode, unknown mode, unresolved auto, no selected model, failed route, outcome-only session. Each must match A's text exactly

B and D parse temporary copies of the fixture with only existing fields changed. The checked-in fixture is not modified.

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Copilot AI changed the title [WIP] Make smaller-model recommendations routing-aware audit: make model_downgrade_available routing-aware Nov 12, 2026
Copilot AI requested a review from SivaKesava1 November 12, 2026 18:57
@SivaKesava1
SivaKesava1 marked this pull request as ready for review November 12, 2026 19:04
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 19:04
@github-actions

Copy link
Copy Markdown
Contributor

🔬 Test Quality Sentinel is analyzing test quality on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

✂️ Ponytail Reviewer has started processing this pull request

@github-actions

Copy link
Copy Markdown
Contributor

🚀 PR Specification Reviewer has started processing this pull request

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

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.

🟡 Changes recommended

The model-selection guidance can produce rejected configurations or leave selection unchanged when existing engine settings conflict, so both recommendations need explicit migration instructions.

1 open issue
What changed in this PR

This PR makes audit’s model-cost guidance routing-aware, using existing run evidence to recommend economy routing instead of fixed models.

Changes:

  • Suppresses downgrade advice for confirmed economy routes and tailors guidance for higher routing levels.
  • Adds tests for selected, missing, failed, and ambiguous routing evidence.
  • Updates the audit reference to describe routing-aware recommendations.
File Description
pkg/​cli/​audit_agentic_analysis.go Uses routing evidence to control downgrade assessments and recommendations.
pkg/​cli/​audit_agentic_analysis_test.go Covers routing-aware advice and economy-route suppression.
docs/​src/​content/​docs/​reference/​audit.md Documents the revised downgrade finding behavior.

Review effort: Balanced (auto)

Comment thread pkg/cli/audit_agentic_analysis.go Resolved
…economy

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
…odel downgrade

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Triage

  • Category: bug
  • Risk: medium
  • Total score: 62 (impact 32 + urgency 18 + quality 12)
  • Recommended action: batch_review
  • Reason: routing-aware audit recommendation fix with clear user impact and a compact test matrix; suitable for a focused batch review.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~4 AIC · ⌖ ~2 AIC · ⊞ 15.9K · ◷

@SivaKesava1
SivaKesava1 merged commit 8492976 into main Nov 13, 2026
49 checks passed
@SivaKesava1
SivaKesava1 deleted the copilot/audit-make-smaller-model-recommendations-routing-a branch November 13, 2026 03:15
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

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.

audit: make smaller-model recommendations routing-aware

3 participants