Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,11 @@ fn select_model_from_list(
),
);

if provider_meta.allows_unlisted_models {
model_items.push((
UNLISTED_MODEL_KEY.to_string(),
"Enter a model not listed...".to_string(),
"",
));
}
model_items.push((
UNLISTED_MODEL_KEY.to_string(),
"Enter a model not listed...".to_string(),
"",
));

let selection = cliclack::select("Select a model:")
.items(&model_items)
Expand All @@ -491,13 +489,11 @@ fn select_model_from_list(
let mut model_items: Vec<(String, String, &str)> =
models.iter().map(|m| (m.clone(), m.clone(), "")).collect();

if provider_meta.allows_unlisted_models {
model_items.push((
UNLISTED_MODEL_KEY.to_string(),
"Enter a model not listed...".to_string(),
"",
));
}
model_items.push((
UNLISTED_MODEL_KEY.to_string(),
"Enter a model not listed...".to_string(),
"",
));

let selection = cliclack::select("Select a model:")
.items(&model_items)
Expand Down
12 changes: 0 additions & 12 deletions crates/goose/src/providers/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ pub struct ProviderMetadata {
pub model_doc_link: String,
/// Required configuration keys
pub config_keys: Vec<ConfigKey>,
/// Whether this provider allows entering model names not in the fetched list
#[serde(default)]
pub allows_unlisted_models: bool,
}

impl ProviderMetadata {
Expand Down Expand Up @@ -144,7 +141,6 @@ impl ProviderMetadata {
.collect(),
model_doc_link: model_doc_link.to_string(),
config_keys,
allows_unlisted_models: false,
}
}

Expand All @@ -165,7 +161,6 @@ impl ProviderMetadata {
known_models: models,
model_doc_link: model_doc_link.to_string(),
config_keys,
allows_unlisted_models: false,
}
}

Expand All @@ -178,15 +173,8 @@ impl ProviderMetadata {
known_models: vec![],
model_doc_link: "".to_string(),
config_keys: vec![],
allows_unlisted_models: false,
}
}

/// Set allows_unlisted_models flag (builder pattern)
pub fn with_unlisted_models(mut self) -> Self {
self.allows_unlisted_models = true;
self
}
}

/// Configuration key metadata for provider setup
Expand Down
1 change: 0 additions & 1 deletion crates/goose/src/providers/chatgpt_codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,6 @@ impl ProviderDef for ChatGptCodexProvider {
None,
)],
)
.with_unlisted_models()
}

fn from_env(
Expand Down
4 changes: 0 additions & 4 deletions crates/goose/src/providers/claude_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,6 @@ impl ProviderDef for ClaudeCodeProvider {
CLAUDE_CODE_DOC_URL,
vec![ConfigKey::from_value_type::<ClaudeCodeCommand>(true, false)],
)
// The model list only returns aliases the `claude` CLI uses, such as "default"
// and "haiku". There is no listing that includes full names like
// "claude-sonnet-4-5-20250929". However, they are permitted.
.with_unlisted_models()
}

fn from_env(
Expand Down
1 change: 0 additions & 1 deletion crates/goose/src/providers/codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ impl ProviderDef for CodexProvider {
ConfigKey::from_value_type::<CodexSkipGitCheck>(false, false),
],
)
.with_unlisted_models()
}

fn from_env(
Expand Down
1 change: 0 additions & 1 deletion crates/goose/src/providers/cursor_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ impl ProviderDef for CursorAgentProvider {
true, false,
)],
)
.with_unlisted_models()
}

fn from_env(
Expand Down
2 changes: 0 additions & 2 deletions crates/goose/src/providers/gcpvertexai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ impl ProviderDef for GcpVertexAIProvider {
),
],
)
.with_unlisted_models()
}

fn from_env(
Expand Down Expand Up @@ -824,6 +823,5 @@ mod tests {
assert!(!metadata.known_models.is_empty());
assert_eq!(metadata.default_model, "gemini-2.5-flash");
assert_eq!(metadata.config_keys.len(), 6);
assert!(metadata.allows_unlisted_models);
}
}
1 change: 0 additions & 1 deletion crates/goose/src/providers/gemini_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ impl ProviderDef for GeminiCliProvider {
GEMINI_CLI_DOC_URL,
vec![ConfigKey::from_value_type::<GeminiCliCommand>(true, false)],
)
.with_unlisted_models()
}

fn from_env(
Expand Down
1 change: 0 additions & 1 deletion crates/goose/src/providers/openrouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ impl ProviderDef for OpenRouterProvider {
),
],
)
.with_unlisted_models()
}

fn from_env(
Expand Down
1 change: 0 additions & 1 deletion crates/goose/src/providers/provider_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ impl ProviderRegistry {
known_models,
model_doc_link: base_metadata.model_doc_link,
config_keys,
allows_unlisted_models: false,
};

self.entries.insert(
Expand Down
1 change: 0 additions & 1 deletion crates/goose/tests/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ mod tests {
known_models: vec![],
model_doc_link: "".to_string(),
config_keys: vec![],
allows_unlisted_models: false,
}
}

Expand Down
1 change: 0 additions & 1 deletion crates/goose/tests/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ impl ProviderDef for MockCompactionProvider {
known_models: vec![],
model_doc_link: "".to_string(),
config_keys: vec![],
allows_unlisted_models: false,
}
}

Expand Down
4 changes: 0 additions & 4 deletions ui/desktop/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5553,10 +5553,6 @@
"config_keys"
],
"properties": {
"allows_unlisted_models": {
"type": "boolean",
"description": "Whether this provider allows entering model names not in the fetched list"
},
"config_keys": {
"type": "array",
"items": {
Expand Down
4 changes: 0 additions & 4 deletions ui/desktop/src/api/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,6 @@ export type ProviderEngine = 'openai' | 'ollama' | 'anthropic';
* Metadata about a provider's configuration requirements and capabilities
*/
export type ProviderMetadata = {
/**
* Whether this provider allows entering model names not in the fetched list
*/
allows_unlisted_models?: boolean;
/**
* Required configuration keys
*/
Expand Down
12 changes: 5 additions & 7 deletions ui/desktop/src/components/recipes/shared/RecipeModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ export const RecipeModelSelector = ({
provider: p.name,
}));

if (p.metadata.allows_unlisted_models) {
options.push({
value: `__custom__:${p.name}`,
label: 'Enter a model not listed...',
provider: p.name,
});
}
options.push({
value: `__custom__:${p.name}`,
label: 'Enter a model not listed...',
provider: p.name,
});

if (options.length > 0) {
groupedOptions.push({ options });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const SwitchModelModal = ({
providerType: p.provider_type,
}));

if (p.metadata.allows_unlisted_models && p.provider_type !== 'Custom') {
if (p.provider_type !== 'Custom') {
options.push({
value: 'custom',
label: 'Enter a model not listed...',
Expand Down