From cca5cd5770818c896ca790a3c7fda16093eab3da Mon Sep 17 00:00:00 2001 From: xiwuqi Date: Thu, 26 Mar 2026 22:46:20 -0500 Subject: [PATCH] refactor(agent): remove unused definition helpers --- pkg/agent/definition.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/pkg/agent/definition.go b/pkg/agent/definition.go index cf73d607c..7d4a6c0f6 100644 --- a/pkg/agent/definition.go +++ b/pkg/agent/definition.go @@ -3,7 +3,6 @@ package agent import ( "os" "path/filepath" - "slices" "strings" "github.com/gomarkdown/markdown/parser" @@ -117,21 +116,6 @@ func loadAgentDefinition(workspace string) AgentContextDefinition { return definition } -func (definition AgentContextDefinition) trackedPaths(workspace string) []string { - paths := []string{ - filepath.Join(workspace, string(AgentDefinitionSourceAgent)), - filepath.Join(workspace, "SOUL.md"), - filepath.Join(workspace, "USER.md"), - } - if definition.Source != AgentDefinitionSourceAgent { - paths = append(paths, - filepath.Join(workspace, string(AgentDefinitionSourceAgents)), - filepath.Join(workspace, "IDENTITY.md"), - ) - } - return uniquePaths(paths) -} - func loadUserDefinition(workspace string) *UserDefinition { userPath := filepath.Join(workspace, "USER.md") if content, err := os.ReadFile(userPath); err == nil { @@ -234,21 +218,6 @@ func relativeWorkspacePath(workspace, path string) string { return filepath.Clean(path) } -func uniquePaths(paths []string) []string { - result := make([]string, 0, len(paths)) - for _, path := range paths { - if strings.TrimSpace(path) == "" { - continue - } - cleaned := filepath.Clean(path) - if slices.Contains(result, cleaned) { - continue - } - result = append(result, cleaned) - } - return result -} - func fileExists(path string) bool { _, err := os.Stat(path) return err == nil