Skip to main content

Module provider_host

Module provider_host 

Source
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§

AgentHost
The host every workspace-side backend probe runs against.

Statics§

UA 🔒
Cached claude-code/<version> User-Agent, probed once per process. User-Agent native 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 --version round-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 cached AgentHost::user_agent so the exec and its failure class are drivable without resolving a real binary.