@@ -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}
0 commit comments