Skip to content

fix(console): add fuzzy search and fix duplication in /model completer#45

Merged
daltonnyx merged 1 commit into
saigontechnology:mainfrom
nqat2003:fix/model-completer-duplication
Jun 29, 2026
Merged

fix(console): add fuzzy search and fix duplication in /model completer#45
daltonnyx merged 1 commit into
saigontechnology:mainfrom
nqat2003:fix/model-completer-duplication

Conversation

@nqat2003

Copy link
Copy Markdown
Contributor

When selecting a model, deleting part of it, then selecting another, the new model name was appended to the remaining text instead of replacing it. Changed start_position to replace the full text after "/model " instead of only the last word fragment.

@nqat2003 nqat2003 force-pushed the fix/model-completer-duplication branch from 32d77c2 to 691e0f2 Compare June 29, 2026 08:05
@nqat2003

Copy link
Copy Markdown
Contributor Author

Updated this PR to also add fuzzy search for the /model completer.

Previously, users had to type the exact prefix of a model ID (e.g., claude-sonnet) to find it. Now the completer supports three levels of matching, ranked by relevance:

  1. Prefix match: clau → claude-sonnet-4-5 (same as before)
  2. Substring match: sonnet → claude-sonnet-4-5, 5.2 → glm-5.2 (matches anywhere in model ID or name)
  3. Fuzzy match: csn → claude-sonnet-4-5 (characters appear in order, scored by gap penalty)

No new dependencies, pure Python implementation.

@nqat2003 nqat2003 changed the title fix(console): fix model name duplication in /model completer fix(console): add fuzzy search and fix duplication in /model completer Jun 29, 2026
Implement ranked fuzzy matching in ModelCompleter so users can search
models by substring or fuzzy character sequence, not just exact prefix.

Match priority: prefix > substring (in model ID or name) > fuzzy.
@nqat2003 nqat2003 force-pushed the fix/model-completer-duplication branch from 691e0f2 to 985a89c Compare June 29, 2026 08:29
@daltonnyx daltonnyx merged commit ff2fcba into saigontechnology:main Jun 29, 2026
4 checks passed
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