fix(skills): handle reinstall locked folders#1804
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds structured ChangesSkill Reinstall Windows EPERM
Sequence Diagram(s)sequenceDiagram
participant UI as SkillInstallDialog
participant Presenter as SkillPresenter
participant FS as FileSystem
UI->>Presenter: installFromFolder(..., overwrite=true)
Presenter->>FS: existsSync(targetDir)
Presenter->>FS: existsSync(SKILL.md)
alt SKILL.md present
Presenter->>FS: renameSync(targetDir, backupDir)
FS-->>Presenter: ok or EPERM/EBUSY
Presenter-->>UI: success or target_locked
else SKILL.md missing
Presenter->>FS: rmSync(targetDir, { recursive: true })
Presenter-->>UI: success
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/presenter/skillPresenter/index.ts`:
- Around line 1555-1557: Keep the local uninstall cleanup path in sync with the
not_found branch in `presenter/skillPresenter/index.ts`: when
`fs.existsSync(skillDir)` fails inside the skill uninstall flow, do not return
immediately before running the same cleanup used for a normal uninstall. Make
sure `deleteSkillExtension()` and the related cache eviction still run for this
case, then return the not_found result afterward so removed-on-disk skills don’t
leave stale extension state behind.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 187c8b05-535c-457b-9a06-850b82e8cf46
📒 Files selected for processing (9)
docs/issues/skill-reinstall-windows-eperm/plan.mddocs/issues/skill-reinstall-windows-eperm/spec.mddocs/issues/skill-reinstall-windows-eperm/tasks.mdsrc/main/presenter/skillPresenter/index.tssrc/main/presenter/skillPresenter/skillExecutionService.tssrc/renderer/settings/components/skills/SkillInstallDialog.vuesrc/shared/types/skill.tstest/main/presenter/skillPresenter/skillExecutionService.test.tstest/main/presenter/skillPresenter/skillPresenter.test.ts
Summary
SKILL.mdas stale residues during overwrite reinstall, removing them before copying the new skill instead of creating a.backup-*folder.errorCode: 'target_locked'withtargetPath.UI State
Before:
After:
Validation
pnpm run formatpnpm run i18npnpm run lintpnpm run typecheckpnpm test -- test/main/presenter/skillPresenter/skillPresenter.test.ts test/main/presenter/skillPresenter/skillExecutionService.test.tsCloses #1803
Summary by CodeRabbit
New Features
Bug Fixes
SKILL.md.Tests
Documentation