fix: remaining gci and golines lint issues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-03-25 22:40:38 +09:00
parent ad24cddd57
commit 1e29329b8d
3 changed files with 20 additions and 11 deletions

View file

@ -57,9 +57,9 @@ type AgentLoop struct {
cmdRegistry *commands.Registry cmdRegistry *commands.Registry
mcp mcpRuntime mcp mcpRuntime
hookRuntime hookRuntime hookRuntime hookRuntime
steering *steeringQueue steering *steeringQueue
pendingSkills sync.Map // sessionKey → skillName (armed by /use <skill>) pendingSkills sync.Map // sessionKey → skillName (armed by /use <skill>)
mu sync.RWMutex mu sync.RWMutex
providerCache map[string]providers.LLMProvider providerCache map[string]providers.LLMProvider
@ -1506,9 +1506,13 @@ func (al *AgentLoop) callLLMWithRetry(
// Helper to emit events if scope was provided // Helper to emit events if scope was provided
emitRetryEvent := func(kind EventKind, payload any) { emitRetryEvent := func(kind EventKind, payload any) {
if len(scope) > 0 { if len(scope) > 0 {
al.emitEvent(kind, meta := EventMeta{
EventMeta{AgentID: agent.ID, TurnID: scope[0].turnID, SessionKey: opts.SessionKey, Iteration: iteration}, AgentID: agent.ID,
payload) TurnID: scope[0].turnID,
SessionKey: opts.SessionKey,
Iteration: iteration,
}
al.emitEvent(kind, meta, payload)
} }
} }

View file

@ -917,7 +917,12 @@ func (al *AgentLoop) runLLMIteration(
}) })
// Hook: BeforeLLM — let hooks inspect/modify the request // 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 { if al.hooks != nil {
hookReq := &LLMHookRequest{ hookReq := &LLMHookRequest{
Meta: hookMeta, Meta: hookMeta,

View file

@ -84,10 +84,10 @@ type Manager struct {
mediaStore media.MediaStore mediaStore media.MediaStore
dispatchTask *asyncTask dispatchTask *asyncTask
mu sync.RWMutex mu sync.RWMutex
placeholders sync.Map // "channel:chatID" → placeholderID (string) placeholders sync.Map // "channel:chatID" → placeholderID (string)
typingStops sync.Map // "channel:chatID" → func() typingStops sync.Map // "channel:chatID" → func()
reactionUndos sync.Map // "channel:chatID" → reactionEntry reactionUndos sync.Map // "channel:chatID" → reactionEntry
streamActive sync.Map // "channel:chatID" → true (set when streamer.Finalize sent the message) streamActive sync.Map // "channel:chatID" → true (set when streamer.Finalize sent the message)
} }
type asyncTask struct { type asyncTask struct {