From 1574486dfaf0016ae75a6a3247359bf530dec0ae Mon Sep 17 00:00:00 2001 From: ATMackay Date: Thu, 19 Mar 2026 00:54:29 +1100 Subject: [PATCH 1/2] refactor(documentor): embed Agent --- agents/documentor/documentor.go | 9 ++------- cmd/documentor.go | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/agents/documentor/documentor.go b/agents/documentor/documentor.go index 547d76c..7daff90 100644 --- a/agents/documentor/documentor.go +++ b/agents/documentor/documentor.go @@ -10,7 +10,7 @@ import ( ) type Documentor struct { - inner agent.Agent + agent.Agent } // NewDocumentor returns a Documentor agent. @@ -42,10 +42,5 @@ func NewDocumentor(ctx context.Context, cfg *Config, model model.LLM) (*Document return nil, err } - return &Documentor{inner: da}, nil -} - -// Agent returns the inner agent interface (higher abstraction may not be necessary but we will see). -func (d *Documentor) Agent() agent.Agent { - return d.inner + return &Documentor{Agent: da}, nil } diff --git a/cmd/documentor.go b/cmd/documentor.go index a1f65e1..63bfbe4 100644 --- a/cmd/documentor.go +++ b/cmd/documentor.go @@ -87,14 +87,14 @@ func NewDocumentorCmd() *cobra.Command { slog.Info( "created agent", - "agent_name", docAgent.Agent().Name(), - "agent_description", docAgent.Agent().Description(), + "agent_name", docAgent.Name(), + "agent_description", docAgent.Description(), ) sessService := session.InMemoryService() r, err := runner.New(runner.Config{ AppName: "documentor", - Agent: docAgent.Agent(), + Agent: docAgent, SessionService: sessService, }) if err != nil { From 016a7424ffc582f4a0ce2037d759aa2d25ffa46b Mon Sep 17 00:00:00 2001 From: ATMackay Date: Thu, 19 Mar 2026 00:55:20 +1100 Subject: [PATCH 2/2] space --- tools/tools.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/tools.go b/tools/tools.go index 5e898db..4cd4274 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -28,16 +28,12 @@ func GetToolByEnum(kind Kind, deps *Deps) (tool.Tool, error) { return nil, fmt.Errorf("fetch_repo_tree requires WorkDir") } return NewFetchRepoTreeTool(cfg.WorkDir) - case ReadFile: return NewReadFileTool() - case SearchRepo: return NewSearchRepoTool() - case WriteFile: return NewWriteFileTool() - default: return nil, fmt.Errorf("invalid tool kind: %q", kind) }