Use ChatGPT account preferences for Codex voice chat (#63810)

## Why

Codex stored voice selections in `realtime.voice` and supplied voice overrides when starting realtime sessions. Reading and saving the ChatGPT account preference lets Codex use the same voice selection as ChatGPT.

## What changed

- Add experimental `account/voiceSettings/read` and `account/voiceSettings/write` methods. The terminal voice picker shows the selected voice and available display names, then saves the chosen voice ID to the connected app server's ChatGPT account, including when the server is remote.
- Require ChatGPT sign-in for terminal voice chat and create its WebRTC calls through the ChatGPT backend.
- Remove voice overrides from realtime session startup. Existing `realtime.voice` entries still parse but are ignored.

## Testing

Cover voice picker loading and saving, remote catalog failures, the ChatGPT sign-in requirement for local calls, and omission of voice overrides from realtime call payloads.

GitOrigin-RevId: 9e6f30b8020c47701d3c1604075063924f191685
This commit is contained in:
Jackson Moody
2026-11-25 02:31:54 +00:00
committed by copyberry
parent 986a6b3b11
commit e2c31f625a
78 changed files with 828 additions and 1591 deletions
+37
View File
@@ -15,6 +15,8 @@ use codex_features::RuntimeAuthMode;
use codex_http_client::CHATGPT_ACCOUNT_ID_HEADER;
use codex_http_client::ClientRouteClass;
use codex_http_client::HttpClientFactory;
use codex_http_client::HttpError;
use codex_http_client::HttpResponse;
use codex_http_client::OutboundProxyPolicy;
use codex_http_client::RequestBuilder;
use codex_http_client::RouteAwareClientPool;
@@ -559,6 +561,41 @@ impl Client {
Ok(self.get_rate_limits_with_reset_credits().await?.rate_limits)
}
pub async fn get_voice_settings(&self) -> Result<crate::VoiceSettings> {
let response = self
.voice_settings_request(Method::GET, "settings/voices", &[("voice_mode", "wingman")])
.await?;
Ok(response.json().await.map_err(HttpError::without_url)?)
}
pub async fn set_voice(&self, voice: &str) -> Result<()> {
self.voice_settings_request(
Method::PATCH,
"settings/account_user_setting",
&[("feature", "voice_name"), ("value", voice)],
)
.await?;
Ok(())
}
async fn voice_settings_request(
&self,
method: Method,
path: &str,
query: &[(&str, &str)],
) -> Result<HttpResponse> {
let url = format!("{}/{path}", self.base_url);
let request = self
.request(method, &url)
.headers(self.headers().await?)
.query(query);
self.auth.validate_destination(&self.base_url, &url)?;
let response = request.send().await.map_err(HttpError::without_url)?;
let status = response.status();
anyhow::ensure!(status.is_success(), "HTTP {status}");
Ok(response)
}
pub async fn get_accounts_check(
&self,
) -> std::result::Result<AccountsCheckResponse, RequestError> {
+2
View File
@@ -48,6 +48,8 @@ pub use types::TokenUsageProfile;
pub use types::TokenUsageProfileDailyBucket;
pub use types::TokenUsageProfileStats;
pub use types::TurnAttemptsSiblingTurnsResponse;
pub use types::VoiceOption;
pub use types::VoiceSettings;
pub use client::plan_history::PlanLimitBreakdown;
pub use client::plan_history::PlanLimitDimension;
+12
View File
@@ -90,6 +90,18 @@ pub struct CodexUserSettingsResponse {
pub commit_attribution_enabled: bool,
}
#[derive(Debug, Deserialize)]
pub struct VoiceSettings {
pub selected: String,
pub voices: Vec<VoiceOption>,
}
#[derive(Clone, Debug, Deserialize)]
pub struct VoiceOption {
pub voice: String,
pub name: Option<String>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
pub struct CodexWorkspaceMessage {
pub message_id: String,