huskies: merge 543_story_resume_failed_coder_agents_with_resume_instead_of_starting_fresh_sessions

This commit is contained in:
dave
2026-04-12 12:52:46 +00:00
parent c80931c15c
commit 5f01631e6a
16 changed files with 135 additions and 52 deletions
+24 -5
View File
@@ -17,6 +17,7 @@ use super::super::{AgentPool, StoryAgent};
impl AgentPool {
/// Pipeline advancement: after an agent completes, move the story to
/// the next pipeline stage and start the appropriate agent.
#[allow(clippy::too_many_arguments)]
pub(super) async fn run_pipeline_advance(
&self,
story_id: &str,
@@ -25,6 +26,7 @@ impl AgentPool {
project_root: Option<PathBuf>,
worktree_path: Option<PathBuf>,
merge_failure_reported: bool,
previous_session_id: Option<String>,
) {
let project_root = match project_root {
Some(p) => p,
@@ -81,7 +83,7 @@ impl AgentPool {
if let Err(e) = crate::agents::lifecycle::move_story_to_qa(&project_root, story_id) {
slog_error!("[pipeline] Failed to move '{story_id}' to 3_qa/: {e}");
} else if let Err(e) = self
.start_agent(&project_root, story_id, Some("qa"), None)
.start_agent(&project_root, story_id, Some("qa"), None, None)
.await
{
slog_error!("[pipeline] Failed to start qa agent for '{story_id}': {e}");
@@ -118,7 +120,13 @@ impl AgentPool {
completion.gate_output
);
if let Err(e) = self
.start_agent(&project_root, story_id, Some(agent_name), Some(&context))
.start_agent(
&project_root,
story_id,
Some(agent_name),
Some(&context),
previous_session_id,
)
.await
{
slog_error!(
@@ -202,7 +210,7 @@ impl AgentPool {
coverage_output
);
if let Err(e) = self
.start_agent(&project_root, story_id, Some("qa"), Some(&context))
.start_agent(&project_root, story_id, Some("qa"), Some(&context), None)
.await
{
slog_error!("[pipeline] Failed to restart qa for '{story_id}': {e}");
@@ -223,7 +231,7 @@ impl AgentPool {
completion.gate_output
);
if let Err(e) = self
.start_agent(&project_root, story_id, Some("qa"), Some(&context))
.start_agent(&project_root, story_id, Some("qa"), Some(&context), None)
.await
{
slog_error!("[pipeline] Failed to restart qa for '{story_id}': {e}");
@@ -322,6 +330,7 @@ impl AgentPool {
story_id,
Some("mergemaster"),
Some(&context),
None,
)
.await
{
@@ -369,7 +378,7 @@ impl AgentPool {
return;
}
if let Err(e) = self
.start_agent(project_root, story_id, Some("mergemaster"), None)
.start_agent(project_root, story_id, Some("mergemaster"), None, None)
.await
{
slog_error!("[pipeline] Failed to start mergemaster for '{story_id}': {e}");
@@ -392,6 +401,7 @@ pub(super) fn spawn_pipeline_advance(
worktree_path: Option<PathBuf>,
watcher_tx: broadcast::Sender<WatcherEvent>,
merge_failure_reported: bool,
previous_session_id: Option<String>,
) {
let sid = story_id.to_string();
let aname = agent_name.to_string();
@@ -410,6 +420,7 @@ pub(super) fn spawn_pipeline_advance(
project_root,
worktree_path,
merge_failure_reported,
previous_session_id,
)
.await;
});
@@ -524,6 +535,7 @@ mod tests {
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -565,6 +577,7 @@ mod tests {
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -606,6 +619,7 @@ mod tests {
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -639,6 +653,7 @@ mod tests {
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -706,6 +721,7 @@ stage = "qa"
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -777,6 +793,7 @@ stage = "qa"
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -883,6 +900,7 @@ stage = "qa"
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
@@ -950,6 +968,7 @@ stage = "qa"
Some(root.to_path_buf()),
None,
false,
None,
)
.await;