diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index efff57180e..4d650487b4 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -103,7 +103,8 @@ COMMAND_REGISTRY: list[CommandDef] = [ # Configuration CommandDef("config", "Show current configuration", "Configuration", cli_only=True), - CommandDef("model", "Switch model for this session", "Configuration", args_hint="[model] [--provider name] [--global]"), + CommandDef("model", "Switch model for this session", "Configuration", + aliases=("provider",), args_hint="[model] [--provider name] [--global]"), CommandDef("gquota", "Show Google Gemini Code Assist quota usage", "Info", cli_only=True), diff --git a/tests/test_tui_gateway_server.py b/tests/test_tui_gateway_server.py index 8bb6f003bf..4fd2322b5b 100644 --- a/tests/test_tui_gateway_server.py +++ b/tests/test_tui_gateway_server.py @@ -321,6 +321,14 @@ def test_setup_status_reports_provider_config(monkeypatch): assert resp["result"]["provider_configured"] is False +def test_complete_slash_includes_provider_alias(): + resp = server.handle_request( + {"id": "1", "method": "complete.slash", "params": {"text": "/pro"}} + ) + + assert any(item["text"] == "provider" for item in resp["result"]["items"]) + + def test_config_set_reasoning_updates_live_session_and_agent(tmp_path, monkeypatch): monkeypatch.setattr(server, "_hermes_home", tmp_path) agent = types.SimpleNamespace(reasoning_config=None) diff --git a/ui-tui/src/__tests__/createSlashHandler.test.ts b/ui-tui/src/__tests__/createSlashHandler.test.ts index eba1d56d86..9a255f704c 100644 --- a/ui-tui/src/__tests__/createSlashHandler.test.ts +++ b/ui-tui/src/__tests__/createSlashHandler.test.ts @@ -17,6 +17,14 @@ describe('createSlashHandler', () => { expect(getOverlayState().picker).toBe(true) }) + it('treats /provider as a local /model alias', () => { + const ctx = buildCtx() + + expect(createSlashHandler(ctx)('/provider')).toBe(true) + expect(getOverlayState().modelPicker).toBe(true) + expect(ctx.gateway.gw.request).not.toHaveBeenCalled() + }) + it('opens the skills hub locally for bare /skills', () => { const ctx = buildCtx() diff --git a/ui-tui/src/app/slash/commands/session.ts b/ui-tui/src/app/slash/commands/session.ts index cf36fee6c8..1049ee34d8 100644 --- a/ui-tui/src/app/slash/commands/session.ts +++ b/ui-tui/src/app/slash/commands/session.ts @@ -58,6 +58,7 @@ export const sessionCommands: SlashCommand[] = [ { help: 'change or show model', + aliases: ['provider'], name: 'model', run: (arg, ctx) => { if (ctx.session.guardBusySessionSwitch('change models')) { diff --git a/ui-tui/src/app/slash/commands/setup.ts b/ui-tui/src/app/slash/commands/setup.ts index d9a948e541..bf1a29c685 100644 --- a/ui-tui/src/app/slash/commands/setup.ts +++ b/ui-tui/src/app/slash/commands/setup.ts @@ -5,18 +5,6 @@ import { runExternalSetup } from '../../setupHandoff.js' import type { SlashCommand } from '../types.js' export const setupCommands: SlashCommand[] = [ - { - help: 'configure LLM provider + model (launches `hermes model`)', - name: 'provider', - run: (_arg, ctx) => - void runExternalSetup({ - args: ['model'], - ctx, - done: 'provider updated — starting session…', - launcher: launchHermesCommand, - suspend: withInkSuspended - }) - }, { help: 'run full setup wizard (launches `hermes setup`)', name: 'setup',