Expand description
forge-agent’s implementation of the
forge_gateway::ProviderHost port. The extra-roots HTTP client
and the claude --version UA cache stay on this side of the port
so forge-gateway carries no process plumbing of its own.
Re-exports§
use std::sync::OnceLock;🔒use std::time::Duration;🔒use async_trait::async_trait;🔒use forge_gateway::ProviderHost;🔒
Structs§
- Agent
Host - The host every workspace-side backend probe runs against.
Statics§
- UA 🔒
- Cached
claude-code/<version>User-Agent, probed once per process.User-Agentnative CLI sends on /api/oauth/usage, captured from mitmdump 2026-05-26 against claude CLI 2.1.133:claude-code/<version>, no parens, no(external, cli)suffix - distinct from the /v1/messages UA shape. Only a successful probe is cached; a failure re-probes on the next call rather than pinning a stale fallback that would lie about which version is running.
Functions§
- resolve_
ua 🔒 - One
claude --versionround-trip, formatted as the UA. The shell-out runs under spawn_blocking so a slow binary lookup never parks a tokio worker; split from the cachedAgentHost::user_agentso the exec and its failure class are drivable without resolving a real binary.