agent: Remove feature flag checks (#30055)

This PR removes all of the feature flag checks related to the Agent.

Tried to do this in the least invasive way possible; we can follow up
with a full removal.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-06 21:38:05 -04:00 committed by GitHub
parent 0cdd8bdded
commit 5539d82ea6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 45 additions and 178 deletions

View file

@ -17,9 +17,7 @@ use editor::{
ToDisplayPoint,
},
};
use feature_flags::{
Assistant2FeatureFlag, FeatureFlagAppExt as _, FeatureFlagViewExt as _, ZedProFeatureFlag,
};
use feature_flags::{FeatureFlagAppExt as _, ZedProFeatureFlag};
use fs::Fs;
use futures::{
SinkExt, Stream, StreamExt, TryStreamExt as _,
@ -74,25 +72,19 @@ pub fn init(
cx: &mut App,
) {
cx.set_global(InlineAssistant::new(fs, prompt_builder, telemetry));
cx.observe_new(|_, window, cx| {
let Some(window) = window else {
return;
};
let workspace = cx.entity().clone();
InlineAssistant::update_global(cx, |inline_assistant, cx| {
inline_assistant.register_workspace(&workspace, window, cx)
});
cx.observe_flag::<Assistant2FeatureFlag, _>(window, {
|is_assistant2_enabled, _workspace, _window, cx| {
InlineAssistant::update_global(cx, |inline_assistant, _cx| {
inline_assistant.is_assistant2_enabled = is_assistant2_enabled;
});
}
// Don't register now that the Agent is released.
if false {
cx.observe_new(|_, window, cx| {
let Some(window) = window else {
return;
};
let workspace = cx.entity().clone();
InlineAssistant::update_global(cx, |inline_assistant, cx| {
inline_assistant.register_workspace(&workspace, window, cx)
});
})
.detach();
})
.detach();
}
}
const PROMPT_HISTORY_MAX_LEN: usize = 20;
@ -108,7 +100,6 @@ pub struct InlineAssistant {
prompt_builder: Arc<PromptBuilder>,
telemetry: Arc<Telemetry>,
fs: Arc<dyn Fs>,
is_assistant2_enabled: bool,
}
impl Global for InlineAssistant {}
@ -130,7 +121,6 @@ impl InlineAssistant {
prompt_builder,
telemetry,
fs,
is_assistant2_enabled: false,
}
}
@ -199,7 +189,7 @@ impl InlineAssistant {
window: &mut Window,
cx: &mut App,
) {
let is_assistant2_enabled = self.is_assistant2_enabled;
let is_assistant2_enabled = true;
if let Some(editor) = item.act_as::<Editor>(cx) {
editor.update(cx, |editor, cx| {