feat: show plan diff in execution log when revise_plan is called

- apply_plan_diff now returns a YAML unified diff string
- Pure Rust LCS diff implementation (no external dependency)
- revise_plan logs the diff to execution log with ```diff fencing
- Frontend renders diff with green/red syntax highlighting
This commit is contained in:
Fam Zheng
2026-03-10 19:03:47 +00:00
parent 978af45d5f
commit 63bbbae17c
3 changed files with 104 additions and 3 deletions

View File

@@ -1124,7 +1124,7 @@ async fn process_feedback(
}).collect();
// Apply docker-cache diff
state.apply_plan_diff(new_steps);
let diff = state.apply_plan_diff(new_steps);
// Broadcast updated plan
let _ = broadcast_tx.send(WsMessage::PlanUpdate {
@@ -1134,6 +1134,10 @@ async fn process_feedback(
tracing::info!("[workflow {}] Plan revised via feedback. First actionable: {:?}",
workflow_id, state.first_actionable_step());
// Log the diff so frontend can show what changed
let diff_display = format!("```diff\n{}\n```", diff);
log_execution(pool, broadcast_tx, workflow_id, 0, "revise_plan", "计划变更", &diff_display, "done").await;
}
}
} else {