Expand description
Install / uninstall LLM-client proxy environment wiring.
Submodules hold per-client setup (Claude, Codex, Grok, Pi, shell). This
facade keeps the public API stable as crate::proxy_setup::*.
Functions§
- agent_
routed_ through_ proxy - The
security.require_proxyprobe the binary registers with the Engine (cloud_agents::set_proxy_routing_probe). - anthropic_
api_ key_ available - Returns true when an Anthropic API key is available for the proxy to forward upstream.
- cleanup_
stale_ proxy_ env - Removes stale proxy URLs from Claude Code / Codex settings when the proxy is not enabled. Returns the number of stale URLs cleaned up.
- configured_
proxy_ live - Single source of truth for “is the proxy up” across
doctor,statusandgain: the proxy must be enabled in config AND the configured endpoint must answer as a lean-ctx proxy. - default_
port - egress_
routed_ hosts - Hosts whose model traffic is routed through the local lean-ctx proxy right now (read-only). Requires the proxy to be enabled; a leftover local URL with the proxy off routes nothing and is reported as not routed.
- grok_
session_ auth_ available - True when
~/.grok/auth.jsonholds a session/OIDC access token (subscription). - has_
stale_ proxy_ url - install_
proxy_ env - install_
proxy_ env_ unchecked - Install proxy env without config guard (used by
lean-ctx proxy enablewhich has already set the flag).force_endpoint: if true, overrides even non-local custom endpoints. - is_
local_ lean_ ctx_ url - True when
urlis the lean-ctx proxy itself: a loopback base URL on a port lean-ctx owns. Callers use this to decide what lean-ctx may overwrite or remove, so “any localhost URL” is not enough — another local gateway (Omniroute, LiteLLM, a corporate relay) belongs to the user (#1972). - lean_
ctx_ proxy_ responding - True when the lean-ctx proxy itself answers
GET /healthonport. An open port alone proves nothing: a foreign process (or another user’s proxy) listening there must never count as “proxy up”. - preview_
proxy_ cleanup - proxy_
timeout - Proxy reachability timeout. Priority: env var > config.toml > 200ms default.
- uninstall_
proxy_ env - xai_
api_ key_ available - True when an xAI API key is available for the API-key rail.