diff --git a/CHANGELOG.md b/CHANGELOG.md index d02fc1c4..b22b3b72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a PR gate marker guard so reopened unapproved PRs do not get duplicate intake comments, and clarified that PR reopening should happen after allowlist approval is merged. +- Ollama `/model` completions no longer show hosted DeepSeek API model IDs. + The picker preserves the current or saved local Ollama tag, and users can + still fetch installed model IDs through `/models` instead of relying on a + stale static default (#2742). Thanks @reidliu41 for the focused report and + draft fix. - Documented the agent and sub-agent stewardship ethos so future automation preserves human issue intake, careful PR review, and contributor credit. - Moved the TUI Starlark execpolicy parser and PTY support behind non-OHOS diff --git a/crates/tui/CHANGELOG.md b/crates/tui/CHANGELOG.md index d02fc1c4..b22b3b72 100644 --- a/crates/tui/CHANGELOG.md +++ b/crates/tui/CHANGELOG.md @@ -78,6 +78,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a PR gate marker guard so reopened unapproved PRs do not get duplicate intake comments, and clarified that PR reopening should happen after allowlist approval is merged. +- Ollama `/model` completions no longer show hosted DeepSeek API model IDs. + The picker preserves the current or saved local Ollama tag, and users can + still fetch installed model IDs through `/models` instead of relying on a + stale static default (#2742). Thanks @reidliu41 for the focused report and + draft fix. - Documented the agent and sub-agent stewardship ethos so future automation preserves human issue intake, careful PR review, and contributor credit. - Moved the TUI Starlark execpolicy parser and PTY support behind non-OHOS diff --git a/crates/tui/src/config.rs b/crates/tui/src/config.rs index 2f65bc51..20f752a1 100644 --- a/crates/tui/src/config.rs +++ b/crates/tui/src/config.rs @@ -788,9 +788,8 @@ pub fn model_completion_names_for_provider(provider: ApiProvider) -> Vec<&'stati ApiProvider::Sglang => vec![DEFAULT_SGLANG_MODEL, DEFAULT_SGLANG_FLASH_MODEL], ApiProvider::Vllm => vec![DEFAULT_VLLM_MODEL, DEFAULT_VLLM_FLASH_MODEL], ApiProvider::Volcengine => vec![DEFAULT_VOLCENGINE_MODEL, DEFAULT_VOLCENGINE_FLASH_MODEL], - ApiProvider::Openai | ApiProvider::Atlascloud | ApiProvider::Ollama => { - OFFICIAL_DEEPSEEK_MODELS.to_vec() - } + ApiProvider::Ollama => Vec::new(), + ApiProvider::Openai | ApiProvider::Atlascloud => OFFICIAL_DEEPSEEK_MODELS.to_vec(), } } @@ -7499,6 +7498,13 @@ api_key = "old-openrouter-key" ); } + #[test] + fn model_completion_names_for_ollama_do_not_promote_static_remote_models() { + let models = model_completion_names_for_provider(ApiProvider::Ollama); + + assert!(models.is_empty()); + } + #[test] fn model_completion_names_for_openrouter_include_recent_large_models() { let models = model_completion_names_for_provider(ApiProvider::Openrouter); diff --git a/crates/tui/src/tui/model_picker.rs b/crates/tui/src/tui/model_picker.rs index e2a8f1a0..21125044 100644 --- a/crates/tui/src/tui/model_picker.rs +++ b/crates/tui/src/tui/model_picker.rs @@ -777,6 +777,22 @@ mod tests { } } + #[test] + fn picker_for_ollama_preserves_current_local_tag_without_hosted_static_rows() { + let (mut app, _lock) = create_test_app(); + app.api_provider = crate::config::ApiProvider::Ollama; + app.model_ids_passthrough = true; + app.model = "qwen2.5-coder:7b".to_string(); + app.auto_model = false; + + let view = ModelPickerView::new(&app); + let model_ids = view.visible_model_ids(); + + assert_eq!(model_ids, vec!["auto"]); + assert!(view.show_custom_model_row); + assert_eq!(view.resolved_model(), "qwen2.5-coder:7b"); + } + #[test] fn visible_row_window_tracks_selection_in_short_panes() { assert_eq!(visible_row_window(0, 16, 8), (0, 8)); diff --git a/crates/tui/src/tui/widgets/mod.rs b/crates/tui/src/tui/widgets/mod.rs index 55b8cff8..181a45a0 100644 --- a/crates/tui/src/tui/widgets/mod.rs +++ b/crates/tui/src/tui/widgets/mod.rs @@ -3303,6 +3303,21 @@ mod tests { assert!(!names.contains(&"/model deepseek/deepseek-v4-pro")); } + #[test] + fn slash_completion_hints_model_ollama_has_no_static_remote_models() { + let hints = + slash_completion_hints("/model", 128, &[], Locale::En, None, ApiProvider::Ollama); + let names = hints + .iter() + .map(|hint| hint.name.as_str()) + .collect::>(); + + assert!(names.contains(&"/model")); + assert!(!names.contains(&"/model deepseek-v4-pro")); + assert!(!names.contains(&"/model deepseek-v4-flash")); + assert!(!names.contains(&"/model deepseek-coder:1.3b")); + } + #[test] fn selection_style_uses_explicit_selection_text_role() { let line = Line::from(Span::styled(