fix(hive-mind): hapus penulisan docs/runs ganda dan sambungkan abort_flag ke tool hive_mind manual
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
79e2bfcc9c
commit
a125f5d440
@@ -1105,16 +1105,12 @@ fn run_agent_turn(
|
|||||||
};
|
};
|
||||||
|
|
||||||
match pipeline_result {
|
match pipeline_result {
|
||||||
Ok((consensus, reports)) => {
|
Ok((consensus, _reports)) => {
|
||||||
|
// run_hive_mind already wrote docs/runs/*.md internally
|
||||||
|
// (guaranteed, even on synthesis failure) — nothing to do
|
||||||
|
// here besides feeding the consensus back to the LLM.
|
||||||
tracing::info!("[hive-mind] convergence completed successfully");
|
tracing::info!("[hive-mind] convergence completed successfully");
|
||||||
|
|
||||||
if let Some(workspace_root) = tc.workspace_roots.first() {
|
|
||||||
match crate::app::workflow::docs::write_hive_mind_convergence(workspace_root, user_request, &reports, &consensus) {
|
|
||||||
Ok(path) => tracing::info!("[hive-mind] convergence documented at {}", path.display()),
|
|
||||||
Err(e) => tracing::warn!("[hive-mind] failed to write docs/runs report: {e}"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let pipeline_msg = ChatMessage::system(format!(
|
let pipeline_msg = ChatMessage::system(format!(
|
||||||
"[Hive-Mind Consensus]\n{consensus}",
|
"[Hive-Mind Consensus]\n{consensus}",
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -219,21 +219,18 @@ impl Tool for HiveMind {
|
|||||||
json!({ "cycles": cycles_value })
|
json!({ "cycles": cycles_value })
|
||||||
).map_err(|e| anyhow!("failed to parse cycles: {e}"))?;
|
).map_err(|e| anyhow!("failed to parse cycles: {e}"))?;
|
||||||
|
|
||||||
let (consensus, reports) = crate::app::workflow::hive_mind::run_hive_mind(
|
// run_hive_mind now writes the docs/runs/*.md convergence report
|
||||||
|
// itself (guaranteed, even if synthesis fails) — do not write it
|
||||||
|
// again here.
|
||||||
|
let (consensus, _reports) = crate::app::workflow::hive_mind::run_hive_mind(
|
||||||
request,
|
request,
|
||||||
&plan,
|
&plan,
|
||||||
&ctx.session_dir,
|
&ctx.session_dir,
|
||||||
&ctx.workspaces,
|
&ctx.workspaces,
|
||||||
ctx.turn_events.as_ref(),
|
ctx.turn_events.as_ref(),
|
||||||
None,
|
ctx.abort_flag.as_ref(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if let Some(workspace_root) = ctx.workspaces.first() {
|
|
||||||
if let Err(e) = crate::app::workflow::docs::write_hive_mind_convergence(workspace_root, request, &reports, &consensus) {
|
|
||||||
tracing::warn!("[hive_mind] failed to write docs/runs report: {e}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(consensus)
|
Ok(consensus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user