Skip to content

feat(cli): make /model autocomplete provider-aware#14381

Open
douglascorrea wants to merge 2 commits into
NousResearch:mainfrom
douglascorrea:feat/authenticated-model-autocomplete
Open

feat(cli): make /model autocomplete provider-aware#14381
douglascorrea wants to merge 2 commits into
NousResearch:mainfrom
douglascorrea:feat/authenticated-model-autocomplete

Conversation

@douglascorrea

Copy link
Copy Markdown

Summary

  • Build /model autocomplete suggestions from authenticated provider catalogs instead of static alias lists.
  • Emit deterministic completions as <model> --provider <provider_slug> so duplicate model names across providers stay clear.
  • Wire the same provider-aware completion behavior through classic CLI and TUI slash completion.
  • Add regression coverage for authenticated-only model completions and provider disambiguation.

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.py
  • cd ui-tui && npm run type-check
  • cd ui-tui && npm run lint
  • source 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 passed
  • source 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
  • Manual smoke test: verified /model sonnet and /model gpt-5.4 autocomplete now return concrete model --provider slug options from authenticated providers.

Full-suite note

  • scripts/run_tests.sh ... could not run in my local venv because venv/bin/python has no pip, and the wrapper tries to install pytest-split.
  • I ran the full suite directly with source venv/bin/activate && python -m pytest tests/ -q -n 4; it reported 76 failed, 14683 passed, 53 skipped.
  • I also ran the same direct full-suite command in a clean detached upstream/main worktree at fa8f0c6f, which produced the same 76 failed, 14683 passed, 53 skipped result. The full-suite failures appear to be pre-existing/local baseline failures, not introduced by this branch.

Copilot AI review requested due to automatic review settings April 23, 2026 04:56

Copilot AI 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.

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 /model completions from list_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.

Comment thread ui-tui/src/hooks/useCompletion.ts
Comment thread tui_gateway/server.py
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make /model autocomplete provider-aware and authenticated-only

3 participants