Skip to content

/model --global does not persist when using the visual model picker #28034

@Yuze075

Description

@Yuze075

Bug Description

When running /model --global without specifying a model name, Hermes opens the visual model picker. After selecting a model in that picker, the selected model is applied only to the current session and is not persisted to config.yaml.

This is surprising because the user explicitly supplied --global. It makes the visual picker much less useful for choosing the default model and can cause Hermes to revert to the previous default model on the next launch.

Steps to Reproduce

  1. Start Hermes CLI.
  2. Run /model --global.
  3. Use the visual picker to select a different provider/model.
  4. Exit Hermes and start it again, or inspect ~/.hermes/config.yaml.

Expected Behavior

The model selected through the visual picker should be persisted globally when the picker was opened from /model --global.

model.default and, when the provider changes, model.provider should be updated in ~/.hermes/config.yaml.

Actual Behavior

The selected model is applied only to the current session. The confirmation behaves like a session-only switch, and the next launch uses the previous global default.

Likely Cause

In the CLI flow, /model --global parses persist_global = True, but the picker-opening path does not preserve that flag.

Relevant flow observed in cli.py:

  • _handle_model_switch() parses persist_global from parse_model_flags().
  • When no model/provider is provided, it opens the picker with _open_model_picker(...).
  • _open_model_picker() does not accept/store persist_global in _model_picker_state.
  • Later, picker selection calls _handle_model_picker_selection() whose default is persist_global: bool = False.

So the --global flag is effectively dropped for visual picker selections.

Proposed Fix

Thread persist_global through the picker state:

  1. Let _open_model_picker(..., persist_global=False) accept the flag.
  2. Store it in _model_picker_state.
  3. When handling Enter/selection, read it from state and pass it to _handle_model_picker_selection() / _apply_model_switch_result().
  4. Optionally show UI copy like “global” vs “session only” in the picker header/confirmation.

Why This Matters

Users often prefer the visual picker because model/provider names are hard to remember. If /model --global works for direct text input but not for visual selection, the behavior feels inconsistent and causes accidental reversion to old default models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    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