unified read_file tool

This commit is contained in:
afjcjsbx 2026-03-27 21:42:23 +01:00
parent 6090ab1d20
commit 85711cce94
2 changed files with 9 additions and 3 deletions

View file

@ -275,8 +275,14 @@ func TestNewAgentInstance_ReadFileModeSelectsSchema(t *testing.T) {
params := readTool.Parameters() params := readTool.Parameters()
props, _ := params["properties"].(map[string]any) props, _ := params["properties"].(map[string]any)
if _, ok := props["limit"]; !ok { if _, ok := props["start_line"]; !ok {
t.Fatalf("expected line-mode schema to expose limit, got %#v", props) t.Fatalf("expected line-mode schema to expose start_line, got %#v", props)
}
if _, ok := props["max_lines"]; !ok {
t.Fatalf("expected line-mode schema to expose max_lines, got %#v", props)
}
if _, ok := props["offset"]; ok {
t.Fatalf("did not expect line-mode schema to expose offset, got %#v", props)
} }
if _, ok := props["length"]; ok { if _, ok := props["length"]; ok {
t.Fatalf("did not expect line-mode schema to expose length, got %#v", props) t.Fatalf("did not expect line-mode schema to expose length, got %#v", props)

View file

@ -320,7 +320,7 @@ func (t *ReadFileTool) Name() string {
} }
func (t *ReadFileLinesTool) Name() string { func (t *ReadFileLinesTool) Name() string {
return "read_file_lines" return "read_file"
} }
func (t *ReadFileTool) Description() string { func (t *ReadFileTool) Description() string {