feat(cli): add /model slash command to show or set Claude model#603
Closed
metowolf wants to merge 1 commit intotiann:mainfrom
Closed
feat(cli): add /model slash command to show or set Claude model#603metowolf wants to merge 1 commit intotiann:mainfrom
metowolf wants to merge 1 commit intotiann:mainfrom
Conversation
- Parse /model [name|auto] in specialCommands.ts with full test coverage - Handle the command in runClaude.ts: show current model when no arg is given, or update the session model when a name/auto is provided - Register /model in the built-in slash command list with a description
There was a problem hiding this comment.
Findings
- No findings.
Summary
- Review mode: initial
- Reviewed the latest diff for the Claude
/modelparser, runner handling, slash-command registration, and parser tests. No high-confidence issues found in the modified lines. - Residual risk/testing gap: handler side effects in
cli/src/claude/runClaude.ts(setModel,pushKeepAlive, consumed local id, emitted status message) are not covered by a focused runner test; current added coverage is parser-level only.
Testing
- Not run (automation)
HAPI Bot
Owner
|
I don’t think this is a good idea. Codex / Claude Code have slash-command functionality because they are TUIs, whereas we are on the web, with buttons and dialogs, so there’s no need to use this kind of interaction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/modelslash command that allows users to view or switch the Claude model during a session./model(no argument) — prints the currently active model (e.g.Claude model: claude-sonnet-4-6)./model <name>— switches the session to the given model (e.g./model claude-opus-4-7)./model auto— resets the session to the default/auto model selection.Changes
cli/src/parsers/specialCommands.ts— AddedparseModel()function andModelCommandResultinterface; wired intoparseSpecialCommand()which now returnstype: 'model'and the optional model string.cli/src/parsers/specialCommands.test.ts— Full unit-test coverage forparseModeland the/modelcases inparseSpecialCommand.cli/src/claude/runClaude.ts— HandlespecialCommand.type === 'model': show current model when no argument is supplied, or callsetModel/pushKeepAlivewhen a model name is given.cli/src/modules/common/slashCommands.ts— Register/modelin the built-in command list with a description so it appears in autocomplete / help.Test plan
vitest— all existing and new tests pass./modelin a session — response showsClaude model: <current>./model claude-opus-4-7— response showsClaude model set to claude-opus-4-7and subsequent messages use that model./model auto— resets to default model selection./modelerand other partial matches do not trigger the command.