Expose ChatGPT user IDs in account/read responses (#60004)

## What changed

Add a nullable `userId` to `GetAccountResponse`, populated from the same authenticated account snapshot as the rest of the response. ChatGPT and personal access token sessions return the canonical ChatGPT user ID when available; API-only and signed-out sessions return `null`.

Update the cloud client, generated schemas, TypeScript and Python types, and account identity documentation. Default missing IDs to `None` when deserializing responses from older app servers.

## Testing

Extend account response tests to check ChatGPT and personal access token user IDs, null IDs for other providers and signed-out sessions, and ID changes when switching providers with saved ChatGPT credentials.

GitOrigin-RevId: 7ad3da3cfc835c4d08d03c8e91b06cd7e007d874
This commit is contained in:
dand-oai
2026-11-06 22:27:47 +00:00
committed by copyberry
parent 44f1b0e867
commit 01ab354312
21 changed files with 117 additions and 13 deletions
@@ -55,12 +55,14 @@ fn client_response_jsonrpc_parts_preserve_payloads_and_request_ids() -> Result<(
),
(
ClientResponsePayload::GetAccount(v2::GetAccountResponse {
user_id: None,
account: Some(v2::Account::ApiKey {}),
requires_openai_auth: false,
workspace_routing: None,
}),
json!({
"account": { "type": "apiKey" },
"userId": null,
"requiresOpenaiAuth": false,
"workspaceRouting": null,
}),
@@ -586,6 +586,9 @@ pub struct GetAccountParams {
#[ts(export_to = "v2/")]
pub struct GetAccountResponse {
pub account: Option<Account>,
/// ChatGPT user ID belonging to this account response, when available.
#[serde(default)]
pub user_id: Option<String>,
pub requires_openai_auth: bool,
#[experimental("account/read.workspaceRouting")]
pub workspace_routing: Option<WorkspaceRouting>,