Enable conversation-scoped speed selection for Cloud turns (#61178)

## What changed

- Stage Cloud speed choices for the next new turn in the conversation, alongside pending model and effort selections. Update the displayed conversation speed after admission without changing the local default.
- Offer speed commands supported by the pending model. Clear an incompatible pending speed change with a warning when switching models.
- Carry `service_tier` through Cloud message requests, preserving omission to inherit the thread tier and explicit null to clear it. Translate `default` to null and reject tier overrides on queued requests.

## Testing

Add tests for Cloud speed toggling, model-dependent speed choices, admission-time updates, and preserving the conversation tier when selecting a model. Extend request and wire tests to cover service-tier values, explicit clearing, and queue rejection.

GitOrigin-RevId: b4daa701f1fe29593d90a938e60cc20cb980298a
This commit is contained in:
Benjamin Carlsson
2026-11-12 20:56:33 +00:00
committed by copyberry
parent 72532ecae5
commit b279cfb170
20 changed files with 583 additions and 73 deletions
+33
View File
@@ -3016,6 +3016,39 @@ impl App {
AppEvent::PersistRealtimeVoiceSelection { voice } => {
self.persist_realtime_voice(app_server, voice).await;
}
AppEvent::ToggleCloudServiceTier { thread_id, tier } => {
if self.active_thread_id == Some(thread_id)
&& self.chat_widget.thread_id() == Some(thread_id)
&& app_server.thread_params_mode() == crate::ThreadParamsMode::Cloud
{
if !self.chat_widget.current_model_service_tier_commands().iter()
.any(|command| command.id == tier)
{
self.chat_widget.add_error_message(
"The selected Cloud model does not support that speed.".into(),
);
return Ok(AppRunControl::Continue);
}
let current = self.chat_widget.config_ref().service_tier.as_deref();
match app_server.toggle_cloud_service_tier(thread_id, current, tier) {
Some(tier) => {
let label = match tier.as_str() {
codex_protocol::config_types::SERVICE_TIER_DEFAULT_REQUEST_VALUE => "standard",
"priority" => "fast",
tier => tier,
};
self.chat_widget.add_info_message(
format!("Selected {label} speed for the next new turn in this conversation"),
/*hint*/ None,
);
}
None => self.chat_widget.add_error_message(
"The Cloud account changed. Reopen the conversation before choosing a speed."
.into(),
),
}
}
}
AppEvent::PersistServiceTierSelection { service_tier } => {
self.refresh_status_line();
self.config.service_tier = service_tier.clone();