What happened?
hunk session commands take a --repo <path> selector to target the live session for a given checkout, but they don't play well with subdirectories.
A session always registers under its git root. However, --repo . resolves to the literal current directory and the match is exact, so it only lines up when the CLI runs from that root. It doesn't match when ran from any subdirectory:
$ hunk diff
# in another tab:
$ cd sub/dir
$ hunk session comment list --repo . --type user
hunk: No active session matches repoRoot /Users/me/code/myrepo/sub/dir.
It holds both ways: launch at the root or in a subdirectory, the outcome is the same. The only decider is where the query runs:
hunk diff started in |
query from root |
query from subdir |
| root |
works |
fails |
| subdir |
works |
fails |
So an agent started in a subdirectory cannot see the user's comments.
Steps to reproduce
- Open a review anywhere in the repo:
hunk diff.
- In another terminal/tab, from a subdirectory of that repo, run
hunk session comment list --repo . --type user.
- It reports no matching session. Running the same command from the repo root works correctly.
Expected behavior
--repo . (and any path inside the tree) should resolve to the git toplevel before matching, so it targets the session from anywhere in the repo. The session already records its own repoRoot this way, so only the selector side needs to walk up.
Version
0.15.1
note: I'm working on a PR to fix this. Edit: see #424.
What happened?
hunk sessioncommands take a--repo <path>selector to target the live session for a given checkout, but they don't play well with subdirectories.A session always registers under its git root. However,
--repo .resolves to the literal current directory and the match is exact, so it only lines up when the CLI runs from that root. It doesn't match when ran from any subdirectory:It holds both ways: launch at the root or in a subdirectory, the outcome is the same. The only decider is where the query runs:
hunk diffstarted inSo an agent started in a subdirectory cannot see the user's comments.
Steps to reproduce
hunk diff.hunk session comment list --repo . --type user.Expected behavior
--repo .(and any path inside the tree) should resolve to the git toplevel before matching, so it targets the session from anywhere in the repo. The session already records its ownrepoRootthis way, so only the selector side needs to walk up.Version
0.15.1
note: I'm working on a PR to fix this. Edit: see #424.