fix(cua-driver): thread --force through skills link_agent - #1970
Conversation
`cua-driver skills install --force` and `cua-driver skills update` both re-fetch the skill pack but did NOT actually repoint per-agent symlinks that already existed — link_agent ignored the force flag entirely. So switching between a release install and a local-build install (which both land at `~/.cua-driver/skills/cua-driver`, but the link's resolved target needs refreshing if the pack was rebuilt or moved) left stale links in place with no escape hatch. The fix is a single-file change: - Pass `force` to `link_agent()` from the AGENTS loop. - In `link_agent`, when the link exists + resolves (case 2) and `force=true`, remove + recreate IF it's a symlink/junction. If the path is a real directory (case 4), still skip unconditionally — even under --force we never recursively delete user-managed content at the agent's skill-dir path. - Tighten the existing 'already exists' message to mention --force / `skills update` so users discover the escape hatch from the output. - Doc-comment the new case 2 fork on `link_agent`. Update the top-of-file subcommand list to match (it claimed `update` was the same as `install --force`, which had been a lie since the force flag never reached the link path). Verified with an isolated HOME smoke harness covering: - install (no flag) → existing links skipped - install --force → symlinks refreshed, real-dir at link path left alone - update → same behavior as install --force
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a ChangesForce-aware symlink refresh in
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
Summary
cua-driver skills install --forceandcua-driver skills updateboth re-fetched the skill pack but did not actually repoint per-agent symlinks that already existed —link_agentignored theforceflag entirely. So when switching between a release install and a local-build install (both land at~/.cua-driver/skills/cua-driver, but the link's resolved target needs refreshing if the pack was rebuilt or moved) the stale links were stuck:updateadvertised itself as "same asinstall --force" in the docstring but had the same gap.Fix
Single-file change in
crates/cua-driver/src/skills.rs:forcetolink_agent()from the AGENTS loop.link_agent, when the link exists + resolves (case 2) andforce=true, remove + recreate only if it's a symlink/junction. If the path is a real directory (case 4), still skip unconditionally — even under--forcewe never recursively delete user-managed content at the agent's skill-dir path.--force/skills updateso users discover the escape hatch from the output.link_agent. Update the top-of-file subcommand list — it claimedupdatewas the same asinstall --force, which had been wrong since the force flag never reached the link path.Diff:
+39 / -9on one file.Test plan
Verified with an isolated HOME smoke harness:
install(no flag) → existing Hermes symlink skipped with the improved message; case-4 real-dir skipped; other agents get fresh links.install --force→ Hermes symlink refreshed; case-4 real-dir at~/.claude/skills/cua-driverleft alone; other agents refreshed.update→ same behavior asinstall --force.cargo check -p cua-driverclean.Adjacent issue (not in this PR)
uninstall.shsweeps Claude / Codex / OpenClaw / OpenCode skill links but not~/.gemini/skills/cua-driver(Antigravity) or~/.hermes/skills/cua-driver(Hermes) — both added toAGENTSin skills.rs without matching the bash uninstaller. That's how the user originally arrived at the stuck Hermes link in the first place. Splitting into a separate single-concern PR; will file an issue.Summary by CodeRabbit
Release Notes
Documentation
--forceflag documentation in theupdatesubcommand, explicitly describing its behavior of re-fetching and repointing symlinks for existing installations.Bug Fixes