plandex-ai/plandex · error
error checking if %s is a subpath of %s: %s
Error message
error checking if %s is a subpath of %s: %s
What it means
IsIgnored checks whether a path outside the active-path map is ignored because it lives under a git-ignored directory. Each such check calls IsSubpathOf; if any of those calls errors, the failure is wrapped with both the file path and the candidate directory.
Source
Thrown at app/cli/fs/paths.go:457
return false, nil
}
// If we want "absChild == absParent" to count as inside,
// then !HasPrefix(rel, "..") is enough.
// This means child == parent or child is deeper within parent.
return true, nil
}
func IsIgnored(paths *types.ProjectPaths, path, baseDir string) (bool, string, error) {
if !paths.AllPaths[path] {
// if the path isn't in AllPaths, it either:
// 1. doesn't exist (in which case we shouldn't be calling this function)
// 2. is a subpath of a git ignored dir
for dir := range paths.GitIgnoredDirs {
subpath, err := IsSubpathOf(dir, path, baseDir)
if err != nil {
return false, "", fmt.Errorf("error checking if %s is a subpath of %s: %s", path, dir, err)
}
if subpath {
return true, "git", nil
}
}
return false, "", fmt.Errorf("path %s is not in the project", path)
}
if paths.ActivePaths[path] {
return false, "", nil
}
if paths.PlandexIgnored != nil && paths.PlandexIgnored.MatchesPath(path) {
return true, "plandex", nil
}
return true, "git", nil
}View on GitHub (pinned to e2d772072e)
Solutions
- Verify the path is inside the current project and on the same volume as GitIgnoredDirs entries
- Re-run `plandex load`/context load so ActivePaths is rebuilt with the current path
- Inspect the wrapped err to find which dir failed relativization
- Clean/normalize the path argument before loading it as context
Example fix
// before
MustLoadContext([]string{"D:\\outside\\file.go"})
// after
MustLoadContext([]string{"./internal/file.go"}) Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := os.Stat(path); err != nil {
return fmt.Errorf("path %s inaccessible before ignore check: %w", path, err)
} Try / catch
ok, reason, err := IsIgnored(path, paths, baseDir)
if err != nil {
if strings.Contains(err.Error(), "error getting relative path") {
// treat as not ignored, or skip the offending path
ok, reason = false, ""
} else {
return err
}
} Prevention
- Keep GitIgnoredDirs and the path set on the same volume
- Refresh ActivePaths/GitIgnoredDirs before loading context
- Normalize all stored paths with filepath.Clean
- Don't load context paths from outside the project root
When it happens
Trigger: A path not present in paths.ActivePaths is checked against every dir in paths.GitIgnoredDirs, and IsSubpathOf returns an error (e.g. filepath.Rel failure, different volumes, invalid path) for one of them.
Common situations: Loading context for a path containing characters or structure that break path relativization; paths recorded before a drive/volume change; stale GitIgnoredDirs entries pointing at another volume.
Related errors
- path %s is not in the project
- error getting project paths: %v
- error loading accounts: %v
- error setting auth: %v
- error writing auth: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/1b7564a5f4f0e0d8.
Report an issue: GitHub.