Cleanup remaining references to max mode (#33509)

Release Notes:

- N/A
This commit is contained in:
Ben Brandt 2025-06-27 10:32:13 +02:00 committed by GitHub
parent fbb5628ec6
commit 6c46e1129d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 16 additions and 16 deletions

View file

@ -1419,7 +1419,7 @@ impl Thread {
}
request.tools = available_tools;
request.mode = if model.supports_max_mode() {
request.mode = if model.supports_burn_mode() {
Some(self.completion_mode.into())
} else {
Some(CompletionMode::Normal.into())

View file

@ -2656,7 +2656,7 @@ impl AgentPanel {
this.continue_conversation(window, cx);
})),
)
.when(model.supports_max_mode(), |this| {
.when(model.supports_burn_mode(), |this| {
this.child(
Button::new("continue-burn-mode", "Continue with Burn Mode")
.style(ButtonStyle::Filled)

View file

@ -4,6 +4,7 @@ mod agent_diff;
mod agent_model_selector;
mod agent_panel;
mod buffer_codegen;
mod burn_mode_tooltip;
mod context_picker;
mod context_server_configuration;
mod context_strip;
@ -11,7 +12,6 @@ mod debug;
mod inline_assistant;
mod inline_prompt_editor;
mod language_model_selector;
mod max_mode_tooltip;
mod message_editor;
mod profile_selector;
mod slash_command;

View file

@ -575,7 +575,7 @@ impl MessageEditor {
fn render_burn_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
let thread = self.thread.read(cx);
let model = thread.configured_model();
if !model?.model.supports_max_mode() {
if !model?.model.supports_burn_mode() {
return None;
}

View file

@ -1,8 +1,8 @@
use crate::{
burn_mode_tooltip::MaxModeTooltip,
language_model_selector::{
LanguageModelSelector, ToggleModelSelector, language_model_selector,
},
max_mode_tooltip::MaxModeTooltip,
};
use agent_settings::{AgentSettings, CompletionMode};
use anyhow::Result;
@ -2075,12 +2075,12 @@ impl TextThreadEditor {
)
}
fn render_max_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
fn render_burn_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
let context = self.context().read(cx);
let active_model = LanguageModelRegistry::read_global(cx)
.default_model()
.map(|default| default.model)?;
if !active_model.supports_max_mode() {
if !active_model.supports_burn_mode() {
return None;
}
@ -2575,7 +2575,7 @@ impl Render for TextThreadEditor {
};
let language_model_selector = self.language_model_selector_menu_handle.clone();
let max_mode_toggle = self.render_max_mode_toggle(cx);
let burn_mode_toggle = self.render_burn_mode_toggle(cx);
v_flex()
.key_context("ContextEditor")
@ -2630,7 +2630,7 @@ impl Render for TextThreadEditor {
h_flex()
.gap_0p5()
.child(self.render_inject_context_menu(cx))
.when_some(max_mode_toggle, |this, element| this.child(element)),
.when_some(burn_mode_toggle, |this, element| this.child(element)),
)
.child(
h_flex()

View file

@ -1,13 +1,13 @@
mod agent_notification;
mod animated_label;
mod burn_mode_tooltip;
mod context_pill;
mod max_mode_tooltip;
mod onboarding_modal;
pub mod preview;
mod upsell;
pub use agent_notification::*;
pub use animated_label::*;
pub use burn_mode_tooltip::*;
pub use context_pill::*;
pub use max_mode_tooltip::*;
pub use onboarding_modal::*;

View file

@ -2346,13 +2346,13 @@ impl AssistantContext {
completion_request.messages.push(request_message);
}
}
let supports_max_mode = if let Some(model) = model {
model.supports_max_mode()
let supports_burn_mode = if let Some(model) = model {
model.supports_burn_mode()
} else {
false
};
if supports_max_mode {
if supports_burn_mode {
completion_request.mode = Some(self.completion_mode.into());
}
completion_request

View file

@ -294,7 +294,7 @@ pub trait LanguageModel: Send + Sync {
fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool;
/// Returns whether this model supports "burn mode";
fn supports_max_mode(&self) -> bool {
fn supports_burn_mode(&self) -> bool {
false
}

View file

@ -695,7 +695,7 @@ impl LanguageModel for CloudLanguageModel {
}
}
fn supports_max_mode(&self) -> bool {
fn supports_burn_mode(&self) -> bool {
self.model.supports_max_mode
}