Expand description
Upstream executors. One module per provider; each owns its wire format, auth headers
and HTTP client profile. Executors dispatches on Credential::provider.
Each call gets the config snapshot current when the request started, so a hot reload never changes behaviour halfway through one execution.
Credential preparation (token refresh, device identity creation) is a two-step
contract so the runtime can single-flight it: Executors::readiness is a cheap
check, and Executors::prepare does the work and returns a MetadataPatch that
the runtime commits. Executors never write credential files themselves.
Readiness separates the two reasons Go prepares a credential. Requests block only
on Readiness::PrepareNow (Go RequestAuthPreparer: Claude identity, Meta API-key
mint, Antigravity project ID; also an Antigravity token inside five minutes of
expiry, which Go’s executor refreshes inline). Token refresh is
Readiness::RefreshSoon: the
background loop refreshes inside the provider’s refresh lead while requests keep
using the current token, and an upstream 401 triggers one refresh-and-retry (Go
tryRefreshAfterUnauthorized). An already expired token is still RefreshSoon:
Go sends it and recovers on 401.
Modules§
- aistudio
- AI Studio over the
/v1/wsrelay (internal/runtime/executor/aistudio_executor.go). - antigravity
- The Antigravity executor (internal/runtime/executor/antigravity_executor*.go).
- antigravity_
auth - Antigravity OAuth (internal/auth/antigravity, sdk/auth/antigravity.go) and the executor’s credential preparation (antigravity_executor_auth.go).
- antigravity_
credits - Antigravity AI credits (antigravity_executor_credits.go and sdk/cliproxy/auth/antigravity_credits.go).
- antigravity_
version - The Antigravity client version and user agents (internal/misc/antigravity_version.go).
- claude
- Claude executor: Anthropic Messages and count_tokens with OAuth tokens or API keys.
- claude_
login --claude-login: Go’s browser OAuth flow (sdk/auth/claude.go, sdk/auth/manager.go, internal/auth/claude/{oauth_server,html_templates,filename}.go).- codex
- Codex executor: OpenAI Responses on the ChatGPT Codex backend, with an OAuth token
(bearer +
Chatgpt-Account-Id) or a configured API key (codex-api-key). - codex_
live - Codex live calls (internal/client/codex/live): the WebRTC SDP bootstrap request to the ChatGPT realtime calls endpoint, its sideband and standard Realtime WebSockets, and hangup.
- codex_
oauth - Codex (ChatGPT) OAuth: browser PKCE and device login, token refresh, and the auth file Go writes (internal/auth/codex, sdk/auth/codex.go, sdk/auth/codex_device.go, internal/runtime/executor/codex_executor_auth.go).
- codex_
quota - Codex passive quota observation:
codex.rate_limitsWebSocket events and error-frame headers normalised intoX-Codex-*headers (helps/codex_quota.go), and the provider-scoped signal snapshot Go keeps per credential (sdk/cliproxy/auth/quota_signals.go). - codex_
refresh - Codex token refresh: which token partitions refresh (Go codex_executor_auth.go
Refresh/refreshLocked), and the partition-scoped result that lands on the credential file as read under its lock (internal/auth/codex/refresh_patch.go). - codex_
siwc - Codex Sign in with ChatGPT (SIWC): the authorization URL, the code exchange and the
bound credential file (Go internal/auth/codex/siwc_auth.go, openai.go
CodexSIWCTokenDataand sdk/cliproxy/auth/codex_siwc_bind.go). SIWC is a second token partition (siwc) of an existing Codex OAuth credential. Refresh and request use (use_siwc) belong to the Codex executor. - codex_
siwc_ bind -siwc-bind(Go internal/cmd/siwc_bind.go, 7b0319fb): runs the Sign in with ChatGPT browser flow from the command line and writes thesiwctoken partition anduse_siwcinto an existing Codex OAuth credential file inauth-dir, under Go’s credential lock file (internal/auth/codex/token.goWithFileLock).- devin
- Devin executor (internal/runtime/executor/devin_executor.go).
- devin_
auth - Devin login and account status (internal/auth/devin, sdk/auth/devin.go, internal/cmd/devin_login.go).
- devin_
models - Devin model resolution (helps/devin_models.go). The catalog updater lives in
cpa_server::model_updater. - gemini
- Gemini API keys and native Interactions keys (internal/runtime/executor/gemini_executor.go).
- kimi
- Kimi executor (internal/runtime/executor/kimi_executor.go).
- kimi_
auth - Kimi (.com and .ai) RFC 8628 device login, token refresh and credential files (internal/auth/kimi, sdk/auth/kimi.go).
- meta
- Meta Muse executor (internal/runtime/executor/meta_executor*.go).
- meta_
auth - Meta Muse RFC 8628 device login, API-key minting and credential files (internal/auth/meta/meta.go, sdk/auth/meta.go, internal/cmd/meta_login.go).
- oauth
- Claude OAuth acquisition and metadata preparation. Runtime owns patch publication.
- openai_
compat - OpenAI-compatible upstreams (internal/runtime/executor/openai_compat_executor.go):
configured providers reached with a bearer API key at
base_url, speaking Chat Completions, Responses compact and the Images API. - openai_
compat_ multipart - Go
mime/multipartandmime.ParseMediaType, as the images paths use them (Reader.ReadForm, thenWriter.WriteField/CreatePart). Ported from Go 1.26mime/multipart/multipart.go,formdata.goandmime/mediatype.go. - proxy
- Proxy-aware HTTP clients with Go net/http semantics, shared by every executor (helps/proxy_helpers.go, sdk/proxyutil, net/http client behaviour; M4-0029).
- vertex
- Vertex AI (internal/runtime/executor/gemini_vertex_executor.go).
- vertex_
auth - Vertex service-account credentials (internal/auth/vertex, internal/cmd/vertex_import.go)
and the Google JWT token source the Vertex executor uses (golang.org/x/oauth2/google
CredentialsFromJSONwith the cloud-platform scope, v0.30.0). - wsrelay
- The
/v1/wsrelay (internal/wsrelay): an AI Studio browser bridge connects over a websocket and performs HTTP requests on the proxy’s behalf. Each connection is a session namedaistudio-<16 random characters>; requests and their responses are JSON messages correlated by ID. - xai
- xAI Grok (internal/runtime/executor/xai_executor*.go): the Responses API reached with
an API key at
api.x.aior with a Grok OAuth token at the Grok CLI chat proxy, plus Responses compact, token counting and the image and video APIs. - xai_
auth - xAI RFC 8628 device login with OIDC discovery, token refresh and credential files (internal/auth/xai, sdk/auth/xai.go, internal/runtime/executor/xai_executor_auth.go).
- xai_url
- The part of Go’s
net/url.Parsethat xAI endpoint validation depends on: the same accept/reject decisions, the sameHostname()and the same error text. Rust’surlcrate follows WHATWG and disagrees with Go on inputs such ashttps://%61uth.x.ai,https://auth.x.ai\@evil.com, embedded tabs,https:auth.x.aiand port 99999.
Structs§
- Device
Executors - Executors for the device-login providers, grouped so adding one does not touch every
Executorsconstruction site. - Executors
- Google
Executors - Google-family executors, grouped like
DeviceExecutors. - OpenAI
Executors - OpenAI-wire executors, grouped like
DeviceExecutors.
Enums§
- Readiness
- What a credential needs before or around use. See the module docs.
Functions§
- ensure_
responses_ usage_ details - Go
helps.EnsureResponsesUsageDetails, for paths outside the executors (plugin executors’ Responses payloads and stream chunks).EnsureResponsesUsageDetails. - expiration
- Go
Auth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime: access-token JWTexp, then metadata expiry fields. - last_
refresh - Go
Auth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). - preferred_
interval - Go
Auth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). GoAuth.ExpirationTime,authLastRefreshTimestampandauthPreferredInterval, for the server’s plugin refresh schedule (GoshouldRefreshfor providers without a lead). - websockets_
enabled xaiWebsocketsEnabled(and Go’s identicalauthWebsocketsEnabled): thewebsocketsattribute when it parses, else the metadata value (a bool, or a string that parses).