feat(cli): make /model autocomplete provider-aware#14381
Open
douglascorrea wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates /model autocomplete to use authenticated, provider-specific model catalogs (rather than static alias lists), and emits deterministic completions including --provider for disambiguation across providers. It wires the behavior through both classic CLI completion and TUI slash completion, and adds regression tests for provider-aware completion behavior.
Changes:
- Build
/modelcompletions fromlist_authenticated_providers()catalogs and emit"<model> --provider <slug>"suggestions. - Thread session context into TUI slash completion requests so the gateway can prefer the session’s current provider when generating suggestions.
- Add regression tests covering provider disambiguation and authenticated-only model completion behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
hermes_cli/commands.py |
Replaces alias-based /model completions with authenticated provider catalog-based completions (with caching + deterministic sorting). |
cli.py |
Wires classic CLI prompt completer to use provider-aware model catalogs. |
tui_gateway/server.py |
Extends complete.slash to accept session_id and supply provider-aware model catalogs to the completer. |
ui-tui/src/hooks/useCompletion.ts |
Sends session_id with TUI complete.slash requests. |
tests/hermes_cli/test_ollama_cloud_auth.py |
Updates/extends tests to assert authenticated provider-aware /model completions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/modelautocomplete suggestions from authenticated provider catalogs instead of static alias lists.<model> --provider <provider_slug>so duplicate model names across providers stay clear.Closes #14352.
Related to #13621 and prior autocomplete work in #1641.
Testing
source venv/bin/activate && python -m py_compile hermes_cli/commands.py cli.py tui_gateway/server.pycd ui-tui && npm run type-checkcd ui-tui && npm run lintsource venv/bin/activate && python -m pytest tests/hermes_cli/test_ollama_cloud_auth.py::TestModelTabCompletion tests/hermes_cli/test_commands.py::TestSlashCommandCompleter tests/test_tui_gateway_server.py::test_complete_slash_surfaces_completer_error -q -n 4— 16 passedsource venv/bin/activate && python -m pytest tests/hermes_cli/test_commands.py tests/hermes_cli/test_ollama_cloud_auth.py tests/test_tui_gateway_server.py -q -n 4— 199 passed/model sonnetand/model gpt-5.4autocomplete now return concretemodel --provider slugoptions from authenticated providers.Full-suite note
scripts/run_tests.sh ...could not run in my local venv becausevenv/bin/pythonhas nopip, and the wrapper tries to installpytest-split.source venv/bin/activate && python -m pytest tests/ -q -n 4; it reported76 failed, 14683 passed, 53 skipped.upstream/mainworktree atfa8f0c6f, which produced the same76 failed, 14683 passed, 53 skippedresult. The full-suite failures appear to be pre-existing/local baseline failures, not introduced by this branch.