We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5ee8aa2 + 880bbdb commit dc741daCopy full SHA for dc741da
mito-ai/src/Extensions/AiChat/ChatTaskpane.tsx
@@ -587,11 +587,17 @@ const ChatTaskpane: React.FC<IChatTaskpaneProps> = ({
587
break;
588
}
589
590
- // Insert a new cell for the next step
591
- await app.commands.execute("notebook:insert-cell-below")
+ // Only create a new cell if the AI generated code in its response
+ if (aiMessage?.message) {
592
+ const aiGeneratedCode = getCodeBlockFromMessage(aiMessage.message);
593
+ if (aiGeneratedCode) {
594
+ // Insert a new cell for the next step
595
+ await app.commands.execute("notebook:insert-cell-below")
596
- // Wait for the new cell to be created
- await sleep(1000)
597
+ // Wait for the new cell to be created
598
+ await sleep(1000)
599
+ }
600
601
602
603
setAgentExecutionStatus('idle')
0 commit comments