fix(v3.3.12): claude-use/claude-whoami resolve v3 subctl explicitly — survive v4 PATH collision - #48
Conversation
… survive v4 PATH collision The shell helpers called bare `subctl config show`/`accounts`. Once v4 (subctl-chat-tui) landed at ~/.local/bin/subctl and that dir sorted ahead of ~/bin on the interactive PATH, bare `subctl` resolved to v4, which doesn't dispatch v3 verbs — `config show` printed v4 help and the awk parser found nothing. Result: claude-use listed no profiles, couldn't switch/select; claude-whoami always said "custom". Bake a `_subctl_v3` resolver into the generated shell-aliases.sh and route all four bare-subctl call sites (config show ×3, accounts ×1) through it, bypassing PATH. Mirrors the existing claude-teams shim. The intentional bare-`claude` account guard is unchanged. Verified under simulated broken PATH (~/.local/bin first): claude-use lists all 5 accounts, switching and claude-whoami resolve correctly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughThis pull request fixes a PATH collision where Changesv3 subctl resolver fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Problem
The shell helpers (
claude-use,claude-whoami,claude-accounts) called baresubctl config show/subctl accounts. Once the v4subctl-chat-tuientry point landed at~/.local/bin/subctland that dir sorted ahead of~/binon the operator's interactivePATH, baresubctlresolved to v4, which doesn't dispatch v3 verbs —config showjust prints v4 help and exits 0. The awk parser downstream found nothing, so:claude-use(no args) listed no profilesclaude-use <alias>→ "Unknown account"claude-whoamialways said "custom"Operator report: "I can't switch, I can't select, claude-use shows nothing."
Why it was masked
Claude Code's
settings.jsonpinsenv.PATHwith~/binfirst and no~/.local/bin, so v3 won inside Claude Code — the break only reproduced in the interactive terminal (.zshrcprepends~/.local/bin3× ahead of~/bin).Fix
lib/migrate.shbakes a_subctl_v3resolver into the generatedshell-aliases.shand routes all four bare-subctlcall sites (config show×3,accounts×1) through it, bypassingPATH. Mirrors the existingclaude-teamsshim, which already resolves its v3 sibling directly because v4 owns the baresubctlname.The intentional bare-
claudeaccount guard is unchanged.Verification
~/.config/subctl/shell-aliases.sh; diff = resolver + 4 substitutions only.PATH=~/.local/bin:...(baresubctl→ v4): sourcing the regenerated file makesclaude-uselist all 5 accounts,claude-use jasonswitch,claude-whoamiresolve toclaude-jason. Pre-fix all three failed.bash -n+zsh -nclean on generated output and generator.Note: already-running shells must
source ~/.zshrcor open a new terminal.🤖 Generated with Claude Code
Summary by CodeRabbit