Repository navigation
Conversation
a25bfdc to
055ffba
Compare
055ffba to
0f4b180
Compare
0f4b180 to
f183b15
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f183b15. Configure here.
| for _, file := range deleted { | ||
| _ = console.Printf("- %s/%s\n", ".launchdarkly", file) | ||
| } | ||
| return nil |
There was a problem hiding this comment.
Cleanup deletes stale orphan list
Medium Severity
cleanupOrphanedAttachments deletes the attachment list gathered before the confirmation prompt and never recompiles the workspace. A variation can regain a reference while that prompt is open, especially in watch mode, and DeleteAttachments still removes the file. The main sync re-reads state after review; cleanup does not.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f183b15. Configure here.
| ) | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
No-op sync fails without TTY
Medium Severity
When unreferenced attachment files exist, cleanup always prompts unless --yes is set. A no-change sync in a non-TTY environment (CI or redirected stdin) now returns interactive confirmation requires a terminal after a successful no-op, even though the user never asked to apply changes.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f183b15. Configure here.


Context
A local tool or skill file is no longer needed after the final synchronized variation stops referencing it. This layer completes the attachment lifecycle by finding those files and asking before removing them. It applies the same behavior to normal syncs and watch mode.
What changes
--yesas confirmation for attachment cleanup along with the rest of the sync.This cleanup only removes local files. It does not delete tools or skills from LaunchDarkly.
Review focus
--yeshandled consistently?Verification
go test ./internal/sync/local ./internal/sync/prompt ./internal/sync/detachgo test ./...go vet ./internal/sync/... ./cmd/syncgit diff --checkRelated changes
Review the stack in this order:
Note
Overview
Adds orphaned local attachment cleanup after sync: the local store can list tool/skill files under
.launchdarklythat no variation still references, delete them in a staged batch (with path, symlink, and duplicate checks), and the prompt flow runs this after a successful sync or when the plan has no changes (including if the user declines applying changes).Interactive sync lists unreferenced files and asks Delete these unreferenced local files?;
--yesskips that prompt. Cleanup only removes local files—LaunchDarkly tools/skills are untouched.Watch / file discovery:
SourceFilesnow includes every file under managed project trees (not only variation wrappers), and the file watcher is passed intorunWorkspaceSyncexplicitly instead of living onOptions.Deletion semantics:
commitDeletionstreats the batch rename as the commit point and no longer rolls back on backup cleanup failures.Removes unused
Store.ProjectKeys.Reviewed by Cursor Bugbot for commit f183b15. Bugbot is set up for automated code reviews on this repo. Configure here.