-
Notifications
You must be signed in to change notification settings - Fork 953
fix(desktop): use task title as workspace name when opening a task #3678
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -121,7 +121,7 @@ export function OpenInWorkspace({ task }: OpenInWorkspaceProps) { | |||||
| const result = await createWorkspace.mutateAsyncWithPendingSetup( | ||||||
| { | ||||||
| projectId, | ||||||
| name: task.slug, | ||||||
| name: task.title, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider adding a fallback:
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/$taskId/components/PropertiesSidebar/components/OpenInWorkspace/OpenInWorkspace.tsx
Line: 124
Comment:
**Missing guard for empty/undefined `task.title`**
`task.title` is typed as part of `TaskWithStatus` but tasks can exist in a draft/untitled state (e.g., a task created without a title yet). Passing an empty string or `undefined` as `name` to `createWorkspace` may be rejected by the backend or silently create a workspace with a blank name. The previous `task.slug` was always a non-empty structured identifier.
Consider adding a fallback:
```suggestion
name: task.title || task.slug,
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||
| branchName, | ||||||
| }, | ||||||
| { agentLaunchRequest: launchRequestTemplate ?? undefined }, | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,7 +174,7 @@ export function RunInWorkspacePopover({ | |
| const result = await createWorkspace.mutateAsyncWithPendingSetup( | ||
| { | ||
| projectId: effectiveProjectId, | ||
| name: task.slug, | ||
| name: task.title, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The same deduplication concern applies here. In the bulk path this is especially impactful: if a user bulk-selects multiple tasks that happen to have the same title, only the first one creates a new workspace; all subsequent ones will hit Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopover/RunInWorkspacePopover.tsx
Line: 177
Comment:
**Same workspace-collision risk as in `OpenInWorkspace`**
The same deduplication concern applies here. In the bulk path this is especially impactful: if a user bulk-selects multiple tasks that happen to have the same title, only the first one creates a new workspace; all subsequent ones will hit `wasExisting: true` and inject their agent launch request into the same pre-existing workspace, rather than each getting their own isolated environment.
How can I resolve this? If you propose a fix, please make it concise. |
||
| branchName, | ||
| }, | ||
| { agentLaunchRequest: launchRequestTemplate ?? undefined }, | ||
|
|
||
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.
createWorkspace.mutateAsyncWithPendingSetupdeduplicates byprojectId+name(evidenced by theresult.wasExistingcheck). Whennamewastask.slug, collisions were impossible because slugs are unique per project. Now thatnameistask.title, two tasks in the same project that share a title (e.g., both called"Fix auth middleware") will match the same workspace: the second open-in-workspace call will returnwasExisting: trueand launch a new agent session inside the first task's workspace instead of creating a fresh one.If workspace deduplication is also expected to key on
branchName, this may be safe, but the code path forresult.wasExistingonly re-runslaunchAgentSession— it does not verify that the found workspace's branch matches the current task's branch.Consider appending the slug to keep uniqueness while still showing a human-friendly name, e.g.:
or guarantee uniqueness by checking whether the backend deduplication key includes
branchName.Prompt To Fix With AI