Skip to content

Windows: fix pipx CCProxy fallback shim + binary resolution so clawde auth works - #15

Merged
ClintonSarkar merged 1 commit into
mainfrom
fix/pipx-ccproxy-shim
Jul 20, 2026
Merged

Windows: fix pipx CCProxy fallback shim + binary resolution so clawde auth works#15
ClintonSarkar merged 1 commit into
mainfrom
fix/pipx-ccproxy-shim

Conversation

@ClintonSarkar

Copy link
Copy Markdown
Owner

Summary

Fixes the Windows clawde auth failure (#14): when the plugin-less CCProxy binary triggers the pipx fallback, the tool wired a shim pointing at a deleted file and couldn't relocate the pipx binary during self-repair. Both stem from guessing where pipx installed ccproxy instead of asking pipx.

What changed

A shared Resolve-PipxCcproxy helper (one copy per file — they don't share a module) now locates the pipx binary authoritatively:

  • Asks pipx directly: pipx environment --value PIPX_BIN_DIR.
  • Checks the known pipx bin dirs including %USERPROFILE%\.local\bin (the newer pipx default that the old code missed — and the exact location the reported failure used).
  • Falls back to PATH last, with -All so a valid pipx entry isn't hidden by the first match.
  • Excludes the clawde bin directory (slash- and trailing-separator-robust), so it can never return the plugin-less binary the installer is about to delete.

Applied at both failure sites:

  • Install-time (install.ps1): resolves the pipx target before deleting the plugin-less binary — the old code captured the bin-dir path, deleted that exact file, then pointed the shim at it.
  • Auth-time repair (cli/clawde.ps1): uses the same resolver so clawde auth self-repair finds the pipx binary regardless of pipx's bin location, and resolves-before-delete so a failed lookup leaves the diagnostic shim intact.

Reviewer note

The plain diff for install.ps1 looks huge because the base blob has stale CRLF terminators while this branch is LF (per .gitattributes eol=crlf, which stores LF). The real change is ~117 lines — review with git diff --ignore-cr-at-eol. The line-ending normalization of the existing blobs is a pre-existing repo hygiene matter, not part of this fix's logic.

Note

These are pre-existing defects in the original pipx-fallback code, not a regression from a recent change.

Closes #14


🤖 Generated with Claude Code

The Windows pipx fallback (used when the prebuilt ccproxy.exe ships without
auth plugins) wired a broken shim and couldn't relocate the binary, so
`clawde auth` failed with a missing-target shim and an aborting repair loop.

Both stem from resolving the pipx binary via Get-Command / a fixed dir list
instead of asking pipx. A shared Resolve-PipxCcproxy helper now queries
`pipx environment --value PIPX_BIN_DIR`, checks the known pipx bin dirs
(incl. %USERPROFILE%\.local\bin, the newer pipx default), and falls back to
PATH last — while EXCLUDING the clawde bin dir so it can never return the
about-to-be-deleted binary.

- install.ps1 Install-CCProxyViaPipx: resolve the pipx target BEFORE deleting
  the plugin-less ccproxy.exe (previously it captured the bin-dir path, then
  deleted that exact file, leaving the shim pointing at nothing).
- cli/clawde.ps1 Install-PluginCCProxy: use the same resolver so auth-time
  self-repair finds the pipx binary regardless of pipx's bin location.

Closes #14

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ClintonSarkar
ClintonSarkar merged commit 13ba576 into main Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: clawde auth fails - pipx CCProxy fallback wires a broken shim and cannot relocate the binary

1 participant