fix(kanban): base task worktrees on remote default - #67760
Open
brb79 wants to merge 1 commit into
Open
Conversation
Collaborator
Related to #61626. Both address stale bases for dispatched Kanban worktrees through different worktree-creation paths; maintainers should consolidate the remote-tip contract. |
teknium1
reviewed
Jul 25, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the current-head stale-base defect; it is still present on current main at hermes_cli/kanban_db.py:6265-6268.
Problems
- The new resolver always chooses a remote default branch. The established interactive contract deliberately prefers the checked-out branch's fetched upstream first (
cli.py:1464-1494), then the remote default (cli.py:1498-1520). This matters for a board intentionally anchored on a tracked feature branch. - The new
base_refpath always fetches and fails when a configured remote is unavailable. That bypassesworktree_sync: falseand differs from the documented offline fallback to localHEAD(cli.py:1524-1525,cli.py:1580-1604;website/docs/user-guide/configuration.md:719-723). - This duplicates the base-selection policy rather than consolidating it. The member note links #61626 specifically for a shared remote-tip contract.
Suggested changes
- Reuse/extract the interactive resolver for Kanban, preserving upstream-first resolution,
worktree_sync, and fail-softHEADfallback. Cover those paths in the Kanban regressions.
Automated hermes-sweeper review.
| # from the fetched remote base (e.g. ``origin/main``) rather than | ||
| # the canonical checkout's current HEAD, which could be a stale or | ||
| # unrelated feature branch. Falls back to HEAD for local-only repos | ||
| # without a configured remote. |
Contributor
There was a problem hiding this comment.
This unconditionally selects the new resolver, so Kanban no longer has the documented worktree_sync: false opt-out or the interactive path's offline fallback to local HEAD (cli.py:1524-1525, 1580-1604). Please route this through the shared interactive base-resolution contract instead.
13 tasks
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.
Summary
HEADor cached<remote>/HEADHEADfallback for local-only repositoriesRoot cause
_ensure_git_worktreecreated new task branches withgit worktree add -b ... HEAD. If a board's canonical checkout was on a stale or unrelated feature branch, every automatically materialized task worktree inherited that stale base.Verification
tests/hermes_cli/test_kanban_db.py: 234 passedruff checkon changed files: passedgit diff --check: passedNo installed Hermes checkout, gateway process, or active Kanban board was modified by this branch.