[app-server] feat: add old_content and new_content to FileChange update patches

This commit is contained in:
Owen Lin
2025-12-02 14:28:32 -08:00
parent 8532876ad8
commit ce7fc27f89
12 changed files with 221 additions and 6 deletions
@@ -406,6 +406,7 @@ impl EventProcessor for EventProcessorWithHumanOutput {
FileChange::Update {
unified_diff,
move_path,
..
} => {
let header = if let Some(dest) = move_path {
format!(
@@ -823,6 +823,8 @@ fn patch_apply_success_produces_item_completed_patchapply() {
FileChange::Update {
unified_diff: "--- c/modified.txt\n+++ c/modified.txt\n@@\n-old\n+new\n".to_string(),
move_path: Some(PathBuf::from("c/renamed.txt")),
old_content: "-old\n".to_string(),
new_content: "+new\n".to_string(),
},
);
@@ -895,6 +897,8 @@ fn patch_apply_failure_produces_item_completed_patchapply_failed() {
FileChange::Update {
unified_diff: "--- file.txt\n+++ file.txt\n@@\n-old\n+new\n".to_string(),
move_path: None,
old_content: "-old\n".to_string(),
new_content: "+new\n".to_string(),
},
);