huskies: merge 967

This commit is contained in:
dave
2026-05-13 12:34:35 +00:00
parent 40ea100eae
commit 93f774fcbb
9 changed files with 165 additions and 0 deletions
@@ -839,6 +839,21 @@ mod tests {
"[[agent]]\nname = \"mergemaster\"\nstage = \"mergemaster\"\n",
)
.unwrap();
// The spawn path calls `git worktree add` — the tempdir must be a real
// git repo with at least one commit or it fails with "not a git repo".
for args in [
&["init"][..],
&["config", "user.email", "test@test.com"],
&["config", "user.name", "Test"],
&["commit", "--allow-empty", "-m", "init"],
] {
std::process::Command::new("git")
.args(args)
.current_dir(&root)
.output()
.unwrap();
}
crate::crdt_state::init_for_test();
crate::db::ensure_content_store();
crate::db::write_item_with_content(
+13
View File
@@ -320,6 +320,13 @@ pub(super) async fn run_agent_spawn(
.and_then(|a| a.runtime.as_deref())
.unwrap_or("claude-code");
// Extract model once so it can be shared across all runtime branches and
// passed to RuntimeContext for eager session recording (bug 967).
let agent_model = config_clone
.find_agent(&aname)
.and_then(|a| a.model.clone())
.unwrap_or_default();
let run_result = match runtime_name {
"claude-code" => {
let runtime =
@@ -335,6 +342,8 @@ pub(super) async fn run_agent_spawn(
app_ctx: app_ctx.clone(),
session_id_to_resume: session_id_to_resume_owned.clone(),
fresh_prompt: fresh_prompt.clone(),
project_root: project_root_clone.clone(),
model: agent_model.clone(),
};
runtime
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)
@@ -353,6 +362,8 @@ pub(super) async fn run_agent_spawn(
app_ctx: app_ctx.clone(),
session_id_to_resume: session_id_to_resume_owned.clone(),
fresh_prompt: fresh_prompt.clone(),
project_root: project_root_clone.clone(),
model: agent_model.clone(),
};
runtime
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)
@@ -371,6 +382,8 @@ pub(super) async fn run_agent_spawn(
app_ctx: app_ctx.clone(),
session_id_to_resume: session_id_to_resume_owned,
fresh_prompt,
project_root: project_root_clone.clone(),
model: agent_model,
};
runtime
.start(ctx, tx_clone.clone(), log_clone.clone(), log_writer_clone)