Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(filesystem): handle created files in apply-patch summary

Steven Enamakele98166295c01
diff --git a/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs b/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs
index 1ba9a7b9e6..0a185aa265 100644
--- a/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs
+++ b/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs
@@ -377,7 +377,10 @@ impl ApplyPatchTool {
)));
}
written.push(buf);
- summary.push(format!("{path}: {} replacement(s)", buf.edit_count));
+ summary.push(match buf.original {
+ None => format!("{path}: created ({} bytes)", buf.contents.len()),
+ Some(_) => format!("{path}: {} replacement(s)", buf.edit_count),
+ });
}
// Record writes in the file-state coordinator.
if let Some(agent_id) = file_state::current_file_state_agent_id() {