claudetool: minor patch fixes
- docs
- actually use the more lenient parser in aae47584ce87e0f3e6d9c59a26433f515002816a
- tweak tool description
diff --git a/claudetool/patch.go b/claudetool/patch.go
index d0be332..fb04319 100644
--- a/claudetool/patch.go
+++ b/claudetool/patch.go
@@ -26,6 +26,7 @@
type PatchCallback func(input PatchInput, output llm.ToolOut) llm.ToolOut
// PatchTool specifies an llm.Tool for patching files.
+// PatchTools are not concurrency-safe.
type PatchTool struct {
Callback PatchCallback // may be nil
// Pwd is the working directory for resolving relative paths
@@ -38,14 +39,7 @@
Name: PatchName,
Description: strings.TrimSpace(PatchDescription),
InputSchema: llm.MustSchema(PatchInputSchema),
- Run: func(ctx context.Context, m json.RawMessage) llm.ToolOut {
- var input PatchInput
- output := p.patchRun(ctx, m, &input)
- if p.Callback != nil {
- return p.Callback(input, output)
- }
- return output
- },
+ Run: p.Run,
}
}
@@ -55,7 +49,7 @@
File modification tool for precise text edits.
Operations:
-- replace: Substitute text with new content
+- replace: Substitute unique text with new content
- append_eof: Append new text at the end of the file
- prepend_bof: Insert new text at the beginning of the file
- overwrite: Replace the entire file with new content (automatically creates the file)