Skip to content

Commit 94c8e87

Browse files
committed
disable tools
1 parent 358a1ba commit 94c8e87

File tree

2 files changed

+29
-58
lines changed

2 files changed

+29
-58
lines changed

internal/services/toolkit/client/utils_v2.go

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
"paperdebugger/internal/libs/logger"
1414
"paperdebugger/internal/services"
1515
"paperdebugger/internal/services/toolkit/registry"
16-
filetools "paperdebugger/internal/services/toolkit/tools/files"
17-
latextools "paperdebugger/internal/services/toolkit/tools/latex"
1816
"paperdebugger/internal/services/toolkit/tools/xtramcp"
1917
chatv2 "paperdebugger/pkg/gen/api/chat/v2"
2018
"strings"
@@ -113,39 +111,39 @@ func initializeToolkitV2(
113111
toolRegistry := registry.NewToolRegistryV2()
114112

115113
// Register static file tools (create/delete don't need ProjectService - they're placeholder only)
116-
toolRegistry.Register("create_file", filetools.CreateFileToolDescriptionV2, filetools.CreateFileTool)
117-
toolRegistry.Register("delete_file", filetools.DeleteFileToolDescriptionV2, filetools.DeleteFileTool)
118-
toolRegistry.Register("create_folder", filetools.CreateFolderToolDescriptionV2, filetools.CreateFolderTool)
119-
toolRegistry.Register("delete_folder", filetools.DeleteFolderToolDescriptionV2, filetools.DeleteFolderTool)
114+
// toolRegistry.Register("create_file", filetools.CreateFileToolDescriptionV2, filetools.CreateFileTool)
115+
// toolRegistry.Register("delete_file", filetools.DeleteFileToolDescriptionV2, filetools.DeleteFileTool)
116+
// toolRegistry.Register("create_folder", filetools.CreateFolderToolDescriptionV2, filetools.CreateFolderTool)
117+
// toolRegistry.Register("delete_folder", filetools.DeleteFolderToolDescriptionV2, filetools.DeleteFolderTool)
120118

121119
// Register file tools with ProjectService injection
122-
readFileTool := filetools.NewReadFileTool(projectService)
123-
toolRegistry.Register("read_file", filetools.ReadFileToolDescriptionV2, readFileTool.Call)
120+
// readFileTool := filetools.NewReadFileTool(projectService)
121+
// toolRegistry.Register("read_file", filetools.ReadFileToolDescriptionV2, readFileTool.Call)
124122

125-
readFolderTool := filetools.NewReadFolderTool(projectService)
126-
toolRegistry.Register("read_folder", filetools.ReadFolderToolDescriptionV2, readFolderTool.Call)
123+
// listFolderTool := filetools.NewListFolderTool(projectService)
124+
// toolRegistry.Register("list_folder", filetools.ListFolderToolDescriptionV2, listFolderTool.Call)
127125

128-
searchStringTool := filetools.NewSearchStringTool(projectService)
129-
toolRegistry.Register("search_string", filetools.SearchStringToolDescriptionV2, searchStringTool.Call)
126+
// searchStringTool := filetools.NewSearchStringTool(projectService)
127+
// toolRegistry.Register("search_string", filetools.SearchStringToolDescriptionV2, searchStringTool.Call)
130128

131-
searchFileTool := filetools.NewSearchFileTool(projectService)
132-
toolRegistry.Register("search_file", filetools.SearchFileToolDescriptionV2, searchFileTool.Call)
129+
// searchFileTool := filetools.NewSearchFileTool(projectService)
130+
// toolRegistry.Register("search_file", filetools.SearchFileToolDescriptionV2, searchFileTool.Call)
133131

134-
logger.Info("[AI Client V2] Registered static file tools", "count", 8)
132+
logger.Info("[AI Client V2] Registered static file tools", "count", 0)
135133

136134
// Register LaTeX tools with ProjectService injection
137-
documentStructureTool := latextools.NewDocumentStructureTool(projectService)
138-
toolRegistry.Register("get_document_structure", latextools.GetDocumentStructureToolDescriptionV2, documentStructureTool.Call)
135+
// documentStructureTool := latextools.NewDocumentStructureTool(projectService)
136+
// toolRegistry.Register("get_document_structure", latextools.GetDocumentStructureToolDescriptionV2, documentStructureTool.Call)
139137

140-
toolRegistry.Register("locate_section", latextools.LocateSectionToolDescriptionV2, latextools.LocateSectionTool)
138+
// toolRegistry.Register("locate_section", latextools.LocateSectionToolDescriptionV2, latextools.LocateSectionTool)
141139

142-
readSectionSourceTool := latextools.NewReadSectionSourceTool(projectService)
143-
toolRegistry.Register("read_section_source", latextools.ReadSectionSourceToolDescriptionV2, readSectionSourceTool.Call)
140+
// readSectionSourceTool := latextools.NewReadSectionSourceTool(projectService)
141+
// toolRegistry.Register("read_section_source", latextools.ReadSectionSourceToolDescriptionV2, readSectionSourceTool.Call)
144142

145-
readSourceLineRangeTool := latextools.NewReadSourceLineRangeTool(projectService)
146-
toolRegistry.Register("read_source_line_range", latextools.ReadSourceLineRangeToolDescriptionV2, readSourceLineRangeTool.Call)
143+
// readSourceLineRangeTool := latextools.NewReadSourceLineRangeTool(projectService)
144+
// toolRegistry.Register("read_source_line_range", latextools.ReadSourceLineRangeToolDescriptionV2, readSourceLineRangeTool.Call)
147145

148-
logger.Info("[AI Client V2] Registered static LaTeX tools", "count", 4)
146+
logger.Info("[AI Client V2] Registered static LaTeX tools", "count", 0)
149147

150148
// Load tools dynamically from backend
151149
xtraMCPLoader := xtramcp.NewXtraMCPLoaderV2(db, projectService, cfg.XtraMCPURI)

internal/services/toolkit/tools/files/folder_read.go renamed to internal/services/toolkit/tools/files/folder_list.go

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515
"github.com/openai/openai-go/v3/packages/param"
1616
)
1717

18-
var ReadFolderToolDescriptionV2 = openai.ChatCompletionToolUnionParam{
18+
var ListFolderToolDescriptionV2 = openai.ChatCompletionToolUnionParam{
1919
OfFunction: &openai.ChatCompletionFunctionToolParam{
2020
Function: openai.FunctionDefinitionParam{
21-
Name: "read_folder",
21+
Name: "list_folder",
2222
Description: param.NewOpt("Lists the contents of a folder (directory) at the specified path. Can optionally list recursively."),
2323
Parameters: openai.FunctionParameters{
2424
"type": "object",
@@ -46,19 +46,19 @@ var ReadFolderToolDescriptionV2 = openai.ChatCompletionToolUnionParam{
4646
},
4747
}
4848

49-
type ReadFolderArgs struct {
49+
type ListFolderArgs struct {
5050
Path string `json:"path"`
5151
Recursive *bool `json:"recursive,omitempty"`
5252
MaxDepth *int `json:"max_depth,omitempty"`
5353
Pattern string `json:"pattern,omitempty"`
5454
}
5555

56-
type ReadFolderTool struct {
56+
type ListFolderTool struct {
5757
projectService *services.ProjectService
5858
}
5959

60-
func NewReadFolderTool(projectService *services.ProjectService) *ReadFolderTool {
61-
return &ReadFolderTool{
60+
func NewListFolderTool(projectService *services.ProjectService) *ListFolderTool {
61+
return &ListFolderTool{
6262
projectService: projectService,
6363
}
6464
}
@@ -68,8 +68,8 @@ type folderEntry struct {
6868
isDir bool
6969
}
7070

71-
func (t *ReadFolderTool) Call(ctx context.Context, toolCallId string, args json.RawMessage) (string, string, error) {
72-
var getArgs ReadFolderArgs
71+
func (t *ListFolderTool) Call(ctx context.Context, toolCallId string, args json.RawMessage) (string, string, error) {
72+
var getArgs ListFolderArgs
7373

7474
if err := json.Unmarshal(args, &getArgs); err != nil {
7575
return "", "", err
@@ -210,30 +210,3 @@ func (t *ReadFolderTool) Call(ctx context.Context, toolCallId string, args json.
210210

211211
return result.String(), "", nil
212212
}
213-
214-
// ReadFolderToolLegacy for backward compatibility (standalone function)
215-
func ReadFolderToolLegacy(ctx context.Context, toolCallId string, args json.RawMessage) (string, string, error) {
216-
var getArgs ReadFolderArgs
217-
218-
if err := json.Unmarshal(args, &getArgs); err != nil {
219-
return "", "", err
220-
}
221-
222-
recursive := false
223-
if getArgs.Recursive != nil {
224-
recursive = *getArgs.Recursive
225-
}
226-
227-
depthStr := "unlimited"
228-
if getArgs.MaxDepth != nil {
229-
depthStr = fmt.Sprintf("%d", *getArgs.MaxDepth)
230-
}
231-
232-
pattern := "*"
233-
if getArgs.Pattern != "" {
234-
pattern = getArgs.Pattern
235-
}
236-
237-
// TODO: This legacy function doesn't have access to ProjectService
238-
return fmt.Sprintf("[WARNING] read_folder tool not properly initialized. Requested: %s (recursive: %v, max_depth: %s, pattern: %s)", getArgs.Path, recursive, depthStr, pattern), "", nil
239-
}

0 commit comments

Comments
 (0)