huskies: merge 819
This commit is contained in:
@@ -41,6 +41,7 @@ libsqlite3-sys = { version = "0.35.0", features = ["bundled"] }
|
||||
sqlx = { workspace = true }
|
||||
wait-timeout = "0.2.1"
|
||||
bft-json-crdt = { path = "../crates/bft-json-crdt", default-features = false, features = ["bft"] }
|
||||
source-map-gen = { path = "../crates/source-map-gen" }
|
||||
ed25519-dalek = { version = "2", features = ["rand_core"] }
|
||||
fastcrypto = "0.1.8"
|
||||
rand = "0.8"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user