fix(configure): filter openrouter/auto from model selection list
The openrouter/auto model is OpenRouter's internal routing feature, not a callable model. While it's valid as a default (set automatically during OpenRouter auth flow), showing it in the configure wizard's model selection causes "Unknown model: openrouter/auto" errors when users select it manually. Add a HIDDEN_ROUTER_MODELS set to filter out such internal models from the selection list while preserving existing functionality. Fixes #1115 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Steinberger
parent
c0457e0cc4
commit
2622b1936b
@@ -17,6 +17,11 @@ const KEEP_VALUE = "__keep__";
|
|||||||
const MANUAL_VALUE = "__manual__";
|
const MANUAL_VALUE = "__manual__";
|
||||||
const PROVIDER_FILTER_THRESHOLD = 30;
|
const PROVIDER_FILTER_THRESHOLD = 30;
|
||||||
|
|
||||||
|
// Models that are internal routing features and should not be shown in selection lists.
|
||||||
|
// These may be valid as defaults (e.g., set automatically during auth flow) but are not
|
||||||
|
// directly callable via API and would cause "Unknown model" errors if selected manually.
|
||||||
|
const HIDDEN_ROUTER_MODELS = new Set(["openrouter/auto"]);
|
||||||
|
|
||||||
type PromptDefaultModelParams = {
|
type PromptDefaultModelParams = {
|
||||||
config: ClawdbotConfig;
|
config: ClawdbotConfig;
|
||||||
prompter: WizardPrompter;
|
prompter: WizardPrompter;
|
||||||
@@ -183,6 +188,8 @@ export async function promptDefaultModel(
|
|||||||
}) => {
|
}) => {
|
||||||
const key = modelKey(entry.provider, entry.id);
|
const key = modelKey(entry.provider, entry.id);
|
||||||
if (seen.has(key)) return;
|
if (seen.has(key)) return;
|
||||||
|
// Skip internal router models that can't be directly called via API.
|
||||||
|
if (HIDDEN_ROUTER_MODELS.has(key)) return;
|
||||||
const hints: string[] = [];
|
const hints: string[] = [];
|
||||||
if (entry.name && entry.name !== entry.id) hints.push(entry.name);
|
if (entry.name && entry.name !== entry.id) hints.push(entry.name);
|
||||||
if (entry.contextWindow) hints.push(`ctx ${formatTokenK(entry.contextWindow)}`);
|
if (entry.contextWindow) hints.push(`ctx ${formatTokenK(entry.contextWindow)}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user