Skip to content

Bug: /model search steals literal s and ranks loose matches first #573

@dennisonbertram

Description

@dennisonbertram

Summary
The /model picker search/autocomplete path behaved poorly for DeepSeek-style queries. Typing deeps could not enter the literal s because s was treated as the star shortcut during search. Typing d could show Anthropic/Claude results ahead of DeepSeek because search only matched display-name substrings.

Impact
Model search feels broken and unpredictable: provider prefixes like d or deep do not reliably surface DeepSeek first, and users cannot type normal queries containing s.

Steps to reproduce

  1. Open the TUI and run /model.
  2. Type d.
  3. Observe Claude/Anthropic-style results can appear before DeepSeek.
  4. Continue typing deeps.
  5. Observe s is consumed by the star shortcut instead of being added to the filter.

Expected vs actual behavior
Expected: printable characters typed during search are appended to the search query, and provider/model prefix matches rank above loose substring matches.
Actual: s toggles a star while search is active, and loose display-name substring matches can rank first.

Suspected root cause
The TUI key handler treated s as star whenever search was active, and model search filtered only by display name in catalog order without relevance ranking.

Proposed fix direction
Limit the s star shortcut to provider model browsing when no search query is active. Search across provider label, provider key, display name, and model ID, ranking exact/prefix matches ahead of word/substring matches.

Test plan / regression coverage
Add component tests for DeepSeek provider/model-id ranking and a root TUI regression proving deeps remains a literal query and resolves to DeepSeek.

Related docs/log entries
See docs/logs/engineering-log.md and docs/logs/long-term-thinking-log.md entries dated 2026-04-30.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions