pub struct TurnFailure {Show 18 fields
pub category: FailureCategory,
pub error_type: String,
pub message: String,
pub status_code: Option<i32>,
pub error_code: Option<String>,
pub provider_call_id: Option<String>,
pub service_request_id: Option<String>,
pub originating_message_id: Option<String>,
pub remediation: Option<String>,
pub url: Option<String>,
pub model: Option<String>,
pub effort: Option<String>,
pub runtime_version: Option<String>,
pub sdk_version: &'static str,
pub elapsed: Option<Duration>,
pub delta_received: bool,
pub attachments: usize,
pub occurred_at: DateTime<Local>,
}Expand description
Why one turn failed, and the facts that help to report it.
Fields§
§category: FailureCategory§error_type: StringThe SDK errorType, or runtime_stopped and runtime_not_responding.
message: StringThe SDK message, redacted.
status_code: Option<i32>§error_code: Option<String>§provider_call_id: Option<String>The x-github-request-id of the failed call.
service_request_id: Option<String>The x-copilot-service-request-id of the failed call.
originating_message_id: Option<String>§remediation: Option<String>§url: Option<String>§model: Option<String>§effort: Option<String>§runtime_version: Option<String>§sdk_version: &'static str§elapsed: Option<Duration>The time since the turn was sent, when a turn ran.
delta_received: bool§attachments: usize§occurred_at: DateTime<Local>Implementations§
Source§impl TurnFailure
impl TurnFailure
Sourcepub fn from_session_error(
data: &Value,
turn: &TurnContext,
runtime: Option<&str>,
) -> Self
pub fn from_session_error( data: &Value, turn: &TurnContext, runtime: Option<&str>, ) -> Self
A failure from a session.error payload. A missing field stays
absent; it is never invented.
Sourcepub fn stopped(
category: FailureCategory,
message: &str,
turn: &TurnContext,
runtime: Option<&str>,
) -> Self
pub fn stopped( category: FailureCategory, message: &str, turn: &TurnContext, runtime: Option<&str>, ) -> Self
A failure Subspace detected itself: the runtime stopped or stopped answering.
Sourcepub fn rejected(
error_type: &str,
message: &str,
turn: &TurnContext,
runtime: Option<&str>,
) -> Self
pub fn rejected( error_type: &str, message: &str, turn: &TurnContext, runtime: Option<&str>, ) -> Self
A message the runtime refused before a turn could start, such as a
failed access check or a rejected send. error_type says which.
Sourcepub fn redact_with(&mut self, redact: impl Fn(&str) -> String)
pub fn redact_with(&mut self, redact: impl Fn(&str) -> String)
Applies redact to every text the failure shows or logs, such as a
replacement of the credentials the runtime knows.
Sourcepub fn details(&self) -> Vec<(&'static str, String)>
pub fn details(&self) -> Vec<(&'static str, String)>
The labelled facts the chat shows under Details, present fields only.
Sourcepub fn details_text(&self) -> String
pub fn details_text(&self) -> String
The details as Label: value lines, for Copy details.