Repository navigation
audit: make model_downgrade_available routing-aware - #77206
SivaKesava1 merged 4 commits into
Conversation
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
model_downgrade_available routing-aware
|
🔬 Test Quality Sentinel is analyzing test quality on this pull request... |
|
✂️ Ponytail Reviewer has started processing this pull request |
|
🚀 PR Specification Reviewer has started processing this pull request |
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
There was a problem hiding this comment.
🟡 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)
…economy Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
…odel downgrade Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Triage
|
|
🎉 This pull request is included in a new release. Release: |

gh aw auditgave every qualifying triage, maintenance or issue-response run the same advice: setengine.model: gpt-4.1-miniorclaude-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
lowseverity and the finding codeagentic_model_downgrade_available. Within those conditions:mode: economy, including anautoobjective resolved to economymode: balancedorrobustmodel: router/economyautomode, or outcome-onlymodel: router/economy; omitting the model is offered only for workflows eligible for default routing; links the Model Routing docsNo case names a concrete model or
engine.model, and the neutral wording never claims routing was off.Implementation
appendModelDowngradeAssessmentnow takesprocessedRun.ModelRouting. Both the audit and logs paths already fill this field fromanalyzeModelRoutingbefore building assessments, so there is no new parsing, field or artifact read.New
confirmedModelRoutingLevelreturns a level only when all of these hold:Status == "selected"Failure == nilModeiseconomy,balancedorrobustThe 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_availablerow inreference/audit.md.Tests (
pkg/cli/audit_agentic_analysis_test.go)TestModelDowngradeAssessmentIsRoutingAware/A_*; updatedTestBuildAgenticAssessmentsFlagsModelDowngrade.../B_*:balancedandrobustwith anautoobjective, plus an explicitbalancedobjective.../C_*: the checked-incopilot-routed-gpt-responsesfixture, plus an explicit economy objective.TestModelDowngradeEconomyRouteSuppressesFindingchecks that no finding or recommendation is generated.../D_*: missing, unreadable, wrong schema, no mode, unknown mode, unresolvedauto, no selected model, failed route, outcome-only session. Each must match A's text exactlyB and D parse temporary copies of the fixture with only existing fields changed. The checked-in fixture is not modified.