Ensure context servers are spawned in the workspace directory (#35271)

This fixes an issue where we were not setting the context server working
directory at all.

Release Notes:

- Context servers will now be spawned in the currently active project
root.

---------

Co-authored-by: Danilo Leal <danilo@zed.dev>
This commit is contained in:
Finn Evers 2025-07-29 18:03:43 +02:00 committed by GitHub
parent d43f464174
commit 397b5f9301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 97 additions and 29 deletions

View file

@ -47,6 +47,7 @@ impl AgentServer for Codex {
cx: &mut App,
) -> Task<Result<Rc<dyn AgentConnection>>> {
let project = project.clone();
let working_directory = project.read(cx).active_project_directory(cx);
cx.spawn(async move |cx| {
let settings = cx.read_global(|settings: &SettingsStore, _| {
settings.get::<AllAgentServersSettings>(None).codex.clone()
@ -65,6 +66,7 @@ impl AgentServer for Codex {
args: command.args,
env: command.env,
},
working_directory,
)
.into();
ContextServer::start(client.clone(), cx).await?;