fix: exclude remote-only branches from switch tab completions#1416
Open
worktrunk-bot wants to merge 1 commit intomainfrom
Open
fix: exclude remote-only branches from switch tab completions#1416worktrunk-bot wants to merge 1 commit intomainfrom
worktrunk-bot wants to merge 1 commit intomainfrom
Conversation
Remote-only branches are now excluded from `wt switch` tab completions by default, matching the interactive picker's behavior. In repos with many remote branches this makes tab completion usable again. Passing `--remotes` on the command line re-includes them. Closes #1415 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
worktrunk-bot
added a commit
that referenced
this pull request
Mar 11, 2026
The claude-mention bot created a duplicate PR (#1442) when #1416 already addressed the same issue, and shipped code without running cargo fmt — causing a CI failure and requiring a second commit. Both gaps exist because running-in-ci (loaded by all CI workflows) had no guidance on checking for existing PRs or formatting code before committing. The triage-issue skill had these checks but running-in-ci did not. Add two subsections under "PR Creation": - "Before creating a PR" — check open PRs and fix branches first - "Before committing code changes" — run cargo fmt at minimum Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
max-sixty
pushed a commit
that referenced
this pull request
Mar 11, 2026
…1443) ## Summary - Add "Before creating a PR" guidance: check for existing PRs and fix branches before creating duplicates - Add "Before committing code changes" guidance: run `cargo fmt` (minimum) or full pre-merge before committing ## Evidence In [run 22946109451](https://github.com/max-sixty/worktrunk/actions/runs/22946109451) (`claude-mention` on issue #1415), the bot: 1. **Created a duplicate PR.** PR #1416 (created 2026-03-10) already addressed the same issue — excluding remote branches from switch completions. The bot created #1442 with a different approach without checking for existing work. Both PRs are authored by `worktrunk-bot`. The session log shows the bot went directly from reading the issue to editing code — no `gh pr list` or branch check. 2. **Skipped `cargo fmt` before committing.** The bot ran `cargo check` to verify compilation but not `cargo fmt`. CI failed on the pre-commit hook's format check, requiring a second "style: rustfmt" commit and another full CI polling cycle (~11 minutes of additional `sleep 60` polls). <details><summary>Session log: tool call sequence (run 22946109451)</summary> ``` Skill: running-in-ci Bash: gh issue view 1415 ... Read: src/completion.rs Edit: src/completion.rs ← code change Grep: complete_branches ← searched for tests, found none Bash: cargo check ← compilation only, no fmt Bash: git checkout -b ... Bash: git add && git commit ← committed unformatted code Bash: git push && gh pr create ← created PR #1442 (duplicate of #1416) ... 11 CI poll cycles ... Bash: gh run view --log-failed ← discovered fmt failure Bash: cargo fmt ← fixed formatting Bash: git add && git commit ← second commit ... 11 more CI poll cycles ... ``` </details> ## Root cause The `running-in-ci` skill (loaded by all CI workflows) had no guidance on either checking for existing PRs or formatting code before committing. The `triage-issue` skill already had both — Step 3 ("Check for duplicates") and Step 6.3 (`cargo run -- hook pre-merge --yes`) — but this guidance didn't extend to the `claude-mention` workflow. ## Test plan - [ ] Verify the skill file renders correctly - [ ] Observe future `claude-mention` runs for improved behavior (check for existing PRs, run `cargo fmt`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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
wt switchtab completions by default, matching the interactive picker's behavior--remotesis explicitly on the command line, remote-only branches are included in completionsThe fix leverages the existing
exclude_remote_onlyfield inBranchCompleterand adds--remotesflag detection (similar to existing--createdetection) to override it when present.Closes #1415
Test plan
--remotesflag includes remote-only branches in completions🤖 Generated with Claude Code