fix(session): resolve --repo selector to repo root#424
Conversation
Greptile SummaryThis PR fixes
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to path canonicalization before session lookup and cannot affect session data or VCS operations. The new helper is small, well-commented, and has a clean fallback. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["--repo <path> provided"] --> B["resolve(repoPath)\n(absolute path, no symlink resolution)"]
B --> C["detectVcs(resolved)\n(walk up looking for .git / .jj / .sl)"]
C -->|"VCS root found"| D["realpathSync.native(repoRoot)\n(canonicalize through symlinks)"]
C -->|"No VCS root"| E["return resolved\n(original absolute path, no canonicalization)"]
D --> F["selector: { repoRoot: canonicalRoot }"]
E --> F
F --> G["Match against registered session\n(session repoRoot is also realpath-canonical)"]
Reviews (1): Last reviewed commit: "fix(session): resolve --repo selector to..." | Re-trigger Greptile |
c0b46a5 to
3d06996
Compare
Sessions register under their git toplevel, so a --repo selector run from a subdirectory never matched. Walk up to the containing repo root (and canonicalize through symlinks) so queries target the session from anywhere in the tree. Closes modem-dev#423.
3d06996 to
4004d08
Compare
Sessions register under their git toplevel, so a --repo selector run from a subdirectory never matched.
Walk up to the containing repo root (and canonicalize through symlinks) so queries target the session from anywhere in the tree.
Closes #423.