[codex-analytics] ingest server requests and responses

This commit is contained in:
rhan-oai
2026-04-28 21:25:51 -07:00
parent e1ec9e63a0
commit 5f1e7bf6cf
16 changed files with 287 additions and 73 deletions

View File

@@ -889,6 +889,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.