Skip to content

feat: soft-delete with archive for local assistant retirement#7413

Merged
dvargasfuertes merged 3 commits into
mainfrom
feat/soft-delete-retire-recover
Feb 24, 2026
Merged

feat: soft-delete with archive for local assistant retirement#7413
dvargasfuertes merged 3 commits into
mainfrom
feat/soft-delete-retire-recover

Conversation

@dvargasfuertes
Copy link
Copy Markdown
Contributor

@dvargasfuertes dvargasfuertes commented Feb 24, 2026

Summary

  • Archives ~/.vellum to $XDG_DATA_HOME/vellum/retired/ (tar.gz + JSON metadata) before deleting on retire, with graceful fallback to destructive deletion if archiving fails
  • Adds vellum-cli recover <name> command that restores a retired local assistant from its archive, re-registers the lockfile entry, and starts daemon + gateway
  • Scoped to local assistants only

Test plan

  • vellum-cli hatch local — hatch an assistant
  • vellum-cli retire <name> — verify archive appears at ~/.local/share/vellum/retired/<name>.tar.gz and .json
  • vellum-cli recover <name> — verify ~/.vellum is restored, lockfile entry is back, daemon starts
  • vellum-cli recover <name> with no archive — verify clean error message
  • vellum-cli recover <name> with ~/.vellum existing — verify clean error message

🤖 Generated with Claude Code


Open with Devin

Archive ~/.vellum to an XDG-compliant location before deleting on retire,
and add a recover command to restore previously retired local assistants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13322a08e0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread cli/src/lib/retire-archive.ts Outdated
}

export function getArchivePath(assistantId: string): string {
return join(getRetiredDir(), `${assistantId}.tar.gz`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate assistant IDs before building archive paths

getArchivePath/getMetadataPath concatenate a user-controlled assistant name directly into path.join, so names containing .. can escape $XDG_DATA_HOME/vellum/retired. Since names come from CLI input (hatch --name and recover <name>), this lets retire write archives outside the retired directory and lets recover read/unlink unintended .tar.gz/.json files, which can clobber or delete unrelated files on the host. Reject path separators/traversal segments (or canonicalize and enforce the retired-dir prefix) before constructing these paths.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

dvargasfuertes and others added 2 commits February 23, 2026 20:48
Reject names containing path separators or traversal segments, and
canonicalize+verify the resolved path stays inside the retired directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Export validateAssistantName from retire-archive and call it in
parseArgs when --name is provided.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dvargasfuertes dvargasfuertes merged commit cba4e68 into main Feb 24, 2026
2 of 3 checks passed
@dvargasfuertes dvargasfuertes deleted the feat/soft-delete-retire-recover branch February 24, 2026 01:56
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.

1 participant