Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ default = [
"ambient_agents_rtc",
"cloud_mode",
"cloud_mode_from_local_session",
"cloud_mode_image_context",
"agent_mode_computer_use",
"background_computer_use",
"oz_platform_skills",
Expand Down Expand Up @@ -976,7 +975,6 @@ classic_completions = []
native_shell_completions = []
cloud_mode = []
cloud_mode_from_local_session = []
cloud_mode_image_context = []
force_classic_completions = []
agent_view_conversation_list_view = ["agent_view"]
inline_history_menu = ["agent_view"]
Expand Down
11 changes: 4 additions & 7 deletions app/src/ai/blocklist/agent_view/agent_input_footer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2183,13 +2183,10 @@ impl AgentInputFooter {
is_conversation_transcript_context: bool,
app: &AppContext,
) -> Option<Box<dyn Element>> {
let is_cloud_mode = FeatureFlag::CloudModeImageContext.is_enabled()
&& self
.ambient_agent_view_model
.as_ref()
.is_some_and(|ambient_agent_model| {
ambient_agent_model.as_ref(app).is_ambient_agent()
});
let is_cloud_mode = self
.ambient_agent_view_model
.as_ref()
.is_some_and(|ambient_agent_model| ambient_agent_model.as_ref(app).is_ambient_agent());
if !item.available_in().is_available_for_agent_view()
|| !item.available_to_session_viewer(shared_status, is_cloud_mode)
{
Expand Down
4 changes: 2 additions & 2 deletions app/src/ai/blocklist/controller/shared_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ impl BlocklistAIController {
}
});

// If there are no file downloads (or the feature is disabled), send the query immediately.
if file_downloads.is_empty() || !FeatureFlag::CloudModeImageContext.is_enabled() {
// If there are no file downloads, send the query immediately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This comment restates the file_downloads.is_empty() branch below; Warp's comment guidance reserves inline comments for non-obvious why. Remove it or replace it with the rationale for sending before the download path.

if file_downloads.is_empty() {
self.send_shared_session_query(
prompt,
conversation_id,
Expand Down
2 changes: 0 additions & 2 deletions app/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ fn enabled_features() -> HashSet<FeatureFlag> {
FeatureFlag::CloudMode,
#[cfg(feature = "cloud_mode_from_local_session")]
FeatureFlag::CloudModeFromLocalSession,
#[cfg(feature = "cloud_mode_image_context")]
FeatureFlag::CloudModeImageContext,
#[cfg(feature = "summarization_via_message_replacement")]
FeatureFlag::SummarizationViaMessageReplacement,
#[cfg(feature = "pluggable_notifications")]
Expand Down
35 changes: 9 additions & 26 deletions app/src/terminal/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4509,11 +4509,6 @@ impl Input {
ctx,
);
} else {
if !pending_attachments.is_empty() {
log::warn!(
"Cannot upload cloud follow-up attachments: CloudModeImageContext is disabled"
);
}
ctx.emit(Event::SubmitCloudFollowup { prompt });
}
} else {
Expand Down Expand Up @@ -4543,7 +4538,7 @@ impl Input {
}

fn should_upload_cloud_followup_attachments(pending_attachments: &[PendingAttachment]) -> bool {
!pending_attachments.is_empty() && FeatureFlag::CloudModeImageContext.is_enabled()
!pending_attachments.is_empty()
}

/// Primary entry point for submitting the input buffer as an AI query. Routes to the correct
Expand Down Expand Up @@ -4840,10 +4835,6 @@ impl Input {
&self,
ctx: &mut ViewContext<Self>,
) -> HandoffLaunchAttachments {
if !FeatureFlag::CloudModeImageContext.is_enabled() {
return HandoffLaunchAttachments::default();
}

let mut request_attachments: Vec<AttachmentInput> = self
.ai_context_model
.as_ref(ctx)
Expand Down Expand Up @@ -11817,12 +11808,9 @@ impl Input {

// Shared session viewers cannot attach images unless in cloud mode
let is_viewer = self.model.lock().shared_session_status().is_viewer();
let is_cloud_mode_with_images = FeatureFlag::CloudModeImageContext.is_enabled()
&& self
.ambient_agent_view_model()
.is_some_and(|ambient_agent_model| {
ambient_agent_model.as_ref(ctx).is_ambient_agent()
});
let is_cloud_mode_with_images = self
.ambient_agent_view_model()
.is_some_and(|ambient_agent_model| ambient_agent_model.as_ref(ctx).is_ambient_agent());
if is_viewer && !is_cloud_mode_with_images {
self.insert_clipboard_text_content(ctx, content);
return;
Expand Down Expand Up @@ -11878,15 +11866,11 @@ impl Input {

/// Check if we can attach on filepaths paste or drag-drop
fn can_attach_on_filepaths_paste_or_dragdrop(&self, ctx: &mut ViewContext<Self>) -> bool {
// Shared session viewers cannot attach images unless in cloud mode
// with the CloudModeImageContext feature enabled.
// Shared session viewers cannot attach images unless in cloud mode.
let is_viewer = self.model.lock().shared_session_status().is_viewer();
let is_cloud_mode_with_images = FeatureFlag::CloudModeImageContext.is_enabled()
&& self
.ambient_agent_view_model()
.is_some_and(|ambient_agent_model| {
ambient_agent_model.as_ref(ctx).is_ambient_agent()
});
let is_cloud_mode_with_images = self
.ambient_agent_view_model()
.is_some_and(|ambient_agent_model| ambient_agent_model.as_ref(ctx).is_ambient_agent());
if is_viewer && !is_cloud_mode_with_images {
return false;
}
Expand Down Expand Up @@ -15178,8 +15162,7 @@ impl Input {
let ambient_agent_task_id = self
.ambient_agent_view_model()
.and_then(|ambient_agent_model| ambient_agent_model.as_ref(ctx).task_id());
let has_uploads = (!images.is_empty() || !files.is_empty())
&& FeatureFlag::CloudModeImageContext.is_enabled();
let has_uploads = !images.is_empty() || !files.is_empty();

if let Some(task_id) = ambient_agent_task_id.filter(|_| has_uploads) {
// Upload files first, then send prompt with file references in callback
Expand Down
12 changes: 2 additions & 10 deletions app/src/terminal/input_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10176,7 +10176,7 @@ fn restore_cloud_followup_input_after_upload_failure_restores_prompt() {
}

#[test]
fn should_upload_cloud_followup_attachments_matches_cloud_mode_image_context_flag() {
fn should_upload_cloud_followup_attachments_reflects_pending_attachments() {
use base64::Engine as _;

let attachment = PendingAttachment::Image(ImageContext {
Expand All @@ -10190,17 +10190,9 @@ fn should_upload_cloud_followup_attachments_matches_cloud_mode_image_context_fla
!Input::should_upload_cloud_followup_attachments(&[]),
"no pending attachments should submit the text-only follow-up immediately"
);

let flag_guard = FeatureFlag::CloudModeImageContext.override_enabled(false);
assert!(
!Input::should_upload_cloud_followup_attachments(std::slice::from_ref(&attachment)),
"follow-up attachments should not upload while CloudModeImageContext is disabled"
);
drop(flag_guard);
let _flag_guard = FeatureFlag::CloudModeImageContext.override_enabled(true);
assert!(
Input::should_upload_cloud_followup_attachments(&[attachment]),
"follow-up attachments should upload when CloudModeImageContext is enabled"
"follow-up attachments should upload when present"
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/terminal/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3035,8 +3035,8 @@ pub(crate) fn file_attach_allowed_for_shared_session(
ambient_agent_view_model: Option<&ModelHandle<ambient_agent::AmbientAgentViewModel>>,
ctx: &AppContext,
) -> bool {
let is_cloud_mode = FeatureFlag::CloudModeImageContext.is_enabled()
&& ambient_agent_view_model.is_some_and(|model| model.as_ref(ctx).is_ambient_agent());
let is_cloud_mode =
ambient_agent_view_model.is_some_and(|model| model.as_ref(ctx).is_ambient_agent());
AgentToolbarItemKind::FileAttach
.available_to_session_viewer(shared_session_status, is_cloud_mode)
}
Expand Down
3 changes: 0 additions & 3 deletions crates/warp_features/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,6 @@ pub enum FeatureFlag {
/// Enables image upload for ambient agents.
AmbientAgentsImageUpload,

/// Enables image attachment support for cloud mode conversations.
CloudModeImageContext,

/// Enables loading and returning bundled skills in the SkillManager.
BundledSkills,

Expand Down
Loading