-
Notifications
You must be signed in to change notification settings - Fork 13
🤖 feat: AI-generated workspace creation on first message #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Add workspaceTitleGenerator service using Vercel AI SDK - Generate human-readable titles and git-safe branch names - Add sendFirstMessage IPC handler that creates workspace automatically - Add ProjectSelector and FirstMessageInput components for empty state - Update App.tsx to show project selector when no workspace exists - Gracefully fall back to timestamp names if AI generation fails Users can now type a message and hit send to create a workspace with an AI-generated title and branch name based on their message. Generated with `cmux`
The 'name' field is used throughout the backend to compute filesystem paths (e.g., runtime.getWorkspacePath uses metadata.name as the directory). Storing the AI-generated title there would break path resolution. Solution: - Add optional 'displayName' field to WorkspaceMetadata - Store git-safe branch name in 'name' (used for paths) - Store human-readable title in 'displayName' (used for display) - UI prefers displayName over name when rendering This maintains backward compatibility - existing workspaces without displayName continue to work, showing the branch name as before. Generated with `cmux`
FirstMessageInput was using useSendMessageOptions which internally uses useThinking hook, causing 'useThinking must be used within a ThinkingProvider' error in E2E tests when empty state was rendered. Instead, directly use useModelLRU to get the most recent model without requiring context providers. Generated with `cmux`
Instead of showing a project selector dropdown when no workspace is selected, we now: - If only one project exists: Show FirstMessageInput immediately - If multiple projects exist: Show welcome message asking user to select/create workspace via sidebar This is cleaner UX - users already interact with projects via the left sidebar, no need for duplicate selection UI. Generated with `cmux`
1. Merge sendFirstMessage into sendMessage - make workspaceId optional to reduce duplication in IPC layer. When null, automatically creates workspace with AI-generated title/branch. 2. Use standard useSendMessageOptions in FirstMessageInput instead of manually managing model selection. 3. Use the same model as provided in send message options for title generation instead of hardcoding cheap models. This respects custom BaseURL configurations and avoids manual updates when models change. 4. Remove redundant WORKSPACE_SEND_FIRST_MESSAGE IPC channel and handler. Generated with `cmux`
useSendMessageOptions internally uses useThinking which requires ThinkingProvider context. Since FirstMessageInput is rendered outside of context providers, manually build send options instead. Generated with `cmux`
Fixes floating promise lint error in sendMessage when creating workspaces without explicit workspaceId. editConfig() returns a promise that must be awaited before continuing to retrieve the complete metadata.
Changes workspace creation UX to show FirstMessageInput instead of NewWorkspaceModal when user clicks the '+ Add Workspace' button. User flow: 1. Click '+ Add Workspace' in sidebar 2. See FirstMessageInput (same as single-project empty state) 3. Type message and hit send 4. Workspace created with AI-generated title/branch 5. Message sent to new workspace Added cancel functionality: - Escape key cancels workspace creation - Cancel button shown when in 'add workspace' mode - Returns user to empty state on cancel NewWorkspaceModal still exists for advanced users (can be triggered via command palette or other flows in the future).
Redesigned FirstMessageInput to use the same visual style as ChatInput for a unified user experience. Changes: - Replaced custom textarea with VimTextArea component (matches ChatInput) - Added ModelSelector component for choosing AI model - Added runtime config selector (Local vs SSH) with SSH host input - Styled with same CSS classes as ChatInput (bg-separator, border-border-light, etc.) - Options displayed inline below input (Model | Runtime | Cancel/Send) - Added helpful tooltip for runtime configuration All workspace creation options now visible and accessible without needing to open a separate modal.
Changes: - Removed Send and Cancel buttons (use Cmd+Enter to send like ChatInput) - Input now takes full width (removed button constraints) - Added project title in center of empty view - Shows trunk branch below project name (auto-detected, informational) - Removed manual trunk branch selector (backend auto-detects it) - Cleaner, more unified UX matching ChatInput behavior
- Import useMode hook from ModeContext - Add MODE_OPTIONS and ModeHelpTooltip (matching ChatInput) - Add mode selector UI with responsive layouts (full and compact) - VimTextArea now uses mode state instead of hardcoded 'exec' - Includes tooltip explaining Exec vs Plan mode Related to #500
…ut backend - Import useThinkingLevel, use1MContext hooks and policy utilities - Build SendMessageOptions with all required fields (mode, toolPolicy, thinkingLevel, providerOptions) - Add ThinkingSliderComponent and Context1MCheckbox UI (matching ChatInput layout) - Mode selector now positioned with ml-auto (right-aligned like ChatInput) - All message options (mode, thinking, 1M context) now properly passed to backend This ensures the first message respects the same settings as regular messages. Related to #500
Overview
Make workspace creation automatic and invisible. When no workspace exists, typing and sending a message creates one with an AI-generated title and branch name based on the message content.
Changes
Backend
workspaceTitleGenerator.ts- Generates workspace titles and branch names using AIsendFirstMessage- Creates workspace and sends message in one operationFrontend
ProjectSelector- Dropdown for selecting project (auto-hides if single project)FirstMessageInput- Simplified input for first messageApp.tsxto render empty state with project selector + chat inputUser Flow
Before:
After:
Key Design Decisions
Title vs Branch Name:
user-auth-rest-api)Graceful Degradation:
Chat ${timestamp}Backwards Compatibility:
nameequals branch name (unchanged)Testing
Generated with
cmux