handleModelCommand is a shorthand for `/switch --model `: it changes only the model of the current provider without the longer flag form. With no argument it lists the available models (same as bare `/switch --model`). It delegates to handleSwitchCommand so model-cache refresh, error handling
(ctx context.Context, input string)
| 337 | // delegates to handleSwitchCommand so model-cache refresh, error handling and |
| 338 | // the gateway runtime-state mirror all stay in one place. |
| 339 | func (cli *ChatCLI) handleModelCommand(ctx context.Context, input string) { |
| 340 | rest := strings.TrimSpace(strings.TrimPrefix(input, "/model")) |
| 341 | if rest == "" { |
| 342 | cli.handleSwitchCommand(ctx, "/switch --model") |
| 343 | return |
| 344 | } |
| 345 | cli.handleSwitchCommand(ctx, "/switch --model "+rest) |
| 346 | } |
| 347 | |
| 348 | func (cli *ChatCLI) handleSwitchCommand(ctx context.Context, userInput string) { |
| 349 | args := strings.Fields(userInput) |
no test coverage detected