Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 4, 2025

Workspace names are now generated before creation, with a magic wand toggle for auto/manual control.

  • New useWorkspaceName hook with debounced generation
  • Wand icon in name field: colored = auto, gray = manual
  • Click field to edit, preserving generated name
  • Falls back to user's configured model if Haiku/GPT-Mini unavailable
  • Removed legacy background renaming code

Generated with mux

- Add frontend name generation with debounced AI calls
- New useWorkspaceName hook with auto-generate checkbox control
- Frontend creates workspace with generated name, then sends message
- Remove legacy backend async name generation flow
- Simplify sendMessage to require workspaceId (no more null for creation)
- Remove createForFirstMessage, generateAndApplyAIName, placeholder names
- Backend uses preferred small models (Haiku, Codex-mini) for generation

_Generated with mux_
@ammar-agent ammar-agent force-pushed the i-want-to-redo-how-workspace-n branch from 8bcfd40 to 04ef1de Compare December 4, 2025 18:44
- Clicking into name field disables auto-generation, allowing edit
- Wand icon toggles auto-generation on/off
- Colored wand = auto enabled, grayscale = disabled
- Loading spinner replaces wand during generation
…alignment

- When clicking into field, generated name becomes editable instead of clearing
- Use inset-y-0 + flex items-center for proper vertical centering of wand icon
Remove Promise.race timeout - with voice input, messages can go from
empty to complete instantly, so we must ensure the generated name
reflects the total content, not a partial intermediate state.
Replace 6 individual name-related props with single WorkspaceNameState object.
Reduces indirection and keeps component interface cleaner.
- Add cancelPendingGeneration() that properly resolves waiting promises
  before invalidating requests (prevents hanging waiters)
- Track requestId in generationPromiseRef to match cancellation correctly
- Use pendingMessageRef to capture message at schedule time, avoiding
  stale closures when debounced callback fires
- Clear pendingMessageRef in all cleanup paths
- waitForGeneration now uses captured message from pendingMessageRef
  instead of potentially stale closure value
…Model

- Changed getPreferredNameModel to async, calls aiService.createModel()
  to test if models are available instead of duplicating API key logic
- Removes dependency on Config, avoiding duplication of provider-specific
  env var checking (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, etc.)
- Updated tests to use mock AIService instead of mock Config
- Single source of truth for provider availability in AIService
…vailable

If Haiku/GPT-Mini aren't available (no Anthropic/OpenAI key), fall back
to the user's configured message model. This avoids confusing errors when
users have only configured alternative providers.
…text

- Track confirmed name separately (creatingWithName) from input field name
- Show 'Generating name…' briefly while waitForGeneration completes
- Then show the actual name that will be used for the workspace
- Simplified welcome text in empty state
@ammar-agent ammar-agent changed the title 🤖 feat: auto-generate workspace names before creation 🤖 feat: upfront workspace name generation with magic wand toggle Dec 4, 2025
@ammario ammario merged commit d4d6816 into main Dec 4, 2025
17 checks passed
@ammario ammario deleted the i-want-to-redo-how-workspace-n branch December 4, 2025 19:57
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