Stabilize smoke-copilot-auto lock output by skipping dynamic auto pricing injection - #48516
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
smoke-copilot-auto lock output by skipping dynamic auto pricing injection
|
@copilot remove dynamic pricing lookup all together |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ PR Code Quality Reviewer completed the code quality review. |
There was a problem hiding this comment.
Pull request overview
Stabilizes model: auto compilation, but also broadly removes external pricing resolution and its CLI control.
Changes:
- Skips pricing lookup for
autoaliases and adds tests. - Removes models.dev resolver registration and
--no-models-dev-lookup. - Recompiles the Copilot auto smoke-test lock file.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_model_pricing.go |
Adds dynamic alias guard. |
pkg/workflow/compiler_model_pricing_test.go |
Tests auto alias handling. |
pkg/cli/model_costs.go |
Removes external pricing resolver. |
pkg/cli/model_costs_test.go |
Removes resolver coverage. |
pkg/cli/compile_config.go |
Removes lookup configuration. |
pkg/cli/compile_compiler_setup.go |
Stops registering the resolver. |
pkg/cli/compile_compiler_setup_test.go |
Expects no default resolver. |
pkg/cli/cli_consistency_help_test.go |
Expects the removed flag to be undocumented. |
docs/src/content/docs/setup/cli.md |
Removes the flag from CLI documentation. |
cmd/gh-aw/main.go |
Removes flag registration and plumbing. |
cmd/gh-aw/compile_flags_test.go |
Removes flag coverage. |
.github/workflows/smoke-copilot-auto.lock.yml |
Removes dynamic pricing overlay. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Medium
| compiler := createAndConfigureCompiler(CompileConfig{DisableModelsDevLookup: true}) | ||
| if hasModelPricingResolver(compiler) { | ||
| t.Fatal("expected model pricing resolver to be nil when models.dev lookup is disabled") | ||
| t.Fatal("expected model pricing resolver to be nil by default") |
There was a problem hiding this comment.
This was a deliberate change per the explicit user request to "remove dynamic pricing lookup all together." Removing the resolver entirely — not just skipping it for auto — was the stated goal. Concrete models that are missing from the embedded catalog will fall back to the embedded data only, which is the intended deterministic behavior.
|
|
||
| compileSection := text[compileIndex:] | ||
| assert.Contains(t, compileSection, "`--no-models-dev-lookup`", "compile docs options should include --no-models-dev-lookup") | ||
| assert.NotContains(t, compileSection, "`--no-models-dev-lookup`", "compile docs options should not include removed --no-models-dev-lookup") |
There was a problem hiding this comment.
The --no-models-dev-lookup flag controlled the now-removed models.dev pricing resolver. With the resolver gone, the flag has no associated functionality and was removed intentionally. Any scripts using it would have had no effect after the resolver was removed, so removing the flag keeps the CLI surface clean and avoids a dead option.
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #48516 does not have the 'implementation' label and has only 30 new lines of code in business logic directories (threshold: 100). |
There was a problem hiding this comment.
Review: Stabilize smoke-copilot-auto lock output
The approach is sound — removing the external pricing resolver entirely is a simpler and more robust fix than the isDynamicModelAliasForPricing guard alone, because it eliminates the whole class of catalog-drift mutations.
One inline note:
TestCreateAndConfigureCompiler_RegistersModelPricingResolverByDefaultnow asserts the resolver isnil, which is the opposite of its name — flagged inline.
Observation (non-blocking): The isDynamicModelAliasForPricing guard added in compiler_model_pricing.go is now dead code — no resolver is ever set via SetModelPricingResolver, so resolveProviderAndModelForPricing is never called with a live resolver. The guard and new tests are still good documentation of intent, but consider a comment noting the guard is a forward-compat safeguard in case a resolver is re-introduced later, so it is not confused for active protection.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 17.1 AIC · ⌖ 4.65 AIC · ⊞ 5K
|
|
||
| func TestCreateAndConfigureCompiler_SkipsModelPricingResolverWhenDisabled(t *testing.T) { | ||
| compiler := createAndConfigureCompiler(CompileConfig{DisableModelsDevLookup: true}) | ||
| if hasModelPricingResolver(compiler) { |
There was a problem hiding this comment.
The test name TestCreateAndConfigureCompiler_RegistersModelPricingResolverByDefault now asserts the opposite of what it says — the test checks that the resolver is nil. Please rename to something like TestCreateAndConfigureCompiler_HasNoModelPricingResolverByDefault to avoid misleading future readers.
@copilot please address this.
There was a problem hiding this comment.
Renamed to TestCreateAndConfigureCompiler_DoesNotRegisterModelPricingResolverByDefault in the latest commit.
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics (1 new + 3 modified tests)
Verdict
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — approving with one minor naming fix requested.
📋 Key Themes & Highlights
Findings
- Test name inversion (
compile_compiler_setup_test.go:18):RegistersModelPricingResolverByDefaultnow asserts the resolver is nil — the name contradicts the assertion. Low risk, but misleading for future regression diagnosis.
Positive Highlights
- ✅ Root cause properly addressed at the right abstraction layer (
resolveProviderAndModelForPricing) - ✅
isDynamicModelAliasForPricingis a clean, well-named predicate — easy to extend for future aliases - ✅ Both
"auto"and"github_models/auto"are tested in a single focused test - ✅ Full cleanup of the
--no-models-dev-lookupflag, dead resolver registration, andFindOrFetchModelPricing— no orphaned code left behind - ✅ Lock file diff confirms the fix works as intended
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 30.9 AIC · ⌖ 4.73 AIC · ⊞ 6.7K
Comment /matt to run again
| @@ -17,15 +17,8 @@ func hasModelPricingResolver(compiler *workflow.Compiler) bool { | |||
|
|
|||
| func TestCreateAndConfigureCompiler_RegistersModelPricingResolverByDefault(t *testing.T) { | |||
There was a problem hiding this comment.
[/diagnosing-bugs] Test name RegistersModelPricingResolverByDefault is now misleading — the body asserts hasModelPricingResolver is false, which is the opposite of what the name implies.
💡 Suggested rename
func TestCreateAndConfigureCompiler_DoesNotRegisterModelPricingResolverByDefault(t *testing.T) {A misleading name will confuse future readers and slow down regression diagnosis.
@copilot please address this.
There was a problem hiding this comment.
Renamed to TestCreateAndConfigureCompiler_DoesNotRegisterModelPricingResolverByDefault in the latest commit.
There was a problem hiding this comment.
REQUEST_CHANGES: scope creep hides a breaking CLI/feature removal behind an "auto" pricing-drift fix
Themes
- Undisclosed breaking change: the PR description only describes a narrow guard preventing
model: autofrom participating in compile-timemodels.devpricing lookup. The actual diff goes much further, deleting the--no-models-dev-lookupCLI flag,DisableModelsDevLookupconfig field, and the entireFindOrFetchModelPricingmechanism — a user-facing breaking change with zero mention in the PR body. - Overbroad regression: removing the resolver wiring drops cost-accounting pricing injection for all models missing from the embedded catalog, not just
auto. The stated bug was already fully fixed by theisDynamicModelAliasForPricingguard added earlier in the same PR. - Dead code left behind:
resolveModelPricingIfMissing,modelCostsHasPricingFor, the newisDynamicModelAliasForPricingguard, and the exportedSetModelPricingResolver/modelPricingResolverfield onCompilerare now unreachable in production (only exercised by tests that manually inject a resolver). This is confusing, untested-in-production surface area that should be removed or restored, not left half-finished. - Stale docs:
pkg/cli/README.mdstill documents the deletedFindOrFetchModelPricingfunction.
Recommend either (a) keep the resolver wired for non-auto models and rely on the narrow guard alone to fix the stated drift, or (b) if full removal of external pricing lookup is intentional, call it out explicitly as a breaking change, retitle/re-describe the PR, and clean up the now-dead resolver plumbing and stale docs.
🔎 Code quality review by PR Code Quality Reviewer · sonnet50 · 92 AIC · ⌖ 4.86 AIC · ⊞ 7.4K
Comment /review to run again
Comments that could not be inline-anchored
cmd/gh-aw/main.go:338
This PR silently removes the entire --no-models-dev-lookup CLI flag (and its wiring), well beyond the stated scope of fixing model: auto pricing drift.
<details><summary>💡 Undocumented breaking CLI change</summary>
The PR title/description only describe a narrow guard for the auto alias so it does not participate in compile-time pricing lookup. Instead, the diff deletes --no-models-dev-lookup, DisableModelsDevLookup, and the entire FindOrFetchModelPricing mechanism it controlled …
pkg/cli/model_costs.go:183
Removing FindOrFetchModelPricing regresses cost accounting for all models missing from the embedded catalog, not just model: auto.
<details><summary>💡 Overbroad removal vs. stated fix</summary>
FindOrFetchModelPricing was the only mechanism that injected models.dev-sourced pricing into GH_AW_INFO_MODEL_COSTS for models absent from the embedded actions/setup/js/models.json catalog. Its only caller (compiler.SetModelPricingResolver(FindOrFetchModelPricing) in `pkg/cli/compile…
pkg/workflow/compiler_model_pricing.go:24
resolveModelPricingIfMissing (and the resolver field/setter it depends on) is now dead code in production — no caller ever registers a resolver.
<details><summary>💡 Orphaned pricing-injection path</summary>
Since createAndConfigureCompiler no longer calls compiler.SetModelPricingResolver(...) (that call was deleted in this same PR) and no other production code calls it, c.modelPricingResolver is permanently nil at runtime. This function's nil-check on line 24 always short-circuits,…
pkg/workflow/compiler_model_pricing.go:114
The isDynamicModelAliasForPricing guard added in this same PR is now unreachable, since the pricing resolver it protects is never registered.
<details><summary>💡 Guard added then immediately obsoleted</summary>
This guard (and its call in resolveProviderAndModelForPricing) was introduced specifically to stop model: auto from triggering external models.dev pricing lookup. A later change in the same PR removes the only production wiring that ever invokes the resolver this guard protect…
|
@copilot run pr-finisher skill |
PR Triage
Stabilizes nondeterministic lock-file drift for
|
…sNotRegisterModelPricingResolverByDefault Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Here's a summary of this pass:
Actions taken: Renamed misleading test function in |
smoke-copilot-auto.lock.ymlwas drifting across builds even when source workflow content did not change. Root cause was compile-time pricing resolution treatingmodel: autoas a concrete model and embedding externalmodels.devpricing intoGH_AW_INFO_MODEL_COSTS.Root cause containment
autono longer participates in external pricing lookup, preventing lock mutations from catalog-side changes.Compiler behavior change
model: auto.Coverage updates
autogithub_models/autoGenerated artifact impact
smoke-copilot-auto.lock.yml; removed injectedGH_AW_INFO_MODEL_COSTSoverlay for the dynamic alias path.