eval_cli: Initialize themes in eval headless mode (#57139)

Also fix patch generation

Release Notes:

- N/A
This commit is contained in:
Ben Brandt authored and GitHub committed 2026-05-19 11:29:00 +00:00
1 parent e5e67a8c28
commit a74dc72608
4 files changed
+14 -4

No files matched your search

Generated
+2
View File
@@ -5964,6 +5964,8 @@ dependencies = [
"settings",
"shellexpand",
"terminal_view",
"theme",
"theme_settings",
"util",
"watch",
]
+2
View File
@@ -47,5 +47,7 @@ serde_json.workspace = true
settings.workspace = true
shellexpand.workspace = true
terminal_view.workspace = true
theme.workspace = true
theme_settings.workspace = true
util.workspace = true
watch.workspace = true
+1
View File
@@ -40,6 +40,7 @@ pub fn init(cx: &mut App) -> Arc<AgentCliAppState> {
let settings_store = SettingsStore::new(cx, &settings::default_settings());
cx.set_global(settings_store);
theme_settings::init(theme::LoadThemes::JustBase, cx);
let user_agent = format!(
"Zed Agent CLI/{} ({}; {})",
+9 -4
View File
@@ -443,16 +443,21 @@ class ZedAgent(BaseInstalledAgent):
env=env,
)
# Only generate a patch if the workdir is a git repo
# (SWE-bench style). Terminal-bench containers aren't git repos.
# Only generate a patch if the workdir is a git repo with a valid HEAD
# (SWE-bench style). Terminal-bench containers aren't git repos, and
# some harnesses mount an initialized repo before creating the first commit.
await self.exec_as_agent(
environment,
command=(
'if [ -d ".git" ]; then '
"if git rev-parse --git-dir >/dev/null 2>&1; then "
"git add -A && "
"git diff --cached HEAD > /logs/agent/patch.diff && "
"if git rev-parse --verify HEAD >/dev/null 2>&1; then "
"git diff --cached HEAD -- > /logs/agent/patch.diff && "
'echo "Patch size: $(wc -c < /logs/agent/patch.diff) bytes"; '
"else "
'echo "Git repo has no valid HEAD, skipping patch generation"; '
"fi; "
"else "
'echo "No git repo found, skipping patch generation"; '
"fi"
),