• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 28858636135

07 Jul 2026 10:13AM UTC coverage: 67.961% (+0.03%) from 67.932%
28858636135

push

github

web-flow
Add Claude Desktop as an LLM gateway client (#5712)

* Add Claude Desktop as an LLM gateway client

thv llm setup can route Claude Code and several editors through an
OIDC-protected LLM gateway, but not Claude Desktop. Claude Desktop
exposes a different configuration surface — its "third-party inference"
(Cowork 3P) model — which uses a configLibrary document plus a
_meta.json selector and a credential-helper executable, none of which
fit the existing JSON-key-patching path.

Add a credential-helper client mode that reuses "thv llm token":

- New ClaudeDesktop client with LLMGatewayMode "credential-helper".
  Writes a <uuid>.json config document (inferenceProvider/gateway URL/
  helper-script kind/models) and merges a _meta.json selector, preserving
  any user-owned entries. Generates a no-arg shim that execs
  "thv llm token" (browser only in the interactive helper context).
- Detect Claude Desktop by its app-support directory (a GUI app, not on
  $PATH); warn when a managed-preferences profile would override the
  local config; tell the user to relaunch (config is read at launch).
- Teardown removes the entry, config document, and shim, and clears
  appliedId only when it pointed at ToolHive's config.
- New --models flag feeds inferenceModels; the key is omitted when empty
  so the app can fall back to gateway model discovery once available.

Verified end-to-end against a real Claude Desktop install (config
applied, live inference on all models) plus unit and e2e coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address review: safer teardown ordering and cleanup

- revertCredentialHelper: de-reference _meta.json and delete the config
  document before removing the shim, so a mid-revert failure never leaves
  Claude Desktop pointing at a config that references a missing helper.
  Treat an empty configPath as a no-op (do not touch the shim when we
  cannot confirm the selector no longer references it).
- configureCred... (continued)

256 of 329 new or added lines in 4 files covered. (77.81%)

18 existing lines in 5 files now uncovered.

73060 of 107503 relevant lines covered (67.96%)

64.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.56
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc