Avoid spawning external agent process when AI is disabled at startup (#39649)

Closes #39645 

Release Notes:

- Fixed external agent servers sometimes being spawned when Zed started
even when AI was disabled.
This commit is contained in:
Cole Miller
2025-10-07 01:01:17 +00:00
committed by GitHub
parent c1e917165d
commit f6f11eb544
2 changed files with 16 additions and 3 deletions
+10 -2
View File
@@ -48,8 +48,8 @@ use editor::{Anchor, AnchorRangeExt as _, Editor, EditorEvent, MultiBuffer};
use fs::Fs;
use gpui::{
Action, AnyElement, App, AsyncWindowContext, Corner, DismissEvent, Entity, EventEmitter,
ExternalPaths, FocusHandle, Focusable, KeyContext, Pixels, Subscription, Task, UpdateGlobal,
WeakEntity, prelude::*,
ExternalPaths, FocusHandle, Focusable, KeyContext, Pixels, ReadGlobal as _, Subscription, Task,
UpdateGlobal, WeakEntity, prelude::*,
};
use language::LanguageRegistry;
use language_model::{ConfigurationError, LanguageModelRegistry};
@@ -519,6 +519,14 @@ impl AgentPanel {
cx,
)
});
if SettingsStore::global(cx)
.get::<DisableAiSettings>(None)
.disable_ai
{
return panel;
}
panel.as_mut(cx).loading = true;
if let Some(serialized_panel) = serialized_panel {
panel.update(cx, |panel, cx| {