Repository navigation
fix: exclude remote-only branches from switch tab completions - #1416
worktrunk-bot wants to merge 1 commit into
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 <[email protected]>
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 <[email protected]>
…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 <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
|
@worktrunk-bot resolve conflicts look back at the discussiosn — this went a few directions and I think we got a few ideas out. Explain exactly what this does and how it compares to our other options |
|
This PR is superseded by #1442 (merged), which took the threshold approach discussed in #1415. What this PR does: Unconditionally excludes remote-only branches from Why the discussion moved away from this approach:
What #1442 does instead (already merged): Excludes remote-only branches only when the total branch count exceeds 100. Small repos are unaffected; large repos avoid the "do you wish to see all N possibilities?" prompt. This was the consensus from the #1415 discussion. There are merge conflicts with main (in |
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