You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix list and fix returning no results from git worktrees (#249)
Closes#248
## Summary
- **Worktree path mismatch**: CLI commands (`list`, `fix`) used
`GetRepoRoot` (`--show-toplevel`) which returns the worktree path, but
the daemon stores jobs under `GetMainRepoRoot`. The `repo=` API filter
never matched. Now all API query paths resolve through
`GetMainRepoRoot`, while local git operations (branch detection, agent
working directory) still use the worktree-local path.
- **Null branch fallback**: `handleEnqueue` detected `currentBranch` for
exclusion checks but never used it as a fallback when `req.Branch` was
empty. Jobs from older clients or edge cases were stored with NULL
branch, making them invisible to branch-filtered queries. Now the daemon
sets `req.Branch = currentBranch` when the client omits it.
- **Explicit `--repo` normalization**: `list --repo <worktree-path>` now
normalizes the path to the main repo root, so it matches regardless of
which checkout the user points to.
## Test plan
- [x] `TestListCommand/worktree_sends_main_repo_path_as_repo_param` —
list from worktree sends main repo path
- [x]
`TestListCommand/explicit_--repo_with_worktree_path_normalizes_to_main_repo`
— explicit --repo with worktree path
- [x] `TestFixWorktreeRepoResolution/runFixList_sends_main_repo_path` —
fix --list from worktree
- [x]
`TestFixWorktreeRepoResolution/runFixUnaddressed_sends_main_repo_path` —
fix --unaddressed from worktree
- [x] `TestFixWorktreeRepoResolution/runFixBatch_sends_main_repo_path` —
fix --batch from worktree
- [x] `TestHandleEnqueueBranchFallback` — daemon fills in branch when
client omits it
- [x] Full test suite passes (`go test ./...`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments