Add Windows Claude Desktop credential helper - #6516
Open
stantheman0128 wants to merge 1 commit into
Open
Conversation
Setup on Windows used to write a POSIX .sh shim and then refuse. Write a .cmd shim and quote the thv path for cmd.exe instead. Signed-off-by: Po-Han Shih <stanshih888@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6516 +/- ##
==========================================
- Coverage 78.25% 78.24% -0.01%
==========================================
Files 770 770
Lines 75521 75542 +21
==========================================
+ Hits 59100 59111 +11
- Misses 16416 16426 +10
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
thv llm setup --client claude-desktopdetected Claude Desktop on Windows and then failed withclaude-desktop LLM gateway setup is not supported on Windows yet. The helper it would have written is a POSIX/bin/shscript (claude-desktop-helper.sh).The Windows early return is gone. Setup now writes
claude-desktop-helper.cmd. The shim still execs the absolutethvpath fromos.Executable()(GUI-launched Claude Desktop has no useful PATH). It usesgotoinstead of a parenthesizedifso a)in the path cannot break the block, andcallso a.cmdtoken helper returns.%and"in the path are escaped for cmd.exe.Fixes #6507
Type of change
Test plan
go test ./pkg/client/ -count=1 -timeout 180s -run "CredentialHelper|QuoteFor|WriteCredential")task test-e2e) (suite skips on Windows; POSIX fake-browser)task lint-fix)Isolated
%USERPROFILE%on this Win11 box (real Claude store untouched):Setup exit 0. Wrote
.toolhive\llm\claude-desktop-helper.cmdwithcall "<abs thv.exe>" llm token. Config documentinferenceCredentialHelperpointed at that.cmd.thv llm teardown claude-desktopremoved the shim and the config document.Did not launch Claude Desktop itself, so the GUI helper invoke is untested here.
API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.Does this introduce a user-facing change?
Yes.
thv llm setup --client claude-desktopnow configures Claude Desktop on Windows.Special notes for reviewers
Assigned on #6507. Direct-mode clients still use the PATH-resolved
thv llm tokenshell string; only Claude Desktop needs the absolute-path shim.Assisted by Cursor.
Evidence
Live setup/teardown under a temp USERPROFILE: setup exit 0,
.cmdpresent, teardown removed the shim. Real%LOCALAPPDATA%\Claude-3pfile count stayed 0.