Show the selected ChatGPT workspace in /status (#57366)

## What changed

- Return the selected workspace's display name as `workspaceName` in ChatGPT account responses, caching it alongside workspace routing and updating generated schemas and bindings.
- Display a `ChatGPT workspace` row with the name and account ID, falling back to the ID when the name is unavailable or invalid. Refresh workspace details with account identity updates and hide the row for providers that do not use ChatGPT authentication.

## Testing

Update account-response tests to cover workspace names and null values, add workspace details to the status snapshot, and verify that switching to a custom API-key provider hides the workspace row.

GitOrigin-RevId: 4b30ab8a39e1fa7ad1ba7367c5295544be8f6001
This commit is contained in:
Eric Traut
2026-10-27 05:22:23 +00:00
committed by copyberry
parent 6c0db39b94
commit 155dde7ff6
26 changed files with 216 additions and 38 deletions
@@ -6805,6 +6805,13 @@
],
"title": "ChatgptAccountType",
"type": "string"
},
"workspaceName": {
"description": "Display name of the selected ChatGPT workspace, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -40,6 +40,13 @@
],
"title": "ChatgptAccountType",
"type": "string"
},
"workspaceName": {
"description": "Display name of the selected ChatGPT workspace, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -36,6 +36,13 @@
],
"title": "ChatgptAccountType",
"type": "string"
},
"workspaceName": {
"description": "Display name of the selected ChatGPT workspace, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -3,4 +3,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PlanType } from "../PlanType";
export type Account = { "type": "apiKey", } | { "type": "chatgpt", email: string | null, planType: PlanType, } | { "type": "amazonBedrock", usesCodexManagedCredentials: boolean, } | { "type": "gcp", };
export type Account = { "type": "apiKey", } | { "type": "chatgpt", email: string | null, planType: PlanType,
/**
* Display name of the selected ChatGPT workspace, when available.
*/
workspaceName: string | null, } | { "type": "amazonBedrock", usesCodexManagedCredentials: boolean, } | { "type": "gcp", };
@@ -3654,12 +3654,14 @@ mod tests {
let chatgpt = v2::Account::Chatgpt {
email: Some("user@example.com".to_string()),
plan_type: PlanType::Plus,
workspace_name: None,
};
assert_eq!(
json!({
"type": "chatgpt",
"email": "user@example.com",
"planType": "plus",
"workspaceName": null,
}),
serde_json::to_value(&chatgpt)?,
);
@@ -3667,12 +3669,14 @@ mod tests {
let chatgpt_without_email = v2::Account::Chatgpt {
email: None,
plan_type: PlanType::Pro,
workspace_name: None,
};
assert_eq!(
json!({
"type": "chatgpt",
"email": null,
"planType": "pro",
"workspaceName": null,
}),
serde_json::to_value(&chatgpt_without_email)?,
);
@@ -33,6 +33,8 @@ pub enum Account {
)]
email: Option<String>,
plan_type: PlanType,
/// Display name of the selected ChatGPT workspace, when available.
workspace_name: Option<String>,
},
#[serde(rename = "amazonBedrock", rename_all = "camelCase")]
@@ -52,7 +54,11 @@ impl From<ProviderAccount> for Account {
fn from(account: ProviderAccount) -> Self {
match account {
ProviderAccount::ApiKey => Self::ApiKey {},
ProviderAccount::Chatgpt { email, plan_type } => Self::Chatgpt { email, plan_type },
ProviderAccount::Chatgpt { email, plan_type } => Self::Chatgpt {
email,
plan_type,
workspace_name: None,
},
ProviderAccount::AmazonBedrock {
uses_codex_managed_credentials,
} => Self::AmazonBedrock {