Propagate auth session logging ID in ChatGPT login

This commit is contained in:
Darren Hwang
2026-06-04 06:42:46 +00:00
parent 80b65e9945
commit 2fac8460a7
17 changed files with 166 additions and 7 deletions
@@ -1265,6 +1265,13 @@
},
{
"properties": {
"authSessionLoggingId": {
"description": "Optional auth session logging ID propagated to authapi for analytics correlation.",
"type": [
"string",
"null"
]
},
"codexStreamlinedLogin": {
"type": "boolean"
},
@@ -10569,6 +10569,13 @@
},
{
"properties": {
"authSessionLoggingId": {
"description": "Optional auth session logging ID propagated to authapi for analytics correlation.",
"type": [
"string",
"null"
]
},
"codexStreamlinedLogin": {
"type": "boolean"
},
@@ -7091,6 +7091,13 @@
},
{
"properties": {
"authSessionLoggingId": {
"description": "Optional auth session logging ID propagated to authapi for analytics correlation.",
"type": [
"string",
"null"
]
},
"codexStreamlinedLogin": {
"type": "boolean"
},
@@ -23,6 +23,13 @@
},
{
"properties": {
"authSessionLoggingId": {
"description": "Optional auth session logging ID propagated to authapi for analytics correlation.",
"type": [
"string",
"null"
]
},
"codexStreamlinedLogin": {
"type": "boolean"
},
@@ -2,7 +2,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt", codexStreamlinedLogin?: boolean, } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens",
export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt", codexStreamlinedLogin?: boolean,
/**
* Optional auth session logging ID propagated to authapi for analytics correlation.
*/
authSessionLoggingId?: string, } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens",
/**
* Access token (JWT) supplied by the client.
* This token is used for backend API requests and email extraction.
@@ -2507,6 +2507,7 @@ mod tests {
request_id: RequestId::Integer(3),
params: v2::LoginAccountParams::Chatgpt {
codex_streamlined_login: false,
auth_session_logging_id: None,
},
};
assert_eq!(
@@ -2528,6 +2529,7 @@ mod tests {
request_id: RequestId::Integer(3),
params: v2::LoginAccountParams::Chatgpt {
codex_streamlined_login: true,
auth_session_logging_id: None,
},
};
assert_eq!(
@@ -2544,6 +2546,29 @@ mod tests {
Ok(())
}
#[test]
fn serialize_account_login_chatgpt_with_auth_session_logging_id() -> Result<()> {
let request = ClientRequest::LoginAccount {
request_id: RequestId::Integer(3),
params: v2::LoginAccountParams::Chatgpt {
codex_streamlined_login: false,
auth_session_logging_id: Some("auth-session-123".to_string()),
},
};
assert_eq!(
json!({
"method": "account/login/start",
"id": 3,
"params": {
"type": "chatgpt",
"authSessionLoggingId": "auth-session-123"
}
}),
serde_json::to_value(&request)?,
);
Ok(())
}
#[test]
fn serialize_account_login_chatgpt_device_code() -> Result<()> {
let request = ClientRequest::LoginAccount {
@@ -58,6 +58,10 @@ pub enum LoginAccountParams {
Chatgpt {
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
codex_streamlined_login: bool,
/// Optional auth session logging ID propagated to authapi for analytics correlation.
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
auth_session_logging_id: Option<String>,
},
#[serde(rename = "chatgptDeviceCode")]
#[ts(rename = "chatgptDeviceCode")]