huskies: merge 543_story_resume_failed_coder_agents_with_resume_instead_of_starting_fresh_sessions
This commit is contained in:
@@ -83,6 +83,7 @@ impl AgentPool {
|
||||
project_root_for_advance,
|
||||
wt_path_for_advance,
|
||||
merge_failure_reported_for_advance,
|
||||
session_id_for_advance,
|
||||
) = {
|
||||
let mut agents = self.agents.lock().map_err(|e| e.to_string())?;
|
||||
let agent = agents.get_mut(&key).ok_or_else(|| {
|
||||
@@ -94,8 +95,9 @@ impl AgentPool {
|
||||
let pr = agent.project_root.clone();
|
||||
let wt = agent.worktree_info.as_ref().map(|w| w.path.clone());
|
||||
let mfr = agent.merge_failure_reported;
|
||||
let sid_advance = agent.session_id.clone();
|
||||
agents.remove(&key);
|
||||
(tx, sid, pr, wt, mfr)
|
||||
(tx, sid, pr, wt, mfr, sid_advance)
|
||||
};
|
||||
|
||||
// Emit Done so wait_for_agent unblocks.
|
||||
@@ -128,6 +130,7 @@ impl AgentPool {
|
||||
project_root_for_advance,
|
||||
wt_path_for_advance,
|
||||
merge_failure_reported_for_advance,
|
||||
session_id_for_advance,
|
||||
)
|
||||
.await;
|
||||
});
|
||||
@@ -277,6 +280,8 @@ pub(in crate::agents::pool) async fn run_server_owned_completion(
|
||||
lock.remove(&key);
|
||||
(tx, pr, wt, mfr)
|
||||
};
|
||||
// The completed session's ID is used to resume if gates fail.
|
||||
let previous_session_id = session_id.clone();
|
||||
|
||||
// Emit Done so wait_for_agent unblocks.
|
||||
let _ = tx.send(AgentEvent::Done {
|
||||
@@ -299,6 +304,7 @@ pub(in crate::agents::pool) async fn run_server_owned_completion(
|
||||
wt_path_for_advance,
|
||||
watcher_tx,
|
||||
merge_failure_reported_for_advance,
|
||||
previous_session_id,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user