Skip to content

Chat-first new drive setup - #1263

Open
joepio wants to merge 1 commit into
developfrom
cursor/drive-setup-chat-6a73
Open

Chat-first new drive setup#1263
joepio wants to merge 1 commit into
developfrom
cursor/drive-setup-chat-6a73

Conversation

@joepio

@joepio joepio commented Aug 13, 2026

Copy link
Copy Markdown
Member

New Drive now starts as a conversation: the assistant asks what the drive is for, can take hints like a company website, and builds a small starter workspace from existing table templates.

What changed

  • Bundled drive-setup skill (read_skill / attached as chat context) that interviews the user, researches a URL or company name via web search, renames the drive, and creates a few matching tables/folders/docs — not every template.
  • NewDriveSetup reuses RealAIChat (lazy-loaded) in the New Drive dialog and /app/new-drive page, with starter prompts and the skill pre-attached.
  • The first chat message creates the drive, switches to it (store.setDrive + a React flush), then the agent writes into that drive.
  • Name + Create still makes an empty drive, so newDrive() in e2e is unchanged.

Tests

  • Unit: driveNameFromPrompt (URL host, first line, truncation, empty fallback).
  • Existing e2e empty-create path should keep working (same Name label and Create button).
  • The live chat/skill path is not e2e-tested; it needs a configured model.

Checklist

  • Add or update tests if needed
  • Add changelog entry linking to issue, describe API changes
  • Update docs if needed
Open in Web Open in Cursor 

New Drive now asks what the workspace is for and reuses RealAIChat plus a
bundled skill to research hints (like a company website) and build a small
starter template. The name + Create path still creates an empty drive so
existing e2e helpers keep working.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@joepio
joepio marked this pull request as ready for review August 13, 2026 16:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: File-only messages no longer send
    • Moved empty text check after onBeforeSubmit and added attachedFiles.length check to allow file-only messages.
  • ✅ Fixed: Setup race creates two drives
    • Added busy state management in handleBeforeChatSubmit to prevent concurrent drive creation attempts.
  • ✅ Fixed: Failed create clears the prompt
    • Made AIChatInput await onSubmit promise and only clear the input on success, preserving prompt on error.

Create PR

Or push these changes by commenting:

@cursor push e691c651f4
Preview (e691c651f4)
diff --git a/browser/data-browser/src/chunks/AI/RealAIChat.tsx b/browser/data-browser/src/chunks/AI/RealAIChat.tsx
--- a/browser/data-browser/src/chunks/AI/RealAIChat.tsx
+++ b/browser/data-browser/src/chunks/AI/RealAIChat.tsx
@@ -540,10 +540,6 @@
       return;
     }
 
-    if (text.trim() === '') {
-      return;
-    }
-
     if (onBeforeSubmit) {
       try {
         await onBeforeSubmit(text);
@@ -558,6 +554,10 @@
       }
     }
 
+    if (text.trim() === '' && attachedFiles.length === 0) {
+      return;
+    }
+
     const context = [...externalContextItems, ...userSelectedContextItems];
     const message: AtomicUIMessage = {
       id: store.newLocalId(),

diff --git a/browser/data-browser/src/chunks/RTE/AIChatInput/AsyncAIChatInput.tsx b/browser/data-browser/src/chunks/RTE/AIChatInput/AsyncAIChatInput.tsx
--- a/browser/data-browser/src/chunks/RTE/AIChatInput/AsyncAIChatInput.tsx
+++ b/browser/data-browser/src/chunks/RTE/AIChatInput/AsyncAIChatInput.tsx
@@ -97,7 +97,7 @@
   large?: boolean;
   onMentionUpdate: (mentions: MentionItem[]) => void;
   onChange: (markdown: string) => void;
-  onSubmit: () => void;
+  onSubmit: () => void | Promise<void>;
   onCompact?: () => void;
   onEditModel?: () => void;
   onEditAgent?: () => void;
@@ -167,9 +167,15 @@
                 }
 
                 // The content has to be read from a ref because this callback is not updated often leading to stale content.
-                onSubmitRef.current();
-                setMarkdown('');
-                this.editor.commands.clearContent();
+                Promise.resolve(onSubmitRef.current()).then(
+                  () => {
+                    setMarkdown('');
+                    this.editor.commands.clearContent();
+                  },
+                  () => {
+                    // Keep the input on error
+                  },
+                );
 
                 return true;
               },
@@ -301,9 +307,15 @@
               disabled || disableSubmit || (markdown.length === 0 && !hasFiles)
             }
             onClick={() => {
-              onSubmit();
-              setMarkdown('');
-              editor?.commands.clearContent();
+              Promise.resolve(onSubmit()).then(
+                () => {
+                  setMarkdown('');
+                  editor?.commands.clearContent();
+                },
+                () => {
+                  // Keep the input on error
+                },
+              );
             }}
             title='Send'
             variant={IconButtonVariant.Fill}

diff --git a/browser/data-browser/src/components/Drives/NewDriveSetup.tsx b/browser/data-browser/src/components/Drives/NewDriveSetup.tsx
--- a/browser/data-browser/src/components/Drives/NewDriveSetup.tsx
+++ b/browser/data-browser/src/components/Drives/NewDriveSetup.tsx
@@ -127,6 +127,12 @@
       return;
     }
 
+    if (busy) {
+      throw new Error('Drive is already being created, please wait.');
+    }
+
+    setBusy(true);
+
     try {
       await createDrive(driveNameFromPrompt(text));
     } catch (err) {
@@ -134,6 +140,8 @@
         err instanceof Error ? err : new Error('Could not create the drive.');
       store.notifyError(asError);
       throw asError;
+    } finally {
+      setBusy(false);
     }
   };

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit e30b1ce. Configure here.


if (text.trim() === '') {
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File-only messages no longer send

Medium Severity

The new empty-text return in handleSubmit bails out before attachments are added, so a send with files and no caption is dropped. The input already allows that case when hasFiles is set, which previously produced an image-only message.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e30b1ce. Configure here.

store.notifyError(asError);
throw asError;
}
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup race creates two drives

Medium Severity

The first chat send creates a drive only after await store.createDrive, and createdDrive / busy are not shared with that path. While that request is in flight, starter prompts and the Name/Create form stay active, so a second submit can create another drive.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e30b1ce. Configure here.

setRequestError(message);

return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed create clears the prompt

Medium Severity

onBeforeSubmit is documented to keep the typed message when it throws, but the input clears before that promise settles. A failed drive create therefore wipes the prompt and surfaces it as a provider error whose Try again calls regenerate even though no message was sent.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e30b1ce. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants