mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
Add structured error kinds for exec-server process starts (#61358)
## What changed Attach a tagged `ProcessStartErrorData` value to JSON-RPC errors for not-found, permission-denied, and other spawn failures, unavailable sandboxes, and sandbox preparation failures. Record the error code and structured error kind for failed `process/start` responses in the `codex.exec_server.response_received` tracing event. GitOrigin-RevId: 556d0068e469ea25e95108262826a77a66b7d83b
This commit is contained in:
@@ -497,6 +497,24 @@ pub struct ShellSnapshotRequest {
|
||||
pub shell: ShellInfo,
|
||||
}
|
||||
|
||||
/// Optional JSON-RPC error data for a rejected `process/start`.
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "kind", rename_all = "camelCase")]
|
||||
pub enum ProcessStartErrorData {
|
||||
SpawnNotFound,
|
||||
SpawnPermissionDenied,
|
||||
SpawnFailed,
|
||||
SandboxUnavailable,
|
||||
SandboxPreparation,
|
||||
}
|
||||
|
||||
impl ProcessStartErrorData {
|
||||
pub fn attach_to(self, mut error: JSONRPCErrorError) -> JSONRPCErrorError {
|
||||
error.data = Some(serde_json::json!(self));
|
||||
error
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExecResponse {
|
||||
|
||||
Reference in New Issue
Block a user