[codex-analytics] ingest server requests and responses

This commit is contained in:
rhan-oai
2026-04-20 17:03:51 -07:00
committed by Roy Han
parent b04ffeee4c
commit 840f2711df
16 changed files with 309 additions and 75 deletions

View File

@@ -678,6 +678,23 @@ macro_rules! server_request_definitions {
$(Self::$variant { request_id, .. } => request_id,)*
}
}
pub fn response_from_result(
&self,
result: crate::Result,
) -> serde_json::Result<ServerResponse> {
match self {
$(
Self::$variant { request_id, .. } => {
let response = serde_json::from_value::<$response>(result)?;
Ok(ServerResponse::$variant {
request_id: request_id.clone(),
response,
})
}
)*
}
}
}
/// Typed response from the client to the server.