fix(api): validate openrouter models against dynamic catalog#613
Open
arielshad wants to merge 5 commits into
Open
fix(api): validate openrouter models against dynamic catalog#613arielshad wants to merge 5 commits into
arielshad wants to merge 5 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Selecting a dynamically-listed openrouter model (e.g.
nvidia/nemotron-3-super-120b-a12b:free) previously failed withUnsupported model "<id>" for agent "openrouter"becauseUpdateFeaturePinnedConfigUseCasevalidated chosen models against the synchronous, hardcodedIAgentExecutorFactory.getSupportedModels(agentType)list. The web picker, however, surfaces models from the live remote catalog viaIAgentExecutorFactory.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
IAgentExecutorFactory.listAvailableModels(agentType)— async, live remote catalogIAgentExecutorFactory.getSupportedModels(agentType)— sync, hardcodedChanges
packages/core/src/application/use-cases/features/update-feature-pinned-config.use-case.ts— validation now uses the dynamic catalog (listAvailableModels) instead of the staticgetSupportedModelslisttests/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 acceptedspecs/098-im-getting-unsupported-model-nvidianemotron-3/— spec, evidence artifacts, and phase trackingSuccess Criteria
listAvailableModels(same source as the picker)Evidence
UpdateFeaturePinnedConfigUseCase— 12/12 tests passing, including the new "accepts a dynamically-listed openrouter model that is not in any static list" case usingnvidia/nemotron-3-super-120b-a12b:freespecs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/unit-test-results.txtspecs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/targeted-test-output.txtspecs/098-im-getting-unsupported-model-nvidianemotron-3/evidence/full-unit-test-summary.txtgetSupportedModels(hardcoded) to asynclistAvailableModels(dynamic remote catalog)Test Plan
Unsupported modelerror🐑 Built with Shep.bot