Skip to main content

Module exec

Module exec 

Source
Expand description

The execution envelope: what the runtime hands an executor and what comes back.

Transport-neutral on purpose. Executors own their HTTP clients; nothing here knows about wreq or axum (sdk/cliproxy/executor/types.go).

Ownership: the executor owns request translation, provider preparation (cloak, aliases) and response restoration, in that order. Nothing before the executor translates; nothing after it un-aliases.

Structs§

CacheBreakpoint
CacheFingerprint
No payloads or credentials: keyed fingerprints and serialized byte lengths only. Replay estimates token positions offline from returned aggregate usage.
Caller
The authenticated downstream caller. Private request context: it seeds stable per-caller state such as Claude tool aliases and must never be sent upstream.
CaptureSink
Default no-op; providers call this at Go’s logging_helpers call sites.
ClaudeCacheTelemetry
ExecError
ExecRequest
ExecResponse
ExecSession
A long-lived downstream connection (the Responses WebSocket, GET /v1/responses) whose turns can share upstream state. It travels next to an ExecRequest in cpa_exec::Executors::execute_in_session. Executors that pool upstream sockets key them by id and release them in Executors::close_session when the downstream connection ends (Go: execution session id and CloseExecutionSession).
ResolvedModel
Capabilities bound to one execution attempt (Go *registry.ModelInfo stored under a request metadata key).
SessionLease
A shared Retainable, compared by identity.
UpstreamRequest
Go helps.UpstreamRequestLog. Credentials and bodies intentionally have no Debug implementation. The observer owns Go’s masking and formatting policy.
UsageSink
A handle executors report usage through; cloning shares the observer.
WebSocketEmitter
Go helps.EmitWebSocketResponseEvent for one attempt.

Enums§

CaptureEvent
FailureScope
What a failure says about the attempt, for retry and cooldown decisions.
Operation
ResolvedSource
Which request metadata key Go stores the binding under. Go’s ResolvedModelInfo reads either; ResolvedAPIKeyModelInfo reads only ResolvedSource::ApiKey.
ResponseBody
UpstreamStage
A stage of one upstream exchange, as the shared HTTP client sees it (cpa_exec::proxy::send_routed). A redirect sends the request again: Started comes once, Hop, Connected and BodySent for each hop, the rest for the final response.

Traits§

CaptureObserver
Retainable
A Home pick a pooled upstream socket can keep beyond the turn (Go ExecutionLifecycle with Retain).
UsageObserver
Receives the upstream payloads Go’s executors feed their usage reporter.
WebSocketObserver
Receives the upstream WebSocket frames Go’s executors pass to helps.EmitWebSocketResponseEvent (the Codex and xAI WebSockets).

Type Aliases§

ExecStream
One framed unit of a streaming response (for SSE: one complete event). An Err item is terminal: consumers stop polling after it.