diff --git a/internal/agent/loop_media.go b/internal/agent/loop_media.go index 6433ed3c..ac5152ad 100644 --- a/internal/agent/loop_media.go +++ b/internal/agent/loop_media.go @@ -98,6 +98,8 @@ func mimeFromExt(ext string) string { return "application/msword" case ".xls", ".xlsx": return "application/vnd.ms-excel" + case ".md": + return "text/markdown" default: return "application/octet-stream" } diff --git a/internal/tools/filesystem_write.go b/internal/tools/filesystem_write.go index 973e45f8..c2d77de9 100644 --- a/internal/tools/filesystem_write.go +++ b/internal/tools/filesystem_write.go @@ -77,7 +77,7 @@ func (t *WriteFileTool) Parameters() map[string]any { }, "deliver": map[string]any{ "type": "boolean", - "description": "If true, deliver this file to the user as an attachment (image, document, etc.)", + "description": "Deliver this file to the user as an attachment. Defaults to true. Set to false for intermediate/temporary files (e.g. config, cache, temp scripts).", }, }, "required": []string{"path", "content"}, @@ -87,7 +87,10 @@ func (t *WriteFileTool) Parameters() map[string]any { func (t *WriteFileTool) Execute(ctx context.Context, args map[string]any) *Result { path, _ := args["path"].(string) content, _ := args["content"].(string) - deliver, _ := args["deliver"].(bool) + deliver := true + if v, ok := args["deliver"].(bool); ok { + deliver = v + } if path == "" { return ErrorResult("path is required") }