huskies: merge 1188 story Merge tool results return a summary, not the full gate log (35KB per call)

This commit is contained in:
Huskies Agent
2026-07-17 11:58:37 +00:00
parent ea8e6edc94
commit dac0278218
8 changed files with 545 additions and 14 deletions
+8
View File
@@ -103,6 +103,9 @@ pub struct MergeJob {
/// than the current server's boot time. This survives `rebuild_and_restart`
/// (which re-execs and keeps the same PID).
pub server_start_time: f64,
/// Unix timestamp (seconds) when this merge job started, used to compute
/// elapsed time for a still-`Running` job.
pub started_at: f64,
}
/// Result of a mergemaster merge operation.
@@ -113,6 +116,11 @@ pub struct MergeReport {
pub result: MergeResult,
pub worktree_cleaned_up: bool,
pub story_archived: bool,
/// Path (relative to the project root) of the full untruncated report
/// written by `service::merge::io::write_merge_report`, if the write
/// succeeded.
#[serde(default)]
pub report_path: Option<String>,
}
#[cfg(test)]
@@ -217,7 +217,7 @@ impl AgentPool {
// retry_count=1 so maybe_inject_gate_failure injects gate output
// into --append-system-prompt on the fixup spawn.
// transition_to_merge_failure also writes ContentKey::GateOutput.
let display = kind.display_reason();
let display = crate::service::merge::summarize_merge_failure_kind(&kind);
let _ =
crate::agents::lifecycle::transition_to_merge_failure(sid.as_str(), kind);
match crate::agents::lifecycle::move_story_to_stage(&sid, "current") {
@@ -258,7 +258,7 @@ impl AgentPool {
// Transition through the state machine (Merge → MergeFailure).
// Only send the notification when the stage actually changed; if the
// story was already in MergeFailure (self-loop), suppress the duplicate.
let display = kind.display_reason();
let display = crate::service::merge::summarize_merge_failure_kind(&kind);
let should_notify = match crate::agents::lifecycle::transition_to_merge_failure(
sid.as_str(),
kind,
@@ -352,14 +352,26 @@ impl AgentPool {
merge_result,
crate::agents::merge::MergeResult::Success { .. }
) {
let report_path = crate::service::merge::io::write_merge_report(
project_root,
story_id,
merge_result.output(),
);
return Ok(crate::agents::merge::MergeReport {
story_id: story_id.to_string(),
result: merge_result,
worktree_cleaned_up: false,
story_archived: false,
report_path,
});
}
let report_path = crate::service::merge::io::write_merge_report(
project_root,
story_id,
merge_result.output(),
);
let story_archived = crate::agents::lifecycle::move_story_to_done(story_id).is_ok();
// Story 1178: only delete the feature branch once the state transition
@@ -389,6 +401,7 @@ impl AgentPool {
result: merge_result,
worktree_cleaned_up,
story_archived,
report_path,
})
}
}
@@ -29,6 +29,7 @@ impl AgentPool {
},
worktree_cleaned_up: false,
story_archived: false,
report_path: None,
});
(crate::agents::merge::MergeJobStatus::Completed(report), 0.0)
}
@@ -41,6 +42,7 @@ impl AgentPool {
story_id: story_id.to_string(),
status,
server_start_time,
started_at: view.started_at,
})
}
}