fix(tui): handle /model status and /model list subcommands

Previously `/model status` in the TUI would try to set the model to
"status", resulting in "model not allowed: anthropic/status" error.

Now the TUI correctly handles:
- `/model status` - shows current model information
- `/model list` - opens the model selector (same as /models)

Fixes #3469

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zerone0x 2026-01-29 01:40:39 +08:00
parent 8d3f594ff6
commit c68283c896

View File

@ -278,6 +278,19 @@ export function createCommandHandlers(context: CommandHandlerContext) {
case "model":
if (!args) {
await openModelSelector();
} else if (args === "status") {
// Show current model information
const provider = state.sessionInfo.modelProvider ?? "unknown";
const model = state.sessionInfo.model ?? "unknown";
const current = `${provider}/${model}`;
chatLog.addSystem(
[`Current: ${current}`, "", "Switch: /model <provider/model>", "Browse: /models"].join(
"\n",
),
);
} else if (args === "list") {
// /model list is an alias for /models
await openModelSelector();
} else {
try {
await client.patchSession({