hermes - ✅(Solved) Fix [Feature]: Make /model autocomplete provider-aware and authenticated-only [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#14352Fetched 2026-04-24 06:17:41
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Fix Action

Fixed

PR fix notes

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

Description (problem / solution / changelog)

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.

Changed files

  • cli.py (modified, +12/-0)
  • hermes_cli/commands.py (modified, +110/-29)
  • tests/hermes_cli/test_ollama_cloud_auth.py (modified, +47/-48)
  • tests/test_tui_gateway_server.py (modified, +46/-0)
  • tui_gateway/server.py (modified, +70/-1)
  • ui-tui/src/hooks/useCompletion.ts (modified, +14/-8)

Code Example

claude-sonnet-4-6 --provider opencode-zen
anthropic/claude-sonnet-4.6 --provider openrouter
claude-sonnet-4.6 --provider copilot

---

model:
  autocomplete_mode: aliases        # current behavior
  # autocomplete_mode: authenticated

---
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Today /model autocomplete suggests aliases/static model aliases instead of the concrete provider/model combinations that are actually usable in the current session/profile.

That makes the command confusing when multiple providers are configured:

  • autocomplete can suggest aliases that do not belong to the current provider
  • it does not clearly show which authenticated provider will be used
  • it does not disambiguate the same model name across multiple providers
  • it can diverge from the no-argument /model picker, which already works from authenticated provider availability

Example: typing /model sonnet may show an alias-like suggestion, but the actual switch can resolve through provider fallback. Users should be able to see the concrete authenticated options before selecting one.

Related to #13621, but distinct: that issue covers TUI trailing-space behavior and custom provider models missing from completions. This request is specifically about making /model autocomplete provider-aware and authenticated-only.

Proposed Solution

Build /model completions from the same authenticated provider catalog used by the no-argument /model picker.

Suggested behavior:

  • only include providers that are authenticated/available in the current profile/session
  • complete concrete model IDs rather than alias names
  • emit completions as <model> --provider <provider_slug> so selection is deterministic
  • if the same model is available from multiple providers, show one option per provider
  • filter typed text against model IDs across all authenticated providers
  • make classic CLI and TUI slash completion use the same behavior

For example, if several authenticated providers expose Sonnet models, /model sonnet should produce explicit options such as:

claude-sonnet-4-6 --provider opencode-zen
anthropic/claude-sonnet-4.6 --provider openrouter
claude-sonnet-4.6 --provider copilot

If maintainers prefer backward compatibility, this could be controlled by a config flag, for example:

model:
  autocomplete_mode: aliases        # current behavior
  # autocomplete_mode: authenticated

I am happy to submit a PR for this.

Alternatives Considered

Alternatives considered:

  • Keep the current alias-based autocomplete. This is backward compatible, but it hides provider resolution and can suggest values that do not reflect authenticated provider availability.
  • Require users to type --provider manually. This works for advanced users, but it makes discovery worse and does not help with duplicate model names.
  • Only add custom_providers models to the current completion list, as discussed in #13621. That would help one case, but it still would not make autocomplete match authenticated provider availability.
  • Return to a two-stage provider/model flow like the older work in #1641. That is useful prior art, but concrete <model> --provider <slug> completions are easier to select and match the current /model command form.

Feature Type

CLI improvement

Scope

Medium (few files, < 300 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

Modify the /model autocomplete to build completions from the authenticated provider catalog, including only concrete model IDs and filtering by typed text.

Guidance

  • Update the autocomplete logic to use the same authenticated provider catalog as the no-argument /model picker.
  • Change the completion format to <model> --provider <provider_slug> for deterministic selection.
  • Filter the completion list to only include models from authenticated providers that match the typed text.
  • Consider adding a config flag to control the autocomplete mode, allowing for backward compatibility.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The proposed solution aims to improve the usability of the /model command by making the autocomplete provider-aware and authenticated-only. However, the implementation details may vary depending on the underlying codebase and architecture.

Recommendation

Apply the proposed workaround by modifying the autocomplete logic to use the authenticated provider catalog and including the provider slug in the completion format, as this approach addresses the main concerns with the current implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING