Skip to content

fix(api): validate openrouter models against dynamic catalog#613

Open
arielshad wants to merge 5 commits into
mainfrom
feat/im-getting-unsupported-model-nvidianemotron-3
Open

fix(api): validate openrouter models against dynamic catalog#613
arielshad wants to merge 5 commits into
mainfrom
feat/im-getting-unsupported-model-nvidianemotron-3

Conversation

@arielshad
Copy link
Copy Markdown
Contributor

Summary

Selecting a dynamically-listed openrouter model (e.g. nvidia/nemotron-3-super-120b-a12b:free) previously failed with Unsupported model "<id>" for agent "openrouter" because UpdateFeaturePinnedConfigUseCase validated chosen models against the synchronous, hardcoded IAgentExecutorFactory.getSupportedModels(agentType) list. The web picker, however, surfaces models from the live remote catalog via IAgentExecutorFactory.listAvailableModels(agentType) — any new openrouter model surfaced by the picker would be rejected on save.

This PR switches the use case's validation to listAvailableModels, so model acceptance follows the same source of truth as the picker.

Root Cause

  • Picker source: IAgentExecutorFactory.listAvailableModels(agentType) — async, live remote catalog
  • Validation source (before): IAgentExecutorFactory.getSupportedModels(agentType) — sync, hardcoded
  • Result: any openrouter model added to the live catalog after the hardcoded list was last updated would render in the picker but fail validation on save.

Changes

  • packages/core/src/application/use-cases/features/update-feature-pinned-config.use-case.ts — validation now uses the dynamic catalog (listAvailableModels) instead of the static getSupportedModels list
  • tests/unit/application/use-cases/features/ — added a unit test that pins a dynamically-listed openrouter model not present in any static list (nvidia/nemotron-3-super-120b-a12b:free) and asserts it is accepted
  • specs/098-im-getting-unsupported-model-nvidianemotron-3/ — spec, evidence artifacts, and phase tracking

Success Criteria

  • Validation uses listAvailableModels (same source as the picker)
  • Dynamically-listed openrouter models are accepted on save
  • Static fallback / hardcoded model lists are no longer authoritative for validation
  • Unit tests cover the dynamic-catalog acceptance path

Evidence

  • Targeted unit-test run for UpdateFeaturePinnedConfigUseCase — 12/12 tests passing, including the new "accepts a dynamically-listed openrouter model that is not in any static list" case using nvidia/nemotron-3-super-120b-a12b:free
    • See: specs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/unit-test-results.txt
  • Verbose targeted test output enumerating all 12 use-case test cases as passing, with the dynamic openrouter acceptance test explicitly visible (line 10)
    • See: specs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/targeted-test-output.txt
  • Full unit-test suite summary — 577 test files, 7321/7321 tests passing, no regressions from the validation change
    • See: specs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/full-unit-test-summary.txt
  • Implementation diff showing validation switched from synchronous getSupportedModels (hardcoded) to async listAvailableModels (dynamic remote catalog)

Test Plan

  • In the web picker, select an openrouter model that was recently added to the remote catalog (not in the hardcoded list)
  • Save the pinned config — should succeed without Unsupported model error
  • Confirm reverting to a previously-supported model still works
  • Confirm an unknown/invalid model (not in the live catalog) is still rejected

🐑 Built with Shep.bot

arielshad and others added 5 commits May 14, 2026 13:23
UpdateFeaturePinnedConfigUseCase rejected any openrouter model not in the
static OPENROUTER_MODELS list, even though the web picker shows the live
remote catalog via listAvailableModels. Validation now uses the same async
catalog path so dynamic models like nvidia/nemotron-3-super-120b-a12b:free
are accepted.

Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant