stacklok / stacklok/toolhive

feat(llm): auto-start proxy after setup when proxy-mode tools are configured

Open
#5,272 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement go llm gateway
Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Currently thv llm setup detects proxy-mode tools (Cursor, VS Code, Xcode), patches their config files, then exits with a printed reminder:

One or more tools use proxy mode. Start the proxy with: thv llm proxy start

(see pkg/llm/setup.go:141-142)

Users must manually run thv llm proxy start in a separate terminal and keep it running. This is an extra friction step that is easy to miss and causes proxy-mode tools to silently fail.

Proposal: When thv llm setup detects at least one proxy-mode tool, automatically start the proxy process (equivalent to thv llm proxy start) at the end of setup rather than just printing a reminder. This could be:

  • Foreground (blocking) — simple, consistent with current thv llm proxy start behavior
  • Background daemon — lower friction but adds complexity (PID management, restart on reboot)

The foreground option is the minimal change: after persisting tool configs, if hasProxyMode(configured) is true, call the proxy start logic directly instead of (or in addition to) printing the reminder message.

Notes:

  • Token-helper / direct-mode tools (Claude Code, Gemini CLI) do NOT need the proxy and should be unaffected.
  • The proxy could still be exposed as a standalone thv llm proxy start command for users who want explicit control or need to restart it independently.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at pkg/llm/setup.go:141-142 and trace the existing thv llm proxy start entry point. Determine how setup persists proxy-mode tool configurations and how the chosen foreground or background startup should integrate, while leaving token-helper/direct-mode tools unchanged. Done means proxy-mode tools work immediately after setup and standalone proxy start remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ai, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.