diff --git a/app/src/ai/blocklist/block.rs b/app/src/ai/blocklist/block.rs index 4792a64709..7ab7b66508 100644 --- a/app/src/ai/blocklist/block.rs +++ b/app/src/ai/blocklist/block.rs @@ -171,6 +171,7 @@ use crate::server::telemetry::{ use crate::settings::{ AISettings, AISettingsChangedEvent, AgentModeCodingPermissionsType, FontSettings, InputModeSettings, InputModeSettingsChangedEvent, InputSettings, + OrchestrationMessageDisplayMode, }; use crate::settings_view::SettingsSection; use crate::terminal::find::TerminalFindModel; @@ -783,7 +784,7 @@ impl CollapsibleElementState { } fn finish_reasoning(&mut self, app: &AppContext) { - let should_auto_collapse = self.should_auto_collapse_reasoning_on_finish(); + let should_auto_collapse = self.should_auto_collapse_on_finish(); let thinking_mode = AISettings::as_ref(app).thinking_display_mode; self.sync_finished_state(true); @@ -815,6 +816,23 @@ impl CollapsibleElementState { } } + /// Applies orchestration message display behavior after streaming finishes. + fn finish_orchestration_message(&mut self, display_mode: OrchestrationMessageDisplayMode) { + let should_auto_collapse = self.should_auto_collapse_on_finish(); + + self.sync_finished_state(true); + + if display_mode.should_collapse_agent_message_body_on_finish() && should_auto_collapse { + self.expansion_state = CollapsibleExpansionState::Collapsed; + } else if let CollapsibleExpansionState::Expanded { + scroll_pinned_to_bottom, + .. + } = &mut self.expansion_state + { + *scroll_pinned_to_bottom = false; + } + } + fn toggle_expansion(&mut self) { if !self.last_known_is_finished { self.user_toggled_while_streaming = true; @@ -830,7 +848,7 @@ impl CollapsibleElementState { } } - fn should_auto_collapse_reasoning_on_finish(&self) -> bool { + fn should_auto_collapse_on_finish(&self) -> bool { !self.user_toggled_while_streaming && matches!( self.expansion_state, @@ -852,14 +870,33 @@ pub(crate) fn received_message_collapsible_id(message_id: &str) -> MessageId { fn default_collapsible_state_for_orchestration_action( action: &AIAgentActionType, + display_mode: OrchestrationMessageDisplayMode, ) -> Option { match action { AIAgentActionType::StartAgent { .. } => Some(CollapsibleElementState::default()), - AIAgentActionType::SendMessageToAgent { .. } => Some(CollapsibleElementState::collapsed()), + AIAgentActionType::SendMessageToAgent { .. } => { + Some(default_orchestration_collapsible_state( + display_mode.should_expand_agent_message_body(), + )) + } _ => None, } } +fn default_collapsible_state_for_orchestration_message( + display_mode: OrchestrationMessageDisplayMode, +) -> CollapsibleElementState { + default_orchestration_collapsible_state(display_mode.should_expand_agent_message_body()) +} + +fn default_orchestration_collapsible_state(expanded: bool) -> CollapsibleElementState { + if expanded { + CollapsibleElementState::default() + } else { + CollapsibleElementState::collapsed() + } +} + pub struct AIBlock { model: Rc>, terminal_model: Arc>, @@ -1133,6 +1170,10 @@ impl AIBlock { } ctx.notify(); } + AISettingsChangedEvent::ThinkingDisplayMode { .. } + | AISettingsChangedEvent::OrchestrationMessageDisplayMode { .. } => { + ctx.notify(); + } _ => {} }, ); @@ -2148,10 +2189,14 @@ impl AIBlock { } // Register collapsible state for orchestration action messages. + let orchestration_message_display_mode = + AISettings::as_ref(ctx).orchestration_message_display_mode; match &message.message { AIAgentOutputMessageType::Action(AIAgentAction { action, .. }) => { - if let Some(state) = default_collapsible_state_for_orchestration_action(action) - { + if let Some(state) = default_collapsible_state_for_orchestration_action( + action, + orchestration_message_display_mode, + ) { self.collapsible_block_states .entry(message.id.clone()) .or_insert(state); @@ -2163,7 +2208,11 @@ impl AIBlock { received_message_collapsible_id(&received_message.message_id); self.collapsible_block_states .entry(collapsible_id.clone()) - .or_insert_with(CollapsibleElementState::collapsed); + .or_insert_with(|| { + default_collapsible_state_for_orchestration_message( + orchestration_message_display_mode, + ) + }); self.state_handles .transcript_avatar_handles .entry(collapsible_id) @@ -2340,7 +2389,59 @@ impl AIBlock { self.keyboard_navigable_buttons = Some(menu); } + /// Applies final display behavior to orchestration message bodies. + fn finish_orchestration_message_collapsible_states( + &mut self, + output: &AIAgentOutput, + ctx: &mut ViewContext, + ) { + let display_mode = AISettings::as_ref(ctx).orchestration_message_display_mode; + for message in &output.messages { + match &message.message { + AIAgentOutputMessageType::Action(AIAgentAction { + action: AIAgentActionType::SendMessageToAgent { .. }, + .. + }) => { + self.collapsible_block_states + .entry(message.id.clone()) + .or_insert_with(|| { + default_orchestration_collapsible_state( + display_mode.should_expand_agent_message_body(), + ) + }) + .finish_orchestration_message(display_mode); + } + AIAgentOutputMessageType::MessagesReceivedFromAgents { messages } => { + for received_message in messages { + let collapsible_id = + received_message_collapsible_id(&received_message.message_id); + self.collapsible_block_states + .entry(collapsible_id) + .or_insert_with(|| { + default_collapsible_state_for_orchestration_message(display_mode) + }) + .finish_orchestration_message(display_mode); + } + } + AIAgentOutputMessageType::Text(_) + | AIAgentOutputMessageType::Reasoning { .. } + | AIAgentOutputMessageType::Summarization { .. } + | AIAgentOutputMessageType::Subagent(_) + | AIAgentOutputMessageType::Action(_) + | AIAgentOutputMessageType::TodoOperation(_) + | AIAgentOutputMessageType::WebSearch(_) + | AIAgentOutputMessageType::WebFetch(_) + | AIAgentOutputMessageType::CommentsAddressed { .. } + | AIAgentOutputMessageType::DebugOutput { .. } + | AIAgentOutputMessageType::ArtifactCreated(_) + | AIAgentOutputMessageType::SkillInvoked(_) + | AIAgentOutputMessageType::EventsFromAgents { .. } => {} + } + } + } + fn handle_complete_output(&mut self, output: &AIAgentOutput, ctx: &mut ViewContext) { + self.finish_orchestration_message_collapsible_states(output, ctx); let mut suggestions = BlocklistAIHistoryModel::as_ref(ctx) .existing_suggestions_for_conversation(self.client_ids.conversation_id) .cloned() diff --git a/app/src/ai/blocklist/block_tests.rs b/app/src/ai/blocklist/block_tests.rs index 7227c00b74..ac82212109 100644 --- a/app/src/ai/blocklist/block_tests.rs +++ b/app/src/ai/blocklist/block_tests.rs @@ -8,7 +8,8 @@ use warp_util::local_or_remote_path::LocalOrRemotePath; use warpui::{App, SingletonEntity}; use super::{ - default_collapsible_state_for_orchestration_action, received_message_collapsible_id, + default_collapsible_state_for_orchestration_action, + default_collapsible_state_for_orchestration_message, received_message_collapsible_id, user_avatar_info_for_conversation_creator, CollapsibleElementState, CollapsibleExpansionState, UserAvatarInfo, }; @@ -17,7 +18,7 @@ use crate::ai::blocklist::action_model::{ compose_run_agents_child_prompt, run_agents_to_start_agent_mode, }; use crate::auth::UserUid; -use crate::settings::AISettings; +use crate::settings::{AISettings, OrchestrationMessageDisplayMode}; use crate::test_util::settings::initialize_settings_for_tests; use crate::workspaces::user_profiles::{UserProfileWithUID, UserProfiles}; @@ -47,6 +48,37 @@ fn collapsed_initializer_starts_collapsed() { )); } +#[test] +fn orchestration_show_and_collapse_collapses_after_finish() { + let mut state = default_collapsible_state_for_orchestration_message( + OrchestrationMessageDisplayMode::ShowAndCollapse, + ); + + state.finish_orchestration_message(OrchestrationMessageDisplayMode::ShowAndCollapse); + + assert!(matches!( + state.expansion_state, + CollapsibleExpansionState::Collapsed + )); +} + +#[test] +fn orchestration_always_show_stays_expanded_after_finish() { + let mut state = default_collapsible_state_for_orchestration_message( + OrchestrationMessageDisplayMode::AlwaysShow, + ); + + state.finish_orchestration_message(OrchestrationMessageDisplayMode::AlwaysShow); + + assert!(matches!( + state.expansion_state, + CollapsibleExpansionState::Expanded { + is_finished: true, + scroll_pinned_to_bottom: false + } + )); +} + #[test] fn orchestration_send_message_starts_collapsed() { let state = default_collapsible_state_for_orchestration_action( @@ -55,6 +87,7 @@ fn orchestration_send_message_starts_collapsed() { subject: "Status".to_string(), message: "Body".to_string(), }, + OrchestrationMessageDisplayMode::AlwaysCollapse, ) .expect("send-message actions should get a collapsible state"); @@ -65,17 +98,55 @@ fn orchestration_send_message_starts_collapsed() { } #[test] -fn orchestration_start_agent_keeps_expanded_default() { - let state = - default_collapsible_state_for_orchestration_action(&AIAgentActionType::StartAgent { - version: StartAgentVersion::V1, - name: "child-agent".to_string(), - prompt: "Investigate".to_string(), - execution_mode: StartAgentExecutionMode::local_harness("claude-code".to_string()), - lifecycle_subscription: None, - }) +fn orchestration_start_agent_prompt_stays_expanded_for_all_message_modes() { + for display_mode in [ + OrchestrationMessageDisplayMode::ShowAndCollapse, + OrchestrationMessageDisplayMode::AlwaysCollapse, + OrchestrationMessageDisplayMode::AlwaysShow, + ] { + let state = default_collapsible_state_for_orchestration_action( + &AIAgentActionType::StartAgent { + version: StartAgentVersion::V1, + name: "child-agent".to_string(), + prompt: "Investigate".to_string(), + execution_mode: StartAgentExecutionMode::local_harness("claude-code".to_string()), + lifecycle_subscription: None, + }, + display_mode, + ) .expect("start-agent actions should get a collapsible state"); + assert!(matches!( + state.expansion_state, + CollapsibleExpansionState::Expanded { + is_finished: false, + scroll_pinned_to_bottom: true + } + )); + } +} + +#[test] +fn non_orchestration_actions_do_not_get_collapsible_state_defaults() { + assert!(default_collapsible_state_for_orchestration_action( + &AIAgentActionType::OpenCodeReview, + OrchestrationMessageDisplayMode::AlwaysCollapse, + ) + .is_none()); +} + +#[test] +fn orchestration_show_and_collapse_starts_sent_messages_expanded() { + let state = default_collapsible_state_for_orchestration_action( + &AIAgentActionType::SendMessageToAgent { + addresses: vec!["child-agent".to_string()], + subject: "Status".to_string(), + message: "Body".to_string(), + }, + OrchestrationMessageDisplayMode::ShowAndCollapse, + ) + .expect("send-message actions should get a collapsible state"); + assert!(matches!( state.expansion_state, CollapsibleExpansionState::Expanded { @@ -86,11 +157,56 @@ fn orchestration_start_agent_keeps_expanded_default() { } #[test] -fn non_orchestration_actions_do_not_get_collapsible_state_defaults() { - assert!( - default_collapsible_state_for_orchestration_action(&AIAgentActionType::OpenCodeReview) - .is_none() +fn orchestration_always_show_starts_sent_messages_expanded() { + let state = default_collapsible_state_for_orchestration_action( + &AIAgentActionType::SendMessageToAgent { + addresses: vec!["child-agent".to_string()], + subject: "Status".to_string(), + message: "Body".to_string(), + }, + OrchestrationMessageDisplayMode::AlwaysShow, + ) + .expect("send-message actions should get a collapsible state"); + + assert!(matches!( + state.expansion_state, + CollapsibleExpansionState::Expanded { + is_finished: false, + scroll_pinned_to_bottom: true + } + )); +} + +#[test] +fn orchestration_received_messages_follow_initial_message_display_mode() { + let show_and_collapse = default_collapsible_state_for_orchestration_message( + OrchestrationMessageDisplayMode::ShowAndCollapse, + ); + assert!(matches!( + show_and_collapse.expansion_state, + CollapsibleExpansionState::Expanded { + is_finished: false, + scroll_pinned_to_bottom: true + } + )); + let collapsed = default_collapsible_state_for_orchestration_message( + OrchestrationMessageDisplayMode::AlwaysCollapse, + ); + assert!(matches!( + collapsed.expansion_state, + CollapsibleExpansionState::Collapsed + )); + let expanded = default_collapsible_state_for_orchestration_message( + OrchestrationMessageDisplayMode::AlwaysShow, ); + + assert!(matches!( + expanded.expansion_state, + CollapsibleExpansionState::Expanded { + is_finished: false, + scroll_pinned_to_bottom: true + } + )); } #[test] diff --git a/app/src/settings/ai.rs b/app/src/settings/ai.rs index b6c0383d73..67c9f4a752 100644 --- a/app/src/settings/ai.rs +++ b/app/src/settings/ai.rs @@ -395,6 +395,82 @@ impl ThinkingDisplayMode { } } +/// Controls how child-agent message bodies are displayed. +#[derive( + Default, + Debug, + serde::Serialize, + serde::Deserialize, + PartialEq, + Copy, + Clone, + EnumIter, + schemars::JsonSchema, + settings_value::SettingsValue, +)] +#[schemars( + description = "Controls how child-agent messages are displayed.", + rename_all = "snake_case" +)] +pub enum OrchestrationMessageDisplayMode { + /// Show child-agent messages while streaming, then collapse them. + ShowAndCollapse, + /// Keep child-agent message bodies expanded. + AlwaysShow, + /// Keep child-agent message bodies collapsed. + #[default] + AlwaysCollapse, +} + +settings::macros::implement_setting_for_enum!( + OrchestrationMessageDisplayMode, + AISettings, + SupportedPlatforms::ALL, + SyncToCloud::Globally(RespectUserSyncSetting::Yes), + private: false, + toml_path: "agents.warp_agent.other.orchestration_message_display_mode", + description: "Controls how child-agent messages are displayed.", +); + +impl OrchestrationMessageDisplayMode { + /// Display name for the settings dropdown. + pub fn display_name(&self) -> &'static str { + match self { + OrchestrationMessageDisplayMode::ShowAndCollapse => "Show & collapse", + OrchestrationMessageDisplayMode::AlwaysShow => "Always show", + OrchestrationMessageDisplayMode::AlwaysCollapse => "Always collapse", + } + } + + pub fn command_palette_description(&self) -> &'static str { + match self { + OrchestrationMessageDisplayMode::ShowAndCollapse => { + "Set child-agent message display: show & collapse" + } + OrchestrationMessageDisplayMode::AlwaysShow => { + "Set child-agent message display: always show" + } + OrchestrationMessageDisplayMode::AlwaysCollapse => { + "Set child-agent message display: always collapse" + } + } + } + + /// Whether child-agent message bodies should expand while streaming. + pub fn should_expand_agent_message_body(&self) -> bool { + matches!( + self, + OrchestrationMessageDisplayMode::ShowAndCollapse + | OrchestrationMessageDisplayMode::AlwaysShow + ) + } + + /// Whether child-agent message bodies should collapse after streaming. + pub fn should_collapse_agent_message_body_on_finish(&self) -> bool { + matches!(self, OrchestrationMessageDisplayMode::ShowAndCollapse) + } +} + /// Controls what happens when a user submits a new prompt while the agent is /// still responding to an earlier prompt. /// @@ -1322,6 +1398,9 @@ define_settings_group!(AISettings, settings: [ // Controls how agent thinking/reasoning traces are displayed. thinking_display_mode: ThinkingDisplayMode, + // Controls how orchestration message bodies are expanded by default. + orchestration_message_display_mode: OrchestrationMessageDisplayMode, + // Default behavior when the user submits a new prompt while the agent is still // responding. Per-conversation overrides live on `QueuedQueryModel`; this // setting is the fallback used when a conversation has no explicit override. diff --git a/app/src/settings_view/ai_page.rs b/app/src/settings_view/ai_page.rs index 4822171d96..4515088a8f 100644 --- a/app/src/settings_view/ai_page.rs +++ b/app/src/settings_view/ai_page.rs @@ -82,11 +82,11 @@ use crate::settings::{ AwsBedrockCredentialsEnabled, CanUseWarpCreditsForFallback, CodeSettings, CodebaseContextEnabled, FileBasedMcpEnabled, GitOperationsAutogenEnabled, IncludeAgentCommandsInHistory, InputSettings, IntelligentAutosuggestionsEnabled, MemoryEnabled, - NLDInTerminalEnabled, NaturalLanguageAutosuggestionsEnabled, PromptSubmissionMode, - RuleSuggestionsEnabled, SharedBlockTitleGenerationEnabled, ShouldRenderCLIAgentToolbar, - ShouldRenderUseAgentToolbarForUserCommands, ShouldShowOzUpdatesInZeroState, ShowAgentTips, - ShowConversationHistory, ShowHintText, ThinkingDisplayMode, VoiceInputEnabled, - WarpDriveContextEnabled, + NLDInTerminalEnabled, NaturalLanguageAutosuggestionsEnabled, OrchestrationMessageDisplayMode, + PromptSubmissionMode, RuleSuggestionsEnabled, SharedBlockTitleGenerationEnabled, + ShouldRenderCLIAgentToolbar, ShouldRenderUseAgentToolbarForUserCommands, + ShouldShowOzUpdatesInZeroState, ShowAgentTips, ShowConversationHistory, ShowHintText, + ThinkingDisplayMode, VoiceInputEnabled, WarpDriveContextEnabled, }; use crate::terminal::session_settings::{SessionSettings, SessionSettingsChangedEvent}; use crate::terminal::CLIAgent; @@ -335,6 +335,35 @@ pub fn init_actions_from_parent_view( .collect(); app.register_fixed_bindings(mode_bindings); } + { + use warpui::keymap::FixedBinding; + + let ai_context = context.clone() & id!(flags::IS_ANY_AI_ENABLED); + let mode_bindings: Vec = OrchestrationMessageDisplayMode::iter() + .map(|mode| { + let context_flag = match mode { + OrchestrationMessageDisplayMode::ShowAndCollapse => { + flags::ORCHESTRATION_MESSAGE_DISPLAY_SHOW_AND_COLLAPSE + } + OrchestrationMessageDisplayMode::AlwaysShow => { + flags::ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_SHOW + } + OrchestrationMessageDisplayMode::AlwaysCollapse => { + flags::ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_COLLAPSE + } + }; + FixedBinding::empty( + mode.command_palette_description(), + builder(SettingsAction::AI( + AISettingsPageAction::SetOrchestrationMessageDisplayMode(mode), + )), + ai_context.clone() & !id!(context_flag), + ) + .with_group(bindings::BindingGroup::WarpAi.as_str()) + }) + .collect(); + app.register_fixed_bindings(mode_bindings); + } if FeatureFlag::QueueSlashCommand.is_enabled() { use warpui::keymap::FixedBinding; @@ -641,6 +670,7 @@ pub struct AISettingsPageView { dragged_context_window_value: Option, thinking_display_mode_dropdown: ViewHandle>, + orchestration_message_display_mode_dropdown: ViewHandle>, default_prompt_submission_mode_dropdown: ViewHandle>, #[cfg(feature = "local_fs")] conversation_layout_dropdown: ViewHandle>, @@ -786,6 +816,17 @@ impl AISettingsPageView { ); }); } + let orchestration_message_display_mode_dropdown = + OtherAIWidget::create_orchestration_message_display_mode_dropdown(ctx); + { + let current_mode = AISettings::as_ref(ctx).orchestration_message_display_mode; + orchestration_message_display_mode_dropdown.update(ctx, |dropdown, ctx| { + dropdown.set_selected_by_action( + AISettingsPageAction::SetOrchestrationMessageDisplayMode(current_mode), + ctx, + ); + }); + } let default_prompt_submission_mode_dropdown = OtherAIWidget::create_default_prompt_submission_mode_dropdown(ctx); @@ -1202,6 +1243,18 @@ impl AISettingsPageView { ); }); } + AISettingsChangedEvent::OrchestrationMessageDisplayMode { .. } => { + let current_mode = AISettings::as_ref(ctx).orchestration_message_display_mode; + me.orchestration_message_display_mode_dropdown + .update(ctx, |dropdown, ctx| { + dropdown.set_selected_by_action( + AISettingsPageAction::SetOrchestrationMessageDisplayMode( + current_mode, + ), + ctx, + ); + }); + } AISettingsChangedEvent::PromptSubmissionMode { .. } => { let current_mode = AISettings::as_ref(ctx).default_prompt_submission_mode; me.default_prompt_submission_mode_dropdown @@ -1734,6 +1787,7 @@ impl AISettingsPageView { mcp_denylist_dropdown, mcp_denylist_mouse_state_handles, thinking_display_mode_dropdown, + orchestration_message_display_mode_dropdown, default_prompt_submission_mode_dropdown, #[cfg(feature = "local_fs")] conversation_layout_dropdown, @@ -2836,6 +2890,7 @@ pub enum AISettingsPageAction { ToggleShowAgentTips, ToggleShowOzUpdatesInZeroState, SetThinkingDisplayMode(ThinkingDisplayMode), + SetOrchestrationMessageDisplayMode(OrchestrationMessageDisplayMode), SetPromptSubmissionMode(PromptSubmissionMode), AttemptLoginGatedUpgrade, RemoveCLIAgentToolbarEnabledCommand(String), @@ -3295,6 +3350,14 @@ impl TypedActionView for AISettingsPageView { }); ctx.notify(); } + AISettingsPageAction::SetOrchestrationMessageDisplayMode(mode) => { + AISettings::handle(ctx).update(ctx, |settings, ctx| { + report_if_error!(settings + .orchestration_message_display_mode + .set_value(*mode, ctx)); + }); + ctx.notify(); + } AISettingsPageAction::SetPromptSubmissionMode(mode) => { AISettings::handle(ctx).update(ctx, |settings, ctx| { report_if_error!(settings @@ -6367,13 +6430,36 @@ impl OtherAIWidget { dropdown }) } + + fn create_orchestration_message_display_mode_dropdown( + ctx: &mut ViewContext, + ) -> ViewHandle> { + let items: Vec> = + OrchestrationMessageDisplayMode::iter() + .map(|mode| { + DropdownItem::new( + mode.display_name(), + AISettingsPageAction::SetOrchestrationMessageDisplayMode(mode), + ) + }) + .collect(); + + ctx.add_typed_action_view(|ctx| { + let mut dropdown = Dropdown::new(ctx); + dropdown.set_top_bar_max_width(AI_SETTINGS_DROPDOWN_WIDTH); + dropdown.set_menu_width(AI_SETTINGS_DROPDOWN_WIDTH, ctx); + dropdown.set_menu_max_height(AI_SETTINGS_DROPDOWN_MAX_HEIGHT, ctx); + dropdown.add_items(items, ctx); + dropdown + }) + } } impl SettingsWidget for OtherAIWidget { type View = AISettingsPageView; fn search_terms(&self) -> &str { - "other oz updates zero state empty changelog new conversation agent what's new use agent footer toolbar layout chip chips rearrange re-arrange thinking expanded reasoning collapse never show hide conversation history" + "other oz updates zero state empty changelog new conversation agent what's new use agent footer toolbar layout chip chips rearrange re-arrange thinking expanded reasoning collapse never show orchestration messages child agents collapse expand hide conversation history" } fn render( @@ -6459,6 +6545,21 @@ impl SettingsWidget for OtherAIWidget { &view.thinking_display_mode_dropdown, )); + column.add_child(render_dropdown_item( + appearance, + "Orchestration message display", + Some("Controls whether orchestration messages stay expanded."), + None, + LocalOnlyIconState::for_setting( + OrchestrationMessageDisplayMode::storage_key(), + OrchestrationMessageDisplayMode::sync_to_cloud(), + &mut view.local_only_icon_tooltip_states.borrow_mut(), + app, + ), + (!is_any_ai_enabled).then(|| appearance.theme().disabled_ui_text_color()), + &view.orchestration_message_display_mode_dropdown, + )); + // TODO: OpenConversationLayoutPreference should not depend on local_fs, but it lives under the external editor settings // which does require local_fs. It was a mistake to put it there, but now we keep it there for backward compatibility. #[cfg(feature = "local_fs")] diff --git a/app/src/settings_view/mod.rs b/app/src/settings_view/mod.rs index f3d7fec065..6c0978a8f7 100644 --- a/app/src/settings_view/mod.rs +++ b/app/src/settings_view/mod.rs @@ -507,6 +507,12 @@ pub mod flags { pub const THINKING_DISPLAY_SHOW_AND_COLLAPSE: &str = "Thinking_Display_ShowAndCollapse"; pub const THINKING_DISPLAY_ALWAYS_SHOW: &str = "Thinking_Display_AlwaysShow"; pub const THINKING_DISPLAY_NEVER_SHOW: &str = "Thinking_Display_NeverShow"; + pub const ORCHESTRATION_MESSAGE_DISPLAY_SHOW_AND_COLLAPSE: &str = + "Orchestration_Message_Display_ShowAndCollapse"; + pub const ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_SHOW: &str = + "Orchestration_Message_Display_AlwaysShow"; + pub const ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_COLLAPSE: &str = + "Orchestration_Message_Display_AlwaysCollapse"; pub const PROMPT_SUBMISSION_INTERRUPT: &str = "Prompt_Submission_Interrupt"; pub const PROMPT_SUBMISSION_QUEUE: &str = "Prompt_Submission_Queue"; pub const SHOW_TERMINAL_INPUT_MESSAGE_LINE_FLAG: &str = "Show_Terminal_Input_Message_Line"; diff --git a/app/src/workspace/view.rs b/app/src/workspace/view.rs index 59c9def458..48ee7642e0 100644 --- a/app/src/workspace/view.rs +++ b/app/src/workspace/view.rs @@ -21844,6 +21844,24 @@ impl Workspace { } } + match ai_settings.orchestration_message_display_mode { + crate::settings::OrchestrationMessageDisplayMode::ShowAndCollapse => { + context + .set + .insert(flags::ORCHESTRATION_MESSAGE_DISPLAY_SHOW_AND_COLLAPSE); + } + crate::settings::OrchestrationMessageDisplayMode::AlwaysShow => { + context + .set + .insert(flags::ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_SHOW); + } + crate::settings::OrchestrationMessageDisplayMode::AlwaysCollapse => { + context + .set + .insert(flags::ORCHESTRATION_MESSAGE_DISPLAY_ALWAYS_COLLAPSE); + } + } + match ai_settings.default_prompt_submission_mode { crate::settings::PromptSubmissionMode::Interrupt => { context.set.insert(flags::PROMPT_SUBMISSION_INTERRUPT);