Skip to main content

ExecRequest

Struct ExecRequest 

Source
pub struct ExecRequest {
Show 18 fields pub operation: Operation, pub source_format: Format, pub response_format: Format, pub requested_model: String, pub model: String, pub original_body: Bytes, pub body: Bytes, pub stream: bool, pub stream_payloads: bool, pub alt: Option<String>, pub session: Option<String>, pub execution_session: Option<String>, pub derived_session: Option<String>, pub request_path: String, pub headers: HeaderMap, pub caller: Caller, pub resolved_model: Option<ResolvedModel>, pub usage: UsageSink,
}

Fields§

§operation: Operation§source_format: Format

Format of the inbound request.

§response_format: Format

Format the client expects back.

§requested_model: String

Model named by the client, trimmed.

§model: String

Model after alias resolution, sent upstream.

§original_body: Bytes

Inbound body exactly as received.

§body: Bytes

Body in source_format, after request-level rewrites (payload rules) but before any translation. The executor translates it.

§stream: bool

The client asked for a stream. The upstream mode is the executor’s decision.

§stream_payloads: bool

Return Go executor chunks before HTTP framing, for internal model callbacks. Captured when preparing the attempt, independent of plugin interceptor lifetime.

§alt: Option<String>

Alternate operation from alt / $alt (for example responses/compact).

§session: Option<String>

Session key for affinity and provider session identity, when one was derived: Go ExtractSessionID (see cpa_common::session). Explicit client sessions carry their family prefix (claude:, codex:, header:, pck:, …); derived:<id> means Go’s derived_session_id metadata is <id>; msg: is the first-messages hash.

§execution_session: Option<String>

Go execution_session_id metadata: a long-lived execution session that outlives one HTTP request. Set only by transports that own such a session (the Responses WebSocket uses its connection’s session ID); None for ordinary HTTP routes. Provider replay caches (Codex and Kimi reasoning replay) key on execution:<id> before falling back to payload or header identity.

§derived_session: Option<String>

Go derived_session_id metadata (ctx:v1:<sha256>, from cpa_common::session::derive_id): set only when the request carries no explicit session signal and no execution session, exactly when Go’s session.Enrich sets it. Go helps.ProviderSessionUUID falls back to it after the execution session.

§request_path: String

Go request_path metadata (gin FullPath()): the matched route template, for example /v1/chat/completions or /v1beta/models/*action; the URI path when no route matched; empty for internal executions. Pass it to cpa_common::payload::Request::request_path (the disable-image-generation: chat gate keeps image generation on /v1/images/*).

§headers: HeaderMap

Inbound headers. Executors forward only what their provider profile allows. Contains client credentials: never log or forward wholesale.

§caller: Caller§resolved_model: Option<ResolvedModel>

Go cliproxyauth.ResolvedModelInfo(req): the model capabilities the dispatch loop bound to this attempt for the selected credential and upstream model (Go attachResolvedExecutionModelInfo, sdk/cliproxy/auth/api_key_model_capabilities.go). None when Go binds nothing; executors then fall back to the registry lookup (cpa_core::registry::lookup_model), as Go’s helpers do. Callers outside the dispatch loop set None.

§usage: UsageSink

Usage accounting for this attempt (Go’s per-executor UsageReporter). Optional: without reports the server parses the client-format response, which matches Go whenever the upstream speaks the client’s format. Executors that translate should forward the upstream payloads Go parses; UsageSink::default() is a no-op.

Implementations§

Source§

impl ExecRequest

Source

pub fn capture(&self) -> &CaptureSink

Optional per-call wire capture, independent of usage accounting. Capture the handle before spawning a stream task; clones retain the same observer.

Source

pub fn websocket_emitter( &self, provider: &'static str, credential: &Credential, ) -> Option<WebSocketEmitter>

The attempt’s WebSocket response observer bound to the executor provider, the selected credential and this request’s upstream model; None without one.

Trait Implementations§

Source§

impl Clone for ExecRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more