You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(write-file): add unit and integration tests for WriteFileTool #453
Add comprehensive tests for WriteFileTool, including handling of multiline and special character content. Improve ToolCallParser to better parse parameters and extract content. Allow blank file content in ToolOrchestrator. Fix escape sequence processing order.
Copy file name to clipboardExpand all lines: mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -235,13 +235,16 @@ class ToolOrchestrator(
235
235
returnToolResult.Error("File path cannot be empty")
236
236
}
237
237
238
-
if (content.isNullOrBlank()) {
239
-
returnToolResult.Error("File content cannot be empty. Please provide the content parameter with the file content to write. Example: /write-file path=\"$path\" content=\"your content here\"")
238
+
if (content==null) {
239
+
returnToolResult.Error("File content parameter is missing. Please provide the content parameter with the file content to write. Example: /write-file path=\"$path\" content=\"your content here\"")
240
240
}
241
241
242
+
// Allow empty content (blank files are valid)
243
+
val actualContent = content
244
+
242
245
val writeFileParams = cc.unitmesh.agent.tool.impl.WriteFileParams(
0 commit comments