diff --git a/apps/studio/components/interfaces/ExplorerPrototype/ExplorerPrototype.test.tsx b/apps/studio/components/interfaces/ExplorerPrototype/ExplorerPrototype.test.tsx index 2e471c8fd22..43979d87c98 100644 --- a/apps/studio/components/interfaces/ExplorerPrototype/ExplorerPrototype.test.tsx +++ b/apps/studio/components/interfaces/ExplorerPrototype/ExplorerPrototype.test.tsx @@ -231,13 +231,13 @@ describe('home launch surface', () => { }) describe('assistant notebook creation', () => { - it('creates and runs a notebook resource when the Assistant proposal is approved', async () => { + it('creates a notebook resource when the Assistant proposal is approved', () => { const { result } = customRenderHook(() => useExplorerPrototypeState()) const message = INITIAL_CHATS['chat-2'].messages.find((entry) => 'notebook' in entry) if (!message || !('notebook' in message)) throw new Error('Expected an assistant notebook') - await act(async () => + act(() => result.current.createNotebookFromChat( 'chat-2', message.id, @@ -398,7 +398,7 @@ describe('agent chat surface', () => { expect(screen.getByText('OAuth signups by provider')).toBeInTheDocument() expect(screen.getAllByRole('button', { name: 'Hide SQL' })).toHaveLength(2) expect(screen.getByText('The Assistant wants to create this notebook.')).toBeInTheDocument() - expect(screen.getByRole('button', { name: 'Create and run' })).toBeInTheDocument() + expect(screen.getByRole('button', { name: 'Create notebook' })).toBeInTheDocument() }) it('runs the query once approved and reports the row count', async () => { diff --git a/apps/studio/components/interfaces/ExplorerPrototype/useExplorerPrototypeState.ts b/apps/studio/components/interfaces/ExplorerPrototype/useExplorerPrototypeState.ts index 08f3997f861..902441a33e5 100644 --- a/apps/studio/components/interfaces/ExplorerPrototype/useExplorerPrototypeState.ts +++ b/apps/studio/components/interfaces/ExplorerPrototype/useExplorerPrototypeState.ts @@ -340,7 +340,7 @@ export const useExplorerPrototypeState = () => { } } - const createNotebookFromChat = async ( + const createNotebookFromChat = ( chatId: string, messageId: string, title: string, @@ -353,12 +353,6 @@ export const useExplorerPrototypeState = () => { setChatApproval(chatId, messageId, 'approved') markModified(resource) openTab(resource, title) - - for (const cell of notebook.cells) { - if (cell.type !== 'query') continue - if (isWriteQuery(cell.query.sql)) break - await runCell(cell, resolveEffectiveRowLimit(cell, notebook.settings)) - } } return { diff --git a/apps/studio/components/interfaces/ExplorerPrototype/views/ChatView.tsx b/apps/studio/components/interfaces/ExplorerPrototype/views/ChatView.tsx index e24b3a8d49e..8a33c0665ac 100644 --- a/apps/studio/components/interfaces/ExplorerPrototype/views/ChatView.tsx +++ b/apps/studio/components/interfaces/ExplorerPrototype/views/ChatView.tsx @@ -194,7 +194,7 @@ export const ChatView = ({ {isPending && ( onDeny(message.id)} onConfirm={() => onApproveNotebook(