Skip to content

fix(tui): use Ollama default model in completions#2742

Closed
reidliu41 wants to merge 1 commit into
Hmbown:mainfrom
reidliu41:fix/ollama-model-completions
Closed

fix(tui): use Ollama default model in completions#2742
reidliu41 wants to merge 1 commit into
Hmbown:mainfrom
reidliu41:fix/ollama-model-completions

Conversation

@reidliu41

@reidliu41 reidliu41 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Ollama uses deepseek-coder:1.3b as its default local model, but the /model
picker and slash completion were still showing the DeepSeek static model list
for the Ollama provider.

That made Ollama's model suggestions inconsistent with the actual default
configuration.

This PR updates Ollama model completions to include the Ollama default model
instead, and adds a regression test for that behavior.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features
  • cargo test --workspace --all-features

Checklist

  • Updated docs or comments as needed
  • Added or updated tests where relevant
  • Verified TUI behavior manually if UI changes

Greptile Summary

This PR fixes a model-picker regression where Ollama was incorrectly grouped with the OpenAI/Atlascloud providers and therefore offered the DeepSeek official API model list (deepseek-v4-pro, deepseek-v4-flash) as slash-completions, instead of its own local default.

  • model_completion_names_for_provider now returns vec![DEFAULT_OLLAMA_MODEL] (\"deepseek-coder:1.3b\") for ApiProvider::Ollama, consistent with how default_model() already resolves the same constant.
  • A new unit test asserts the corrected behavior and guards against future regressions.

Confidence Score: 5/5

Safe to merge — the change is a one-line match-arm split that aligns the completion list with the already-correct default_model() constant, and the new test covers the fixed case directly.

The diff is minimal and targeted: it separates Ollama from OpenAI/Atlascloud in a single match arm and adds a regression test. The constant being referenced (DEFAULT_OLLAMA_MODEL) is the same one already used by default_model(), so there is no divergence between what the TUI suggests and what the configuration actually defaults to.

No files require special attention.

Important Files Changed

Filename Overview
crates/tui/src/config.rs Separates Ollama from the OpenAI/Atlascloud match arm in model_completion_names_for_provider so it returns [DEFAULT_OLLAMA_MODEL] instead of the DeepSeek official model list; adds a targeted regression test.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[model_completion_names_for_provider] --> B{ApiProvider?}
    B -- Ollama --> C["vec![DEFAULT_OLLAMA_MODEL]\n(deepseek-coder:1.3b)"]
    B -- "Openai | Atlascloud" --> D["OFFICIAL_DEEPSEEK_MODELS.to_vec()\n(deepseek-v4-pro, deepseek-v4-flash)"]
    B -- "Deepseek | DeepseekCN" --> E["OFFICIAL_DEEPSEEK_MODELS.to_vec()"]
    B -- "Sglang | Vllm | ..." --> F["provider-specific defaults"]
Loading

Reviews (1): Last reviewed commit: "fix(tui): use Ollama default model in co..." | Re-trigger Greptile

  Return the Ollama default model for Ollama /model completions instead of
  reusing the DeepSeek static model list.

  This keeps the /model picker and slash completion aligned with the
  provider's default local model.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Thanks @reidliu41 for taking the time to contribute.

This repository is currently observing a maintainer-managed contribution gate in dry-run mode, so this pull request is staying open. When enforcement is enabled, pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS will be closed automatically.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant PR access by commenting /lgtm on a pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the model completion names for the Ollama API provider in crates/tui/src/config.rs to return the default Ollama model (DEFAULT_OLLAMA_MODEL) instead of the official DeepSeek models. It also adds a corresponding unit test to verify this behavior. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Hmbown

Hmbown commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Thanks @reidliu41. This catches a real picker inconsistency, but I don’t want to add the old deepseek-coder:1.3b default to another surface. We should either discover installed Ollama models dynamically or first choose a current local default.

Hmbown added a commit that referenced this pull request Jun 5, 2026
Harvested from PR #2742 by @reidliu41

Ollama model IDs are local passthrough tags, so /model static completions should not suggest hosted DeepSeek API models or entrench the stale default local tag. Keep the picker on auto/current/saved local models while the existing /models path fetches installed tags from the configured endpoint.

Verification: cargo fmt --all -- --check; git diff --check; ./scripts/release/check-versions.sh; cargo test -p codewhale-tui --bin codewhale-tui --locked ollama -- --nocapture; cargo clippy -p codewhale-tui --bin codewhale-tui --locked -- -D warnings.

Co-authored-by: reidliu41 <61492567+reidliu41@users.noreply.github.com>
Hmbown added a commit that referenced this pull request Jun 5, 2026
…tions

fix(tui): #2742 avoid static Ollama model suggestions
@Hmbown

Hmbown commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Thanks @reidliu41 — this correctly caught the Ollama /model suggestion inconsistency.\n\nI harvested the intent into the v0.9.0 integration branch via #2772, merged as 68fb6e3b9 with the credited harvest commit 912d6aed2. The landed version keeps your core fix direction — Ollama no longer gets hosted DeepSeek static model suggestions — but avoids adding the old deepseek-coder:1.3b default to another UI surface. Instead, Ollama static completions are empty, the picker preserves the current/saved local tag, and installed local tags remain available through the existing live /models path.\n\nVerification recorded for the harvest:\n- cargo fmt --all -- --check\n- git diff --check\n- ./scripts/release/check-versions.sh\n- cargo test -p codewhale-tui --bin codewhale-tui --locked ollama -- --nocapture (10 pass)\n- cargo clippy -p codewhale-tui --bin codewhale-tui --locked -- -D warnings\n- python3 scripts/check-coauthor-trailers.py --author-map .github/AUTHOR_MAP --range origin/codex/v0.9.0-stewardship..HEAD --check-authors\n\nThe commit includes Harvested from PR #2742 by @reidliu41, your GitHub-mappable co-author trailer, and changelog credit. Closing this PR as harvested/superseded, not because the report was wrong — the inconsistency was real.

@Hmbown Hmbown closed this Jun 5, 2026
timothybrush pushed a commit to timothybrush/DeepSeek-TUI that referenced this pull request Jun 8, 2026
…mbown#2757 harvests and Hmbown#2742/Hmbown#2751/Hmbown#2755 dispositions

Log the new community-PR harvests in CHANGELOG.md and crates/tui/CHANGELOG.md
(MCP underscore server names, Xiaomi MiMo pricing, hydrated deferred-tool
render, Token Plan region docs) with contributor credit, and update
docs/V0_9_0_EXECUTION_MAP.md with evidence-backed dispositions for the
newly-reviewed PRs, including the deferred Hmbown#2742 and forwarded Hmbown#2751/Hmbown#2755.
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.

2 participants