Log ChatGPT user ID for feedback tags (#13901)

There are some bug investigations that currently require us to ask users
for their user ID even though they've already uploaded logs and session
details via `/feedback`. This frustrates users and increases the time
for diagnosis.

This PR includes the ChatGPT user ID in the metadata uploaded for
`/feedback` (both the TUI and app-server).
This commit is contained in:
Eric Traut
2026-03-10 09:57:41 -06:00
committed by GitHub
parent 9a501ddb08
commit e4edafe1a8
3 changed files with 28 additions and 0 deletions

View File

@@ -266,6 +266,12 @@ impl CodexAuth {
self.get_current_token_data().and_then(|t| t.id_token.email)
}
/// Returns `None` if `is_chatgpt_auth()` is false.
pub fn get_chatgpt_user_id(&self) -> Option<String> {
self.get_current_token_data()
.and_then(|t| t.id_token.chatgpt_user_id)
}
/// Account-facing plan classification derived from the current token.
/// Returns a high-level `AccountPlanType` (e.g., Free/Plus/Pro/Team/…)
/// mapped from the ID token's internal plan value. Prefer this when you
@@ -1466,6 +1472,7 @@ mod tests {
.unwrap();
assert_eq!(None, auth.api_key());
assert_eq!(AuthMode::Chatgpt, auth.auth_mode());
assert_eq!(auth.get_chatgpt_user_id().as_deref(), Some("user-12345"));
let auth_dot_json = auth
.get_current_auth_json()