diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 78dbeb26d..8cefdfea7 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -57,9 +57,9 @@ type AgentLoop struct { cmdRegistry *commands.Registry mcp mcpRuntime hookRuntime hookRuntime - steering *steeringQueue - pendingSkills sync.Map // sessionKey → skillName (armed by /use ) - mu sync.RWMutex + steering *steeringQueue + pendingSkills sync.Map // sessionKey → skillName (armed by /use ) + mu sync.RWMutex providerCache map[string]providers.LLMProvider @@ -1506,9 +1506,13 @@ func (al *AgentLoop) callLLMWithRetry( // Helper to emit events if scope was provided emitRetryEvent := func(kind EventKind, payload any) { if len(scope) > 0 { - al.emitEvent(kind, - EventMeta{AgentID: agent.ID, TurnID: scope[0].turnID, SessionKey: opts.SessionKey, Iteration: iteration}, - payload) + meta := EventMeta{ + AgentID: agent.ID, + TurnID: scope[0].turnID, + SessionKey: opts.SessionKey, + Iteration: iteration, + } + al.emitEvent(kind, meta, payload) } } diff --git a/pkg/agent/loop_run.go b/pkg/agent/loop_run.go index 8e1ba1aa4..e2d87c6dd 100644 --- a/pkg/agent/loop_run.go +++ b/pkg/agent/loop_run.go @@ -917,7 +917,12 @@ func (al *AgentLoop) runLLMIteration( }) // Hook: BeforeLLM — let hooks inspect/modify the request - hookMeta := EventMeta{AgentID: agent.ID, TurnID: scope.turnID, SessionKey: opts.SessionKey, Iteration: iteration} + hookMeta := EventMeta{ + AgentID: agent.ID, + TurnID: scope.turnID, + SessionKey: opts.SessionKey, + Iteration: iteration, + } if al.hooks != nil { hookReq := &LLMHookRequest{ Meta: hookMeta, diff --git a/pkg/channels/manager.go b/pkg/channels/manager.go index 290361dc2..4a379e958 100644 --- a/pkg/channels/manager.go +++ b/pkg/channels/manager.go @@ -84,10 +84,10 @@ type Manager struct { mediaStore media.MediaStore dispatchTask *asyncTask mu sync.RWMutex - placeholders sync.Map // "channel:chatID" → placeholderID (string) - typingStops sync.Map // "channel:chatID" → func() - reactionUndos sync.Map // "channel:chatID" → reactionEntry - streamActive sync.Map // "channel:chatID" → true (set when streamer.Finalize sent the message) + placeholders sync.Map // "channel:chatID" → placeholderID (string) + typingStops sync.Map // "channel:chatID" → func() + reactionUndos sync.Map // "channel:chatID" → reactionEntry + streamActive sync.Map // "channel:chatID" → true (set when streamer.Finalize sent the message) } type asyncTask struct {