mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
eval_cli: Initialize themes in eval headless mode (#57139)
Also fix patch generation Release Notes: - N/A
This commit is contained in:
parent
85f410004c
commit
4557ad7ad1
4 changed files with 14 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -5964,6 +5964,8 @@ dependencies = [
|
||||||
"settings",
|
"settings",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
"terminal_view",
|
"terminal_view",
|
||||||
|
"theme",
|
||||||
|
"theme_settings",
|
||||||
"util",
|
"util",
|
||||||
"watch",
|
"watch",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,7 @@ serde_json.workspace = true
|
||||||
settings.workspace = true
|
settings.workspace = true
|
||||||
shellexpand.workspace = true
|
shellexpand.workspace = true
|
||||||
terminal_view.workspace = true
|
terminal_view.workspace = true
|
||||||
|
theme.workspace = true
|
||||||
|
theme_settings.workspace = true
|
||||||
util.workspace = true
|
util.workspace = true
|
||||||
watch.workspace = true
|
watch.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ pub fn init(cx: &mut App) -> Arc<AgentCliAppState> {
|
||||||
|
|
||||||
let settings_store = SettingsStore::new(cx, &settings::default_settings());
|
let settings_store = SettingsStore::new(cx, &settings::default_settings());
|
||||||
cx.set_global(settings_store);
|
cx.set_global(settings_store);
|
||||||
|
theme_settings::init(theme::LoadThemes::JustBase, cx);
|
||||||
|
|
||||||
let user_agent = format!(
|
let user_agent = format!(
|
||||||
"Zed Agent CLI/{} ({}; {})",
|
"Zed Agent CLI/{} ({}; {})",
|
||||||
|
|
|
||||||
|
|
@ -443,16 +443,21 @@ class ZedAgent(BaseInstalledAgent):
|
||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Only generate a patch if the workdir is a git repo
|
# 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.
|
# (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(
|
await self.exec_as_agent(
|
||||||
environment,
|
environment,
|
||||||
command=(
|
command=(
|
||||||
'if [ -d ".git" ]; then '
|
"if git rev-parse --git-dir >/dev/null 2>&1; then "
|
||||||
"git add -A && "
|
"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"; '
|
'echo "Patch size: $(wc -c < /logs/agent/patch.diff) bytes"; '
|
||||||
"else "
|
"else "
|
||||||
|
'echo "Git repo has no valid HEAD, skipping patch generation"; '
|
||||||
|
"fi; "
|
||||||
|
"else "
|
||||||
'echo "No git repo found, skipping patch generation"; '
|
'echo "No git repo found, skipping patch generation"; '
|
||||||
"fi"
|
"fi"
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue