-
Notifications
You must be signed in to change notification settings - Fork 89
refactor(recover): drop unreachable legacy fallback in collision check #25575
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 |
|---|---|---|
|
|
@@ -51,14 +51,8 @@ export async function recover(): Promise<void> { | |
| ); | ||
| } | ||
|
|
||
| // 3. Check that the recovering entry's own target directory is free. Only | ||
| // this one path matters — iterating all lockfile entries would block | ||
| // recovery whenever any unrelated local assistant is still installed. | ||
| // Fall back to the legacy `~/.vellum` path for entries without | ||
| // resources (pre env-data-layout installs). | ||
| const target = entry.resources?.instanceDir | ||
| ? join(entry.resources.instanceDir, ".vellum") | ||
| : join(homedir(), ".vellum"); | ||
| // 3. Check that the recovering entry's own target directory is free. | ||
| const target = join(entry.resources.instanceDir, ".vellum"); | ||
|
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.
Useful? React with 👍 / 👎. |
||
| if (existsSync(target)) { | ||
| console.error( | ||
| `Error: ${target} already exists (owned by ${entry.assistantId}). ` + | ||
|
|
||
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.
🚩 Pre-existing tar extraction target mismatch for multi-instance entries
The TODO at
cli/src/commands/recover.ts:65-67documents a pre-existing issue: the tar extraction at line 68 is hardcoded tohomedir(), but the collision check now correctly usesentry.resources.instanceDir. For multi-instance entries whereinstanceDirdiffers fromhomedir(), the archive would extract to the wrong location. This PR doesn't introduce the mismatch — it was already present — but the collision check fix at line 55 makes the asymmetry more visible: the check guards the right path while the extraction writes to a potentially different path.(Refers to lines 64-68)
Was this helpful? React with 👍 or 👎 to provide feedback.