fix: stabilize task creation UI warnings and clean up temporary diagnostics#1013
Merged
rabanspiegel merged 13 commits intomainfrom Feb 21, 2026
Merged
fix: stabilize task creation UI warnings and clean up temporary diagnostics#1013rabanspiegel merged 13 commits intomainfrom
rabanspiegel merged 13 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR improves task creation responsiveness by optimizing the worktree pooling system and unifying the loading UX: Key improvements:
Test coverage:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/main/services/WorktreePoolService.ts | Refactored reserve keying to include base ref for per-branch pooling, moved git fetch to reserve creation instead of claim path for faster claims |
| src/main/services/worktreeIpc.ts | Added new IPC handler to claim reserve and persist task in single round-trip |
| src/renderer/lib/taskCreationService.ts | Unified task creation flow to use combined claim+save IPC, added return value to signal creation start |
| src/renderer/App.tsx | Added isCreatingTask state management with 30s timeout and callback propagation |
| src/renderer/components/MainContentArea.tsx | Added TaskCreationLoading overlay during task creation |
| src/renderer/terminal/TerminalSessionManager.ts | Fixed PTY started listener cleanup to prevent listener buildup |
| src/test/main/worktreeIpc.test.ts | Added comprehensive tests for claim-and-save flow covering success, miss, error, and remote rejection cases |
Sequence Diagram
sequenceDiagram
participant User
participant TaskModal
participant App
participant taskCreationService
participant IPC
participant WorktreePool
participant Database
participant ChatInterface
User->>TaskModal: Click "Create Task"
TaskModal->>taskCreationService: createTask()
TaskModal->>App: onClose() (modal closes immediately)
App->>App: setIsCreatingTask(true)
App->>MainContentArea: Show TaskCreationLoading overlay
taskCreationService->>IPC: worktreeClaimReserveAndSaveTask()
IPC->>WorktreePool: claimReserve(projectId, baseRef)
alt Reserve available
WorktreePool-->>IPC: {worktree, needsBaseRefSwitch: false}
IPC->>Database: saveTask(worktree + metadata)
Database-->>IPC: success
IPC-->>taskCreationService: {success: true, worktree, task}
taskCreationService->>App: Update UI state (setActiveTask)
App->>ChatInterface: Mount with task
ChatInterface->>App: onTaskInterfaceReady()
App->>App: setIsCreatingTask(false)
App->>MainContentArea: Hide loading overlay
else Reserve miss
WorktreePool-->>IPC: null
IPC-->>taskCreationService: {success: false}
taskCreationService->>IPC: worktreeCreate() (fallback)
Note over IPC: Regular sync worktree creation
taskCreationService->>IPC: saveTask() (separate call)
taskCreationService->>App: Update UI state
end
Note over WorktreePool: Background: replenishReserve(projectId, baseRef)
Last reviewed commit: b901512
Comment on lines
699
to
705
| }, [ | ||
| selectedProject?.id, | ||
| selectedProject?.path, | ||
| selectedProject?.gitInfo?.isGitRepo, | ||
| projectDefaultBranch, | ||
| prewarmReserveForBaseRef, | ||
| ]); |
There was a problem hiding this comment.
dependency array includes selectedProject?.id but guards with if (!selectedProject) - effect will run when selectedProject object reference changes even if the id/path haven't changed
Suggested change
| }, [ | |
| selectedProject?.id, | |
| selectedProject?.path, | |
| selectedProject?.gitInfo?.isGitRepo, | |
| projectDefaultBranch, | |
| prewarmReserveForBaseRef, | |
| ]); | |
| }, [ | |
| selectedProject, | |
| projectDefaultBranch, | |
| prewarmReserveForBaseRef, | |
| ]); |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
e415706 to
bee6eb1
Compare
bee6eb1 to
34238bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n- keep reserve claims fast by keying reserves by base ref and prewarming on branch/default-base changes\n- collapse reserve claim + task persistence into one IPC path and add coverage in worktree IPC tests\n- unify task creation loading UX across single and multi-agent task flows\n- fix Task modal warnings by stabilizing controlled Select values and adding dialog description metadata\n- clean up PTY started listener lifecycle to prevent listener buildup over repeated terminal starts\n- remove temporary task-creation trace instrumentation after investigation\n\n## Validation\n- pnpm run format\n- pnpm run type-check\n- manual verification of create-task UX for single-worktree flows (modal close -> loading -> chat mount)
closes #972
Note
Medium Risk
Touches the task creation and git worktree pooling paths (including ref fetching and persistence timing), so regressions could impact task/worktree creation or base-branch correctness despite being scoped and covered by new IPC tests.
Overview
Task creation now shows a single, consistent “Creating task…” overlay across both single- and multi-agent flows, and clears it when the task interface mounts (with a 30s safety timeout) instead of relying on per-view spinners.
Worktree reserve pooling is updated to be base-ref aware (keyed by
projectId::baseRef) with prewarming on base-branch selection changes, plus an additional IPC pathworktree:claimReserveAndSaveTaskto claim a reserve and persist the task in one round-trip (with new tests). Reserve creation behavior is adjusted to refresh git refs during reserve creation and the previous claim-time base-ref switching/reset logic is removed.Fixes several UI stability issues by ensuring controlled
Selectcomponents always have a defined value (branch/issue selectors, titlebar task selector) and addsDialogDescriptionmetadata to the new-task modal. Also tightens PTY start listener cleanup to avoid accumulatingonPtyStartedhandlers, and updates.gitignoreto ignore.notesin both file/dir forms.Written by Cursor Bugbot for commit 34238bc. This will update automatically on new commits. Configure here.