From edd08864c6da393a9928f32489c0483240baefb0 Mon Sep 17 00:00:00 2001 From: can1357 Date: Wed, 13 May 2026 06:20:07 +0200 Subject: [PATCH] fix(coding-agent/slash-commands): fixed slash command shutdown handler return contract - Updated the TUI shutdown slash command handler to return a `SlashCommandResult` instead of `void`. - Returned `commandConsumed()` after clearing the editor and invoking runtime shutdown. - Imported `SkillPromptDetails` as a type in the input controller message imports. --- .../coding-agent/src/modes/controllers/input-controller.ts | 2 +- packages/coding-agent/src/slash-commands/builtin-registry.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/src/modes/controllers/input-controller.ts b/packages/coding-agent/src/modes/controllers/input-controller.ts index 81ac5945b..b3885662d 100644 --- a/packages/coding-agent/src/modes/controllers/input-controller.ts +++ b/packages/coding-agent/src/modes/controllers/input-controller.ts @@ -8,7 +8,7 @@ import { createPromptActionAutocompleteProvider } from "../../modes/prompt-actio import { theme } from "../../modes/theme/theme"; import type { InteractiveModeContext } from "../../modes/types"; import type { AgentSessionEvent } from "../../session/agent-session"; -import { SKILL_PROMPT_MESSAGE_TYPE } from "../../session/messages"; +import { SKILL_PROMPT_MESSAGE_TYPE, type SkillPromptDetails } from "../../session/messages"; import { executeBuiltinSlashCommand } from "../../slash-commands/builtin-registry"; import { copyToClipboard, readImageFromClipboard } from "../../utils/clipboard"; import { getEditorCommand, openInEditor } from "../../utils/external-editor"; diff --git a/packages/coding-agent/src/slash-commands/builtin-registry.ts b/packages/coding-agent/src/slash-commands/builtin-registry.ts index f0b62a713..92598465e 100644 --- a/packages/coding-agent/src/slash-commands/builtin-registry.ts +++ b/packages/coding-agent/src/slash-commands/builtin-registry.ts @@ -51,9 +51,10 @@ function refreshStatusLine(ctx: InteractiveModeContext): void { ctx.ui.requestRender(); } -const shutdownHandlerTui = (_command: ParsedSlashCommand, runtime: TuiSlashCommandRuntime): void => { +const shutdownHandlerTui = (_command: ParsedSlashCommand, runtime: TuiSlashCommandRuntime): SlashCommandResult => { runtime.ctx.editor.setText(""); void runtime.ctx.shutdown(); + return commandConsumed(); }; const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray = [