fix: smart uninstaller cleanup + prevent nested .ragcode dirs#48
fix: smart uninstaller cleanup + prevent nested .ragcode dirs#48
Conversation
- Uninstaller derives scan roots from registry, Qdrant file_path payloads, JetBrains/VSCode/AI-IDE configs — no more hardcoded directory guessing - findWorkspaceRootFromFilePath: walk up from Qdrant payload to workspace root - detectIDEProjectParents: reads recentProjects.xml, storage.json, resolveIDEPaths - detector: removed .ragcode from workspace markers (prevents hijacking root detection) - resolver: applyNestedOverride centralized — prevents split-indexing on sub-dirs
There was a problem hiding this comment.
Pull request overview
Improves uninstall completeness by replacing hardcoded directory guesses with data-driven discovery (registry, Qdrant payloads, IDE configs, shallow home scan) and reduces accidental creation of nested .ragcode/ directories by adjusting workspace detection/resolution.
Changes:
- Expand uninstall cleanup strategy to scan authoritative sources (registry + Qdrant + IDE configs + home shallow scan).
- Remove
.ragcodeas a workspace marker and centralize nested-workspace override logic in the resolver. - Update uninstall tests and bump CLI version.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
internal/uninstall/uninstall.go |
New discovery-based scanning for orphaned .ragcode/ dirs; IDE/Qdrant-based root discovery. |
internal/uninstall/uninstall_test.go |
Updates expectations to reflect fallback scan cleanup. |
pkg/workspace/detector/detector.go |
Removes .ragcode from marker list to avoid workspace root “hijacking”. |
pkg/workspace/resolver/resolver.go |
Centralizes nested workspace override via applyNestedOverride. |
cmd/rag-code-mcp/main.go |
Version bump to 2.1.87. |
Comments suppressed due to low confidence (1)
pkg/workspace/detector/detector.go:62
- Removing ".ragcode" from the marker list means detectFromMetadata() can now fail for workspaces that only have the managed .ragcode/root metadata (and no other markers like .git/go.mod). That makes previously indexable “markerless” folders undiscoverable and will return "metadata referenced root ... but no markers found". Consider treating the metadata file itself as sufficient, or adding a dedicated marker check for .ragcode/root without reintroducing .ragcode directory hijacking.
"artisan",
".agent",
".idea",
".vscode",
".vs",
".cursor",
".windsurf",
"AGENTS.md",
"CLAUDE.md",
},
MaxDepth: 10,
MetadataFileName: filepath.Join(".ragcode", "root"),
}
…ble markerless spaces
|
Verified this and you're correct. Updated inspectDir to explicitly treat the .ragcode/root metadata file as a valid marker so markerless workspaces remain discoverable. |
…& nested overrides
|
Fixed. Added curl timeouts in Qdrant fetches, corrected the off-by-one depth limit and the IDE data dir sentinel, and explicitly lowered Confidence/Reason when applying a nested workspace outline fallback. |
|
Addressed the final two items: Gated the SkipDir return flag behind info.IsDir() so file walkers don't unnecessarily panic-abort when hitting deep configurations, and fully restored the IDE grandparent directory parsing to include both the configuration and umbrella projects directory. |
Description
Eliminates incomplete uninstallation caused by hardcoded directory guesses (
~/Projects,~/code, etc.). Replaces with a data-driven strategy that queries every authoritative source available on the system. Also fixes the root cause of nested.ragcode/directories being created when IDEs open sub-directories.Changes:
internal/uninstall/uninstall.go— cleanup from 4 sources: registry, Qdrantfile_pathpayloads, JetBrains/VSCode/AI-IDE configs (resolveIDEPaths), shallow$HOMEscaninternal/uninstall/uninstall_test.go— updated tests for orphan sibling detectionpkg/workspace/detector/detector.go— removed.ragcodefrom workspace markers (prevented hijacking root detection)pkg/workspace/resolver/resolver.go— centralizedapplyNestedOverrideto prevent split-indexing on sub-directory opensType of change
Checklist:
go fmt ./...go test ./...and they pass