fix(tui): distinguish /new and /reset descriptions

Fixes #49517.

Updates the TUI command catalog so /new describes spawning an isolated session while /reset describes resetting the current session. Adds a focused regression test for the two descriptions.

Co-authored-by: KhanCold <119404710+KhanCold@users.noreply.github.com>
This commit is contained in:
史启明(QimingShi)
2026-05-31 00:50:14 +08:00
committed by GitHub
parent 2a39c217c8
commit 63a3676d3c
2 changed files with 10 additions and 2 deletions

View File

@@ -39,6 +39,14 @@ describe("getSlashCommands", () => {
expect(crestodian?.description).toBe("Return to Crestodian");
});
it("distinguishes new-session and reset command descriptions", () => {
const commands = getSlashCommands();
const newSession = commands.find((command) => command.name === "new");
const reset = commands.find((command) => command.name === "reset");
expect(newSession?.description).toBe("Spawn a new isolated session");
expect(reset?.description).toBe("Reset the current session");
});
it("uses session-provided thinking levels for completions", () => {
const commands = getSlashCommands({
provider: "ollama",

View File

@@ -150,8 +150,8 @@ export function getSlashCommands(options: SlashCommandOptions = {}): SlashComman
getArgumentCompletions: activationCompletions,
},
{ name: "abort", description: "Abort active run" },
{ name: "new", description: "Reset the session" },
{ name: "reset", description: "Reset the session" },
{ name: "new", description: "Spawn a new isolated session" },
{ name: "reset", description: "Reset the current session" },
{ name: "settings", description: "Open settings" },
{ name: "exit", description: "Exit the TUI" },
{ name: "quit", description: "Exit the TUI" },