Skip to content

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

@douglascorrea

Description

@douglascorrea

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 [Bug]: TUI /model with trailing space skips ModelPicker, custom providers missing from completions #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 feat(cli): two-stage /model autocomplete with ghost text suggestions #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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardtype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions