From af8288577e7990e0fd688f0d490fd8efc999d983 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 15:09:25 +0000 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20remove=20dead=20functions=20?= =?UTF-8?q?=E2=80=94=201=20function=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove HasModelPricingResolver from Compiler since it has no callers outside test files. Remove its two exclusive test functions that tested nothing else. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/cli/compile_compiler_setup_test.go | 14 -------------- pkg/workflow/compiler_types.go | 5 ----- 2 files changed, 19 deletions(-) diff --git a/pkg/cli/compile_compiler_setup_test.go b/pkg/cli/compile_compiler_setup_test.go index bdbafbd64ff..f5379e54ec2 100644 --- a/pkg/cli/compile_compiler_setup_test.go +++ b/pkg/cli/compile_compiler_setup_test.go @@ -8,20 +8,6 @@ import ( "github.com/github/gh-aw/pkg/workflow" ) -func TestCreateAndConfigureCompiler_RegistersModelPricingResolverByDefault(t *testing.T) { - compiler := createAndConfigureCompiler(CompileConfig{}) - if !compiler.HasModelPricingResolver() { - t.Fatal("expected model pricing resolver to be registered by default") - } -} - -func TestCreateAndConfigureCompiler_SkipsModelPricingResolverWhenDisabled(t *testing.T) { - compiler := createAndConfigureCompiler(CompileConfig{DisableModelsDevLookup: true}) - if compiler.HasModelPricingResolver() { - t.Fatal("expected model pricing resolver to be nil when models.dev lookup is disabled") - } -} - // TestSetupRepositoryContext_ValidScheduleSeedLocksSlug verifies that when // --schedule-seed contains a valid "owner/repo" slug, setupRepositoryContext // sets it on the compiler AND locks it so per-file git-remote detection diff --git a/pkg/workflow/compiler_types.go b/pkg/workflow/compiler_types.go index 2b56bb9352f..8a57eb3f565 100644 --- a/pkg/workflow/compiler_types.go +++ b/pkg/workflow/compiler_types.go @@ -178,11 +178,6 @@ func (c *Compiler) SetModelPricingResolver(fn func(ctx context.Context, provider c.modelPricingResolver = fn } -// HasModelPricingResolver reports whether a model pricing resolver callback is configured. -func (c *Compiler) HasModelPricingResolver() bool { - return c.modelPricingResolver != nil -} - // SetRequireDocker configures whether Docker must be available for container image validation. // When true, validation fails with an error if Docker is not installed or the daemon is not running. // When false (default), validation is silently skipped when Docker is unavailable. From 8c41a0a0554dafd85b3f5ec864cd604236217d45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:26:24 +0000 Subject: [PATCH 2/3] test: restore DisableModelsDevLookup coverage in compiler setup Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --- pkg/cli/compile_compiler_setup_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkg/cli/compile_compiler_setup_test.go b/pkg/cli/compile_compiler_setup_test.go index f5379e54ec2..4cb2a1a2c6a 100644 --- a/pkg/cli/compile_compiler_setup_test.go +++ b/pkg/cli/compile_compiler_setup_test.go @@ -3,11 +3,30 @@ package cli import ( + "reflect" "testing" "github.com/github/gh-aw/pkg/workflow" ) +func hasModelPricingResolver(compiler *workflow.Compiler) bool { + return !reflect.ValueOf(compiler).Elem().FieldByName("modelPricingResolver").IsNil() +} + +func TestCreateAndConfigureCompiler_RegistersModelPricingResolverByDefault(t *testing.T) { + compiler := createAndConfigureCompiler(CompileConfig{}) + if !hasModelPricingResolver(compiler) { + t.Fatal("expected model pricing resolver to be registered by default") + } +} + +func TestCreateAndConfigureCompiler_SkipsModelPricingResolverWhenDisabled(t *testing.T) { + compiler := createAndConfigureCompiler(CompileConfig{DisableModelsDevLookup: true}) + if hasModelPricingResolver(compiler) { + t.Fatal("expected model pricing resolver to be nil when models.dev lookup is disabled") + } +} + // TestSetupRepositoryContext_ValidScheduleSeedLocksSlug verifies that when // --schedule-seed contains a valid "owner/repo" slug, setupRepositoryContext // sets it on the compiler AND locks it so per-file git-remote detection From 0a49da86e064aba27da7a11134784bb1763e8db9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:28:47 +0000 Subject: [PATCH 3/3] test: document reflective resolver assertion coupling Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --- pkg/cli/compile_compiler_setup_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cli/compile_compiler_setup_test.go b/pkg/cli/compile_compiler_setup_test.go index 4cb2a1a2c6a..804b16b138c 100644 --- a/pkg/cli/compile_compiler_setup_test.go +++ b/pkg/cli/compile_compiler_setup_test.go @@ -10,6 +10,8 @@ import ( ) func hasModelPricingResolver(compiler *workflow.Compiler) bool { + // Keep this field name in sync with workflow.Compiler; this helper intentionally + // inspects private state to preserve behavioral coverage without re-exporting API. return !reflect.ValueOf(compiler).Elem().FieldByName("modelPricingResolver").IsNil() }