huskies: merge 819

This commit is contained in:
dave
2026-04-28 20:22:22 +00:00
parent b060d8fc88
commit f5ab75ecaa
8 changed files with 1056 additions and 1 deletions
+25
View File
@@ -102,6 +102,23 @@ pub(super) async fn run_agent_spawn(
}
};
// Step 1.5: Update the source map for changed files since master.
// Non-blocking — failures are logged but do not gate the spawn.
{
let wt_path_for_map = wt_info.path.clone();
let base_for_map = wt_info.base_branch.clone();
let map_path = project_root_clone.join(".huskies").join("source-map.json");
match tokio::task::spawn_blocking(move || {
source_map_gen::update_for_worktree(&wt_path_for_map, &base_for_map, &map_path)
})
.await
.unwrap_or_else(|e| Err(e.to_string()))
{
Ok(()) => {}
Err(e) => slog_error!("[agents] source map update for {sid}: {e}"),
}
}
// Step 2: store worktree info and render agent command/args/prompt.
let wt_path_str = wt_info.path.to_string_lossy().to_string();
{
@@ -151,6 +168,14 @@ pub(super) async fn run_agent_spawn(
prompt.push_str(&local);
}
// Append a reference to the source map if the file was written.
let source_map_path = project_root_clone.join(".huskies").join("source-map.json");
if source_map_path.exists() {
prompt.push_str(
"\n\nA source map of well-documented changed files is at `.huskies/source-map.json`.",
);
}
// Build the effective prompt and determine resume session.
//
// When resuming a previous session, discard the full rendered prompt