Skip to content

Fix DiscoverOpenCodeModels running for all runners #27

@msoedov

Description

@msoedov

RunnerModels in internal/models/models.go:42 hardcodes model lists for all runners including OpenCode. The OpenCode model list (line 79-88) contains 8 models across 4 providers.

Problem:
Model discovery or validation that runs against the OpenCode model list fires for all models, not just when the runner is opencode. This may cause unnecessary validation overhead or incorrect model resolution when other runners are in use.

Expected behavior:
Model discovery should be scoped to the active runner only. IsValidModelForRunner() (line 91) already filters by runner, but callers may be iterating the full RunnerModels map instead of querying by runner key.

Acceptance criteria:

  • Model discovery only runs for the relevant runner
  • No regression in TestTokenZeroingForNonClaude or other model-related tests
  • Add test case that verifies runner-scoped model lookup

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions