mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs(coderd/x/chatd): improve edit_files tool description (#24627)
Document the fuzzy matching behavior, error-on-ambiguity semantics, and atomic batch validation that were missing from the tool description. These are the three behaviors most likely to surprise callers who assume naive exact-match search/replace.
This commit is contained in:
@@ -22,8 +22,12 @@ type EditFilesArgs struct {
|
||||
func EditFiles(options EditFilesOptions) fantasy.AgentTool {
|
||||
return fantasy.NewAgentTool(
|
||||
"edit_files",
|
||||
"Perform search-and-replace edits on one or more files in the workspace."+
|
||||
" Each file can have multiple edits applied atomically.",
|
||||
"Perform search-and-replace edits on one or more files. Matching"+
|
||||
" is fuzzy (tolerates whitespace and indentation differences) and"+
|
||||
" preserves the file's existing indentation and line endings."+
|
||||
" Errors if search matches zero locations, or more than one unless"+
|
||||
" replace_all is set. All edits in a batch are validated before any"+
|
||||
" file is written.",
|
||||
func(ctx context.Context, args EditFilesArgs, _ fantasy.ToolCall) (fantasy.ToolResponse, error) {
|
||||
var planPath string
|
||||
if options.IsPlanTurn && len(args.Files) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user