eval: Fix stalling on tool confirmation (#28786)

The `always_allow_tool_actions` setting would get overridden with the
default when we loaded each example project, leading to examples
stalling when they run a tool that needed confirmation. There's now a
separate `runner_settings.json` file where we can configure the
environment for the eval.

Release Notes:

- N/A

---------

Co-authored-by: Oleksiy <oleksiy@zed.dev>
This commit is contained in:
Agus Zubiaga 2025-04-15 10:53:45 -06:00 committed by GitHub
parent b1e4e6048a
commit ff4334efc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 36 additions and 13 deletions

View file

@ -1,6 +1,5 @@
mod example;
use assistant_settings::AssistantSettings;
use client::{Client, ProxySettings, UserStore};
pub(crate) use example::*;
@ -10,7 +9,7 @@ use clap::Parser;
use extension::ExtensionHostProxy;
use futures::future;
use gpui::http_client::{Uri, read_proxy_from_env};
use gpui::{App, AppContext, Application, AsyncApp, Entity, SemanticVersion, Task};
use gpui::{App, AppContext, Application, AsyncApp, Entity, SemanticVersion, Task, UpdateGlobal};
use gpui_tokio::Tokio;
use language::LanguageRegistry;
use language_model::{
@ -390,13 +389,10 @@ pub fn init(cx: &mut App) -> Arc<AgentAppState> {
let prompt_builder = PromptBuilder::load(fs.clone(), stdout_is_a_pty, cx);
agent::init(fs.clone(), client.clone(), prompt_builder.clone(), cx);
AssistantSettings::override_global(
AssistantSettings {
always_allow_tool_actions: true,
..AssistantSettings::get_global(cx).clone()
},
cx,
);
SettingsStore::update_global(cx, |store, cx| {
store.set_user_settings(include_str!("../runner_settings.json"), cx)
})
.unwrap();
Arc::new(AgentAppState {
languages,