mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
Use model-specific speeds for /model --speed (#65092)
## Why Speed completion always suggested `flex`, even for models that did not advertise it, and omitted other available tiers such as `priority`. ## What changed Offer `standard` and the enabled service tiers advertised for the model named in `/model`. When the command omits the model, use the current model. Use the same choices in unavailable-speed errors. Allow explicit use of unadvertised `flex` in `/model` and quick dials when using the OpenAI provider with an API key. Keep completion limited to `standard` and advertised tiers. ## Testing Add coverage for model-specific completion and validation, including clearing stale suggestions when the model catalog is cleared. Cover saving and recalling a quick dial with unadvertised Flex using an OpenAI API key and rejecting that speed on another provider. GitOrigin-RevId: b5139d03561842eaf00511f018f6e626cf695bc5
This commit is contained in:
@@ -697,6 +697,7 @@ pub(crate) struct ChatComposer {
|
||||
token_activity_command_enabled: bool,
|
||||
service_tier_commands_enabled: bool,
|
||||
service_tier_commands: Vec<ServiceTierCommand>,
|
||||
model_speeds: crate::slash_command_settings::ModelSpeeds,
|
||||
mentions_v2_enabled: bool,
|
||||
goal_command_enabled: bool,
|
||||
voice_command_enabled: bool,
|
||||
@@ -889,6 +890,7 @@ impl ChatComposer {
|
||||
token_activity_command_enabled: false,
|
||||
service_tier_commands_enabled: false,
|
||||
service_tier_commands: Vec::new(),
|
||||
model_speeds: HashMap::new(),
|
||||
mentions_v2_enabled: false,
|
||||
goal_command_enabled: false,
|
||||
voice_command_enabled: false,
|
||||
@@ -1099,8 +1101,15 @@ impl ChatComposer {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_service_tier_commands(&mut self, commands: Vec<ServiceTierCommand>) {
|
||||
self.update_slash_command_catalog(|composer| composer.service_tier_commands = commands);
|
||||
pub fn set_service_tier_commands(
|
||||
&mut self,
|
||||
commands: Vec<ServiceTierCommand>,
|
||||
speeds: crate::slash_command_settings::ModelSpeeds,
|
||||
) {
|
||||
self.update_slash_command_catalog(|composer| {
|
||||
composer.service_tier_commands = commands;
|
||||
composer.model_speeds = speeds;
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_goal_command_enabled(&mut self, enabled: bool) {
|
||||
@@ -9612,11 +9621,14 @@ mod tests {
|
||||
/*disable_paste_burst*/ false,
|
||||
);
|
||||
composer.set_service_tier_commands_enabled(/*enabled*/ true);
|
||||
composer.set_service_tier_commands(vec![ServiceTierCommand {
|
||||
id: "priority".to_string(),
|
||||
name: "fast".to_string(),
|
||||
description: "Fastest inference with increased plan usage".to_string(),
|
||||
}]);
|
||||
composer.set_service_tier_commands(
|
||||
vec![ServiceTierCommand {
|
||||
id: "priority".to_string(),
|
||||
name: "fast".to_string(),
|
||||
description: "Fastest inference with increased plan usage".to_string(),
|
||||
}],
|
||||
Default::default(),
|
||||
);
|
||||
type_chars_humanlike(&mut composer, &['/', 'f', 'a', 's', 't']);
|
||||
|
||||
let (result, _needs_redraw) =
|
||||
|
||||
@@ -67,7 +67,7 @@ impl ArgumentPopup {
|
||||
let matches: Vec<_> = target
|
||||
.choices
|
||||
.iter()
|
||||
.filter(|value| value.starts_with(&prefix))
|
||||
.filter(|value| value.to_ascii_lowercase().starts_with(&prefix))
|
||||
.cloned()
|
||||
.collect();
|
||||
if matches.is_empty() {
|
||||
@@ -151,7 +151,7 @@ impl ChatComposer {
|
||||
.collect(),
|
||||
)
|
||||
} else {
|
||||
named::target(text, cursor, start, command)?
|
||||
named::target(text, cursor, start, command, &self.model_speeds)?
|
||||
};
|
||||
if self
|
||||
.draft
|
||||
@@ -180,8 +180,11 @@ impl ChatComposer {
|
||||
{
|
||||
return true;
|
||||
}
|
||||
let Ok(value) = shlex::try_quote(value) else {
|
||||
return false;
|
||||
};
|
||||
let mut completed = text.to_owned();
|
||||
completed.replace_range(range.clone(), value);
|
||||
completed.replace_range(range.clone(), &value);
|
||||
parse_slash_name(&completed)
|
||||
.is_some_and(|(_, args, _)| parent_owned_command_is_allowed(command, args))
|
||||
});
|
||||
@@ -262,7 +265,8 @@ impl ChatComposer {
|
||||
&& target.identity == identity
|
||||
&& target.prefix == prefix
|
||||
&& target.choices.contains(&value)
|
||||
}) {
|
||||
}) && let Ok(value) = shlex::try_quote(&value)
|
||||
{
|
||||
self.draft.textarea.replace_range(range.clone(), &value);
|
||||
self.draft.textarea.set_cursor(range.start + value.len());
|
||||
self.popups.dismissed_argument_token =
|
||||
|
||||
@@ -12,6 +12,7 @@ pub(super) fn target(
|
||||
cursor: usize,
|
||||
args_start: usize,
|
||||
command: SlashCommand,
|
||||
model_speeds: &slash_command_settings::ModelSpeeds,
|
||||
) -> Option<(Range<usize>, Vec<String>)> {
|
||||
let mut settings = slash_command_settings::for_command(command);
|
||||
if settings.values.is_empty() && settings.switches.is_empty() && settings.booleans.is_empty() {
|
||||
@@ -46,26 +47,6 @@ pub(super) fn target(
|
||||
words.remove(0);
|
||||
}
|
||||
|
||||
let mut used = Vec::new();
|
||||
let mut pending_value = None;
|
||||
let mut positionals = 0;
|
||||
for word in &words {
|
||||
if pending_value.take().is_some() && !word.starts_with("--") {
|
||||
continue;
|
||||
}
|
||||
if word == "--" {
|
||||
return None;
|
||||
}
|
||||
if word.starts_with("--") {
|
||||
let (name, inline) = word.split_once('=').unwrap_or((word.as_str(), ""));
|
||||
used.push(name);
|
||||
if settings.values.contains(&name) && inline.is_empty() {
|
||||
pending_value = Some(name);
|
||||
}
|
||||
} else {
|
||||
positionals += 1;
|
||||
}
|
||||
}
|
||||
let tail = shlex::split(&line[start..])?;
|
||||
let tail = tail.get(usize::from(!token.is_empty())..)?;
|
||||
if token == "--" && !tail.is_empty() {
|
||||
@@ -75,15 +56,34 @@ pub(super) fn target(
|
||||
.iter()
|
||||
.position(|word| word == "--")
|
||||
.unwrap_or(tail.len());
|
||||
positionals += tail.len().saturating_sub(terminator + 1);
|
||||
for word in &tail[..terminator] {
|
||||
if word.starts_with("--") {
|
||||
used.push(word.split_once('=').map_or(word.as_str(), |(name, _)| name));
|
||||
} else if matches!(command, SlashCommand::Title | SlashCommand::Statusline) {
|
||||
positionals += 1;
|
||||
let mut used = Vec::new();
|
||||
let mut pending_value = None;
|
||||
let mut positional = None;
|
||||
// Scan both sides independently: the edited token may itself be a pending value.
|
||||
for (args, pending) in [
|
||||
(words.as_slice(), &mut pending_value),
|
||||
(&tail[..terminator], &mut None),
|
||||
] {
|
||||
for word in args {
|
||||
if pending.take().is_some() && !word.starts_with("--") {
|
||||
continue;
|
||||
}
|
||||
if word == "--" {
|
||||
return None;
|
||||
}
|
||||
if word.starts_with("--") {
|
||||
let (name, inline) = word.split_once('=').unwrap_or((word.as_str(), ""));
|
||||
used.push(name);
|
||||
if settings.values.contains(&name) && inline.is_empty() {
|
||||
*pending = Some(name);
|
||||
}
|
||||
} else {
|
||||
positional.get_or_insert(word);
|
||||
}
|
||||
}
|
||||
}
|
||||
if positionals > 0 && matches!(command, SlashCommand::Title | SlashCommand::Statusline) {
|
||||
let positional = positional.or_else(|| tail.get(terminator + 1));
|
||||
if positional.is_some() && matches!(command, SlashCommand::Title | SlashCommand::Statusline) {
|
||||
used.push("--clear");
|
||||
}
|
||||
|
||||
@@ -93,6 +93,14 @@ pub(super) fn target(
|
||||
if occupied || used.iter().filter(|used| **used == name).count() > own_use {
|
||||
return None;
|
||||
}
|
||||
if command == SlashCommand::Model && name == "--speed" {
|
||||
let model = positional.cloned();
|
||||
let mut values = vec!["standard".to_string()];
|
||||
if let Some(tiers) = model_speeds.get(&model) {
|
||||
values.extend_from_slice(tiers);
|
||||
}
|
||||
return Some((range, values));
|
||||
}
|
||||
let values = slash_command_settings::value_choices(command, name);
|
||||
(!values.is_empty()).then(|| (range, values.iter().copied().map(str::to_owned).collect()))
|
||||
};
|
||||
|
||||
@@ -131,8 +131,8 @@ fn named_settings_complete_names_and_both_value_forms() {
|
||||
),
|
||||
("/statusline model --no-c", "/statusline model --no-colors"),
|
||||
("/model\u{a0}--sp", "/model\u{a0}--speed"),
|
||||
("/model\n--speed=f", "/model\n--speed=flex"),
|
||||
("/model --speed\n f", "/model --speed\n flex"),
|
||||
("/model\n--speed=s", "/model\n--speed=standard"),
|
||||
("/model --speed\n s", "/model --speed\n standard"),
|
||||
("/model\n\u{a0}--sp", "/model\n\u{a0}--speed"),
|
||||
("/mcp login 'a b' --e", "/mcp login 'a b' --environment"),
|
||||
] {
|
||||
@@ -152,13 +152,25 @@ fn named_setting_completion_preserves_tail_and_respects_shell_context() {
|
||||
composer.draft.textarea.text(),
|
||||
"/mcp login --environment=\"foo bar\" srv"
|
||||
);
|
||||
composer
|
||||
.model_speeds
|
||||
.insert(Some("other".into()), vec!["Fast lane".into()]);
|
||||
set_named_draft(
|
||||
&mut composer,
|
||||
"/model --speed=f\u{a0}x",
|
||||
"/model --speed=f\u{a0}x --reasoning high other",
|
||||
"/model --speed=f".len(),
|
||||
);
|
||||
composer.handle_key_event(KeyCode::Tab.into());
|
||||
assert_eq!(composer.draft.textarea.text(), "/model --speed=flex");
|
||||
assert_eq!(
|
||||
shlex::split(composer.draft.textarea.text()).unwrap(),
|
||||
[
|
||||
"/model",
|
||||
"--speed=Fast lane",
|
||||
"--reasoning",
|
||||
"high",
|
||||
"other"
|
||||
]
|
||||
);
|
||||
let cursor = "/model --spe".len();
|
||||
set_named_draft(&mut composer, "/model --spe --reasoning=high", cursor);
|
||||
for (draft, cursor) in [
|
||||
|
||||
@@ -681,8 +681,12 @@ impl BottomPane {
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
pub fn set_service_tier_commands(&mut self, commands: Vec<ServiceTierCommand>) {
|
||||
self.composer.set_service_tier_commands(commands);
|
||||
pub fn set_service_tier_commands(
|
||||
&mut self,
|
||||
commands: Vec<ServiceTierCommand>,
|
||||
speeds: crate::slash_command_settings::ModelSpeeds,
|
||||
) {
|
||||
self.composer.set_service_tier_commands(commands, speeds);
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,24 +89,15 @@ fn resolve_service_tier(
|
||||
if speed == "standard" {
|
||||
return Ok(Some(SERVICE_TIER_DEFAULT_REQUEST_VALUE.to_string()));
|
||||
}
|
||||
if speed == "flex" {
|
||||
return Ok(Some("flex".to_string()));
|
||||
if chat.allows_unadvertised_speed(speed) {
|
||||
return Ok(Some(speed.to_owned()));
|
||||
}
|
||||
let tier = model
|
||||
.service_tiers
|
||||
.iter()
|
||||
.find(|tier| tier.id == speed || tier.name.eq_ignore_ascii_case(speed))
|
||||
.filter(|tier| chat.config.features.service_tier_enabled(&tier.id));
|
||||
let tier = chat
|
||||
.model_speed_tiers(model)
|
||||
.find(|tier| tier.id == speed || tier.name.eq_ignore_ascii_case(speed));
|
||||
tier.map(|tier| Some(tier.id.clone())).ok_or_else(|| {
|
||||
let available = std::iter::once("standard".to_string())
|
||||
.chain(std::iter::once("flex".to_string()))
|
||||
.chain(
|
||||
model
|
||||
.service_tiers
|
||||
.iter()
|
||||
.filter(|tier| chat.config.features.service_tier_enabled(&tier.id))
|
||||
.map(|tier| tier.id.clone()),
|
||||
)
|
||||
.chain(chat.model_speed_tiers(model).map(|tier| tier.id.clone()))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
format!(
|
||||
|
||||
@@ -67,6 +67,7 @@ impl ChatWidget {
|
||||
|
||||
pub(crate) fn clear_account_models(&mut self) {
|
||||
Arc::make_mut(&mut self.model_catalog).clear_models();
|
||||
self.sync_service_tier_commands();
|
||||
}
|
||||
|
||||
pub(super) fn refresh_account_scoped_models(&mut self) {
|
||||
|
||||
@@ -135,11 +135,9 @@ impl ChatWidget {
|
||||
.current_service_tier()
|
||||
.filter(|tier| *tier != SERVICE_TIER_DEFAULT_REQUEST_VALUE)
|
||||
.unwrap_or("standard");
|
||||
if !matches!(speed, "standard" | "flex")
|
||||
&& !model
|
||||
.service_tiers
|
||||
.iter()
|
||||
.any(|tier| tier.id == speed && self.config.features.service_tier_enabled(&tier.id))
|
||||
if speed != "standard"
|
||||
&& !self.allows_unadvertised_speed(speed)
|
||||
&& !self.model_speed_tiers(model).any(|tier| tier.id == speed)
|
||||
{
|
||||
return Err("Choose an available speed with /model before saving.");
|
||||
}
|
||||
|
||||
@@ -6,8 +6,13 @@ use crate::app_event::AppEvent;
|
||||
use crate::app_server_session::ThreadSettingsOwner;
|
||||
use crate::bottom_pane::slash_commands::ServiceTierCommand;
|
||||
use crate::service_tier_resolution;
|
||||
use crate::status::StatusAccountDisplay;
|
||||
use codex_features::Feature;
|
||||
use codex_model_provider_info::OPENAI_PROVIDER_ID;
|
||||
use codex_protocol::config_types::SERVICE_TIER_DEFAULT_REQUEST_VALUE;
|
||||
use codex_protocol::config_types::ServiceTier;
|
||||
use codex_protocol::openai_models::ModelPreset;
|
||||
use codex_protocol::openai_models::ModelServiceTier;
|
||||
use codex_protocol::openai_models::SPEED_TIER_FAST;
|
||||
|
||||
impl ChatWidget {
|
||||
@@ -75,11 +80,42 @@ impl ChatWidget {
|
||||
self.set_service_tier_selection(next_tier);
|
||||
}
|
||||
|
||||
pub(super) fn model_speed_tiers<'a>(
|
||||
&'a self,
|
||||
model: &'a ModelPreset,
|
||||
) -> impl Iterator<Item = &'a ModelServiceTier> {
|
||||
model
|
||||
.service_tiers
|
||||
.iter()
|
||||
.filter(|tier| self.config.features.service_tier_enabled(&tier.id))
|
||||
}
|
||||
|
||||
// The OpenAI API can accept explicit Flex requests even when the bundled
|
||||
// catalog omits Flex. Keep suggestions limited to advertised speeds.
|
||||
pub(super) fn allows_unadvertised_speed(&self, speed: &str) -> bool {
|
||||
speed == ServiceTier::Flex.request_value()
|
||||
&& self.config.model_provider_id == OPENAI_PROVIDER_ID
|
||||
&& self.status_account_display == Some(StatusAccountDisplay::ApiKey)
|
||||
}
|
||||
|
||||
pub(crate) fn sync_service_tier_commands(&mut self) {
|
||||
let commands = self.current_model_service_tier_commands();
|
||||
self.bottom_pane
|
||||
.set_service_tier_commands_enabled(!commands.is_empty());
|
||||
self.bottom_pane.set_service_tier_commands(commands);
|
||||
let mut speeds = crate::slash_command_settings::ModelSpeeds::new();
|
||||
for model in self.model_catalog.models() {
|
||||
let tiers: Vec<_> = self
|
||||
.model_speed_tiers(model)
|
||||
.map(|tier| tier.id.clone())
|
||||
.collect();
|
||||
if model.model == self.selected_model() {
|
||||
speeds.insert(None, tiers.clone());
|
||||
}
|
||||
if model.show_in_picker {
|
||||
speeds.insert(Some(model.model.clone()), tiers);
|
||||
}
|
||||
}
|
||||
self.bottom_pane.set_service_tier_commands(commands, speeds);
|
||||
}
|
||||
|
||||
pub(crate) fn current_model_service_tier_commands(&self) -> Vec<ServiceTierCommand> {
|
||||
@@ -90,26 +126,17 @@ impl ChatWidget {
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| self.selected_model());
|
||||
self.model_catalog
|
||||
.try_list_models()
|
||||
.ok()
|
||||
.and_then(|models| {
|
||||
models
|
||||
.into_iter()
|
||||
.find(|preset| preset.model == model)
|
||||
.map(|preset| {
|
||||
preset
|
||||
.service_tiers
|
||||
.into_iter()
|
||||
.filter(|tier| self.config.features.service_tier_enabled(&tier.id))
|
||||
.map(|tier| ServiceTierCommand {
|
||||
id: tier.id,
|
||||
name: tier.name.to_lowercase(),
|
||||
description: tier.description,
|
||||
})
|
||||
.collect()
|
||||
})
|
||||
.models()
|
||||
.iter()
|
||||
.find(|preset| preset.model == model)
|
||||
.into_iter()
|
||||
.flat_map(|preset| self.model_speed_tiers(preset))
|
||||
.map(|tier| ServiceTierCommand {
|
||||
id: tier.id.clone(),
|
||||
name: tier.name.to_lowercase(),
|
||||
description: tier.description.clone(),
|
||||
})
|
||||
.unwrap_or_default()
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn set_service_tier_selection(&mut self, service_tier: Option<String>) {
|
||||
|
||||
@@ -4,6 +4,35 @@ use super::*;
|
||||
use crate::chatwidget::quick_dials::QuickDialEditorTarget;
|
||||
use codex_config::types::QuickDial;
|
||||
|
||||
#[tokio::test]
|
||||
async fn openai_api_key_can_recall_unadvertised_flex_without_suggesting_it() {
|
||||
let (mut chat, mut events, _ops) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.status_account_display = Some(StatusAccountDisplay::ApiKey);
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.set_service_tier(Some("flex".into()));
|
||||
|
||||
chat.bottom_pane
|
||||
.set_composer_text("/model --speed=f".into(), vec![], vec![]);
|
||||
assert!(chat.bottom_pane.no_modal_or_popup_active());
|
||||
|
||||
let dial = chat.current_model_quick_dial().expect("save Flex preset");
|
||||
chat.local_settings.tui.quick_dials.insert("1".into(), dial);
|
||||
chat.recall_quick_dial(/*slot*/ 1);
|
||||
assert_matches!(
|
||||
std::iter::from_fn(|| events.try_recv().ok())
|
||||
.find(|event| matches!(event, AppEvent::SelectSessionModel { .. })),
|
||||
Some(AppEvent::SelectSessionModel { model, service_tier: Some(tier), .. })
|
||||
if model == "gpt-5.4" && tier == "flex"
|
||||
);
|
||||
|
||||
chat.set_model_provider("alternate");
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.handle_model_command_args("gpt-5.4 --speed=flex");
|
||||
let errors = drain_insert_history(&mut events);
|
||||
assert!(lines_to_single_string(&errors[0]).contains("Speed 'flex' is unavailable"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn current_settings_offer_model_permissions_and_status_layouts() {
|
||||
let (mut chat, mut events, _ops) =
|
||||
@@ -331,7 +360,7 @@ async fn saved_quick_dials_save_and_clear_picker_snapshots() {
|
||||
Err("Choose an available reasoning effort with /model before saving.")
|
||||
);
|
||||
chat.set_reasoning_effort(/*effort*/ None);
|
||||
chat.effective_service_tier = Some("removed-speed".into());
|
||||
chat.effective_service_tier = Some("flex".into());
|
||||
assert_eq!(
|
||||
chat.current_model_quick_dial(),
|
||||
Err("Choose an available speed with /model before saving.")
|
||||
|
||||
@@ -175,6 +175,46 @@ async fn model_settings_only_command_accepts_the_current_hidden_model() {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn model_speed_completion_and_submission_follow_the_target_model() {
|
||||
let (mut chat, mut events, _ops) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
Arc::make_mut(&mut chat.model_catalog).models_mut()[1]
|
||||
.service_tiers
|
||||
.push(codex_protocol::openai_models::ModelServiceTier {
|
||||
id: "flex".into(),
|
||||
name: "Flex".into(),
|
||||
description: String::new(),
|
||||
});
|
||||
chat.set_feature_enabled(Feature::FastMode, /*enabled*/ true);
|
||||
|
||||
chat.bottom_pane
|
||||
.set_composer_text("/model --speed=".into(), vec![], vec![]);
|
||||
let popup = normalize_snapshot_paths(render_bottom_popup(&chat, /*width*/ 60));
|
||||
chat.handle_model_command_args("--speed=flex");
|
||||
let errors = drain_insert_history(&mut events);
|
||||
let error = lines_to_single_string(&errors[0]);
|
||||
insta::assert_snapshot!("model_speed_choices", format!("{popup}\n{error}"));
|
||||
|
||||
chat.bottom_pane
|
||||
.set_composer_text("/model gpt-5.2 --speed=f".into(), vec![], vec![]);
|
||||
chat.handle_key_event(KeyCode::Tab.into());
|
||||
assert_eq!(
|
||||
chat.bottom_pane.composer_text(),
|
||||
"/model gpt-5.2 --speed=flex"
|
||||
);
|
||||
chat.handle_model_command_args("gpt-5.2 --speed=flex");
|
||||
assert_matches!(events.try_recv(), Ok(AppEvent::SelectSessionModel {
|
||||
model, service_tier: Some(tier), ..
|
||||
}) if model == "gpt-5.2" && tier == "flex");
|
||||
|
||||
chat.bottom_pane
|
||||
.set_composer_text("/model gpt-5.2 --speed=f".into(), vec![], vec![]);
|
||||
chat.clear_account_models();
|
||||
assert!(chat.bottom_pane.no_modal_or_popup_active());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn session_model_selection_hides_conflicting_shortcut() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.5")).await;
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/session_model_selection_tests.rs
|
||||
expression: "format!(\"{popup}\\n{error}\")"
|
||||
---
|
||||
› standard
|
||||
priority
|
||||
|
||||
› /model --speed=
|
||||
|
||||
gpt-5.4 default · /tmp/project
|
||||
■ Speed 'flex' is unavailable for gpt-5.4. Available: standard, priority.
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
use crate::slash_command::SlashCommand;
|
||||
|
||||
/// Advertised speed IDs by model argument. None identifies the current model.
|
||||
pub(crate) type ModelSpeeds = std::collections::HashMap<Option<String>, Vec<String>>;
|
||||
|
||||
type Names = &'static [&'static str];
|
||||
|
||||
pub(crate) struct Settings {
|
||||
@@ -30,7 +33,6 @@ pub(crate) fn value_choices(command: SlashCommand, name: &str) -> &'static [&'st
|
||||
match (command, name) {
|
||||
(SlashCommand::Permissions, "--approval-policy") => &["untrusted", "on-request", "never"],
|
||||
(SlashCommand::Permissions, "--reviewer") => &["user", "auto_review"],
|
||||
(SlashCommand::Model, "--speed") => &["standard", "flex"],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user