Skip to content

Fix list and fix returning no results from git worktrees#249

Merged
wesm merged 3 commits intomainfrom
list-git-worktree
Feb 12, 2026
Merged

Fix list and fix returning no results from git worktrees#249
wesm merged 3 commits intomainfrom
list-git-worktree

Conversation

@wesm
Copy link
Collaborator

@wesm wesm commented Feb 12, 2026

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

  • TestListCommand/worktree_sends_main_repo_path_as_repo_param — list from worktree sends main repo path
  • TestListCommand/explicit_--repo_with_worktree_path_normalizes_to_main_repo — explicit --repo with worktree path
  • TestFixWorktreeRepoResolution/runFixList_sends_main_repo_path — fix --list from worktree
  • TestFixWorktreeRepoResolution/runFixUnaddressed_sends_main_repo_path — fix --unaddressed from worktree
  • TestFixWorktreeRepoResolution/runFixBatch_sends_main_repo_path — fix --batch from worktree
  • TestHandleEnqueueBranchFallback — daemon fills in branch when client omits it
  • Full test suite passes (go test ./...)

🤖 Generated with Claude Code

wesm and others added 2 commits February 12, 2026 08:21
Two bugs fixed:

1. CLI commands (list, fix) used GetRepoRoot which returns the worktree
   path, but the daemon stores jobs under GetMainRepoRoot. The repo=
   filter never matched. Now list and fix use GetMainRepoRoot for API
   queries while keeping GetRepoRoot for local git operations (branch
   detection, agent working directory).

2. handleEnqueue detected currentBranch for exclusion checks but never
   used it as a fallback when req.Branch was empty. Jobs created without
   a branch field were stored with NULL. Now the daemon falls back to
   the detected branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…erage

Address review findings:

1. list --repo with a worktree path now normalizes to the main repo root
   via GetMainRepoRoot, matching the daemon's stored repo path.

2. Add dedicated worktree tests for runFixUnaddressed and runFixBatch
   (previously only runFixList was covered). Refactor worktree test
   setup into shared helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link

roborev-ci bot commented Feb 12, 2026

roborev: Combined Review

Verdict: No Medium, High, or Critical issues found across all reviews.

All four review outputs agree the changes are clean at the requested severity threshold after deduplication.


Synthesized from 4 reviews (agents: codex, gemini | types: security, default)

Check returned errors from runFixList, runFixUnaddressed, and
runFixBatch instead of discarding them, so regressions after the
API request are caught.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link

roborev-ci bot commented Feb 12, 2026

roborev: Combined Review

Verdict: All four reviews agree this PR is clean, with no Medium/High/Critical findings.

No deduplicated findings to report at Medium severity or above.


Synthesized from 4 reviews (agents: codex, gemini | types: security, default)

@wesm wesm merged commit 1e9e8fc into main Feb 12, 2026
7 checks passed
@wesm wesm deleted the list-git-worktree branch February 12, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

roborev list returns no results for worktrees and jobs with null branch

1 participant