Skip to content

Commit 8c750f5

Browse files
author
mb
committed
fix(tui): busy-gate /skill command while turn is active
1 parent 5c0a79d commit 8c750f5

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

apps/kimi-code/src/tui/commands/dispatch.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,10 +622,27 @@ async function handleSkillCommand(
622622
host: SlashCommandHost,
623623
args: string,
624624
): Promise<void> {
625+
const busyReason = slashCommandBusyReason({
626+
isStreaming: host.state.appState.streamingPhase !== 'idle',
627+
isCompacting: host.state.appState.isCompacting,
628+
});
629+
if (busyReason !== undefined) {
630+
host.showError(slashBusyMessage('skill', busyReason));
631+
return;
632+
}
633+
625634
let session = host.session;
626635
if (session === undefined) {
627636
session = await ensureSessionForCommand(host);
628637
if (session === undefined) return;
638+
const busyCheck = slashCommandBusyReason({
639+
isStreaming: host.state.appState.streamingPhase !== 'idle',
640+
isCompacting: host.state.appState.isCompacting,
641+
});
642+
if (busyCheck !== undefined) {
643+
host.showError(slashBusyMessage('skill', busyCheck));
644+
return;
645+
}
629646
}
630647

631648
let skills: readonly SkillSummary[] = [];
@@ -667,6 +684,14 @@ async function handleSkillCommand(
667684

668685
const selectedSkill = await runSkillSelector(host, activatableSkills);
669686
if (selectedSkill !== undefined) {
687+
const busyCheck = slashCommandBusyReason({
688+
isStreaming: host.state.appState.streamingPhase !== 'idle',
689+
isCompacting: host.state.appState.isCompacting,
690+
});
691+
if (busyCheck !== undefined) {
692+
host.showError(slashBusyMessage('skill', busyCheck));
693+
return;
694+
}
670695
host.sendSkillActivation(session, selectedSkill.name, '');
671696
}
672697
}

apps/kimi-code/src/tui/commands/registry.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ export const BUILTIN_SLASH_COMMANDS = [
211211
aliases: ['skills'],
212212
description: 'Select skill from hierarchical group selector',
213213
priority: 90,
214-
availability: 'always',
215214
},
216215
{
217216
name: 'btw',

0 commit comments

Comments
 (0)