Repository navigation
chore: improve dev slot system - #795
Conversation
[Medium impact] The changes affect local development slots and a macOS desktop launch path. Fix the registry switch that deletes saved dev data and the desktop process left alive by cleanup before merging. FindingsFix with agent prompt### Issue 1
scripts/dev-slot.mjs:116
Switching an existing checkout to colocated Jujutsu changes `launchRegistry` without moving its saved reservations. For a stopped slot, the next `start` finds no reservation in `jj-launch.json`, treats the matching slot as an orphan, and deletes its data before creating it again. Projects and runs saved in the dev database are silently lost. Read or migrate the old reservation before allowing orphan cleanup.
### Issue 2
scripts/dev-slot.mjs:680-684
The desktop child is detached but never recorded in slot state, so `stop` and `cleanup` leave it running. `cleanup` can delete its files and release its ports for another checkout while the old window still points at those ports. Reloading that window then opens the other checkout's dashboard. Track the desktop process and stop it before deleting or reassigning the slot.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR adds Jujutsu workspace support and a macOS desktop window for dev slots.
Reviews (1) · Last reviewed commit: "chore: improve dev slot system" · Reviewed by Greptile |
| allocatorRoot, | ||
| cargoTargetDir: path.join(allocatorRoot, 'cargo-target'), | ||
| launchRegistry: path.join(info.mainCheckout, '.claude', 'launch.json'), | ||
| launchRegistry: info.jj ? path.join(allocatorRoot, 'jj-launch.json') : path.join(info.mainCheckout, '.claude', 'launch.json'), |
There was a problem hiding this comment.
Switching to Jujutsu deletes data
Switching an existing checkout to colocated Jujutsu changes launchRegistry without moving its saved reservations. For a stopped slot, the next start finds no reservation in jj-launch.json, treats the matching slot as an orphan, and deletes its data before creating it again. Projects and runs saved in the dev database are silently lost. Read or migrate the old reservation before allowing orphan cleanup.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/dev-slot.mjs
Line: 116
Comment:
**Switching to Jujutsu deletes data**
Switching an existing checkout to colocated Jujutsu changes `launchRegistry` without moving its saved reservations. For a stopped slot, the next `start` finds no reservation in `jj-launch.json`, treats the matching slot as an orphan, and deletes its data before creating it again. Projects and runs saved in the dev database are silently lost. Read or migrate the old reservation before allowing orphan cleanup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const child = spawn(executable, ['--dev-desktop', String(slotPaths.uiPort)], { | ||
| detached: true, stdio: 'ignore', env: { ...process.env, ...slotEnvironment(slotPaths) }, | ||
| }) | ||
| child.on('error', (error) => console.error(`Could not open the desktop app: ${error.message}`)) | ||
| child.unref() |
There was a problem hiding this comment.
The desktop child is detached but never recorded in slot state, so stop and cleanup leave it running. cleanup can delete its files and release its ports for another checkout while the old window still points at those ports. Reloading that window then opens the other checkout's dashboard. Track the desktop process and stop it before deleting or reassigning the slot.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/dev-slot.mjs
Line: 680-684
Comment:
**Desktop outlives its slot**
The desktop child is detached but never recorded in slot state, so `stop` and `cleanup` leave it running. `cleanup` can delete its files and release its ports for another checkout while the old window still points at those ports. Reloading that window then opens the other checkout's dashboard. Track the desktop process and stop it before deleting or reassigning the slot.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
support jujutsu and running a dev server on the desktop app
Test plan
Assisted-by: gpt-6.1-terra