From d002a4c07e3d2ce495a953d8ea6c47b051feff23 Mon Sep 17 00:00:00 2001 From: Gerard Louis Recinto Date: Sat, 19 Sep 2026 15:45:40 -0700 Subject: [PATCH] drop mapToStruct and spaceResultToJSON, both dead with no duplicate call sites --- ai/agent/api_core.go | 13 ------------- ai/agent/api_space.go | 10 ---------- 2 files changed, 23 deletions(-) diff --git a/ai/agent/api_core.go b/ai/agent/api_core.go index 2177492f1..c4c84fefe 100644 --- a/ai/agent/api_core.go +++ b/ai/agent/api_core.go @@ -2,7 +2,6 @@ package agent import ( "context" - "encoding/json" "fmt" ) @@ -153,15 +152,3 @@ func (a *CopilotAgent) Join(ctx context.Context, args JoinArgs) (string, error) } return formatToolResult(ctx, res) } - -// Helper to convert map to struct (for adapters) -func mapToStruct(input map[string]any, output any) error { - bytes, err := json.Marshal(input) - if err != nil { - return fmt.Errorf("marshal failed: %w", err) - } - if err := json.Unmarshal(bytes, output); err != nil { - return fmt.Errorf("unmarshal failed: %w", err) - } - return nil -} diff --git a/ai/agent/api_space.go b/ai/agent/api_space.go index 80bb85933..4890da4dd 100644 --- a/ai/agent/api_space.go +++ b/ai/agent/api_space.go @@ -2,7 +2,6 @@ package agent import ( "context" - "encoding/json" "fmt" "github.com/sharedcode/joltrin" @@ -416,12 +415,3 @@ func (a *CopilotAgent) SearchItemsByPath(ctx context.Context, args SearchItemsBy } return items, nil } - -// Helper to convert struct to JSON string for backward compatibility -func spaceResultToJSON(v any) (string, error) { - b, err := json.Marshal(v) - if err != nil { - return "", err - } - return string(b), nil -}