diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 0b4be28e0..cdca8bb56 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -101,10 +101,9 @@ func NewAgentLoop( state: stateManager, summarizing: sync.Map{}, fallback: fallbackChain, + cmdRegistry: commands.NewRegistry(commands.BuiltinDefinitions()), } - al.cmdRegistry = commands.NewRegistry(commands.BuiltinDefinitions()) - return al } @@ -1471,7 +1470,7 @@ func (al *AgentLoop) handleCommand( return "", false } - rt := al.buildRuntime() + rt := al.buildCommandsRuntime() executor := commands.NewExecutor(al.cmdRegistry, rt) var commandReply string @@ -1495,12 +1494,12 @@ func (al *AgentLoop) handleCommand( return commandReply, true } return "", true - default: + default: // OutcomePassthrough — let the message fall through to LLM return "", false } } -func (al *AgentLoop) buildRuntime() *commands.Runtime { +func (al *AgentLoop) buildCommandsRuntime() *commands.Runtime { return &commands.Runtime{ Config: al.cfg, GetModelInfo: func() (string, string) {