Fix list and fix returning no results from git worktrees#249
Merged
Conversation
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: Combined ReviewVerdict: 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: Combined ReviewVerdict: 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #248
Summary
list,fix) usedGetRepoRoot(--show-toplevel) which returns the worktree path, but the daemon stores jobs underGetMainRepoRoot. Therepo=API filter never matched. Now all API query paths resolve throughGetMainRepoRoot, while local git operations (branch detection, agent working directory) still use the worktree-local path.handleEnqueuedetectedcurrentBranchfor exclusion checks but never used it as a fallback whenreq.Branchwas empty. Jobs from older clients or edge cases were stored with NULL branch, making them invisible to branch-filtered queries. Now the daemon setsreq.Branch = currentBranchwhen the client omits it.--reponormalization: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 pathTestListCommand/explicit_--repo_with_worktree_path_normalizes_to_main_repo— explicit --repo with worktree pathTestFixWorktreeRepoResolution/runFixList_sends_main_repo_path— fix --list from worktreeTestFixWorktreeRepoResolution/runFixUnaddressed_sends_main_repo_path— fix --unaddressed from worktreeTestFixWorktreeRepoResolution/runFixBatch_sends_main_repo_path— fix --batch from worktreeTestHandleEnqueueBranchFallback— daemon fills in branch when client omits itgo test ./...)🤖 Generated with Claude Code