Merge branch 'refactor/agent' into feat/subturn-poc

This commit is contained in:
Administrator 2026-03-22 19:51:43 +08:00
commit 7ba8682ac5

View file

@ -44,7 +44,6 @@ type AgentLoop struct {
// Event system (from Incoming) // Event system (from Incoming)
eventBus *EventBus eventBus *EventBus
hooks *HookManager hooks *HookManager
hookRuntime hookRuntime
// Runtime state // Runtime state
running atomic.Bool running atomic.Bool
@ -55,6 +54,7 @@ type AgentLoop struct {
transcriber voice.Transcriber transcriber voice.Transcriber
cmdRegistry *commands.Registry cmdRegistry *commands.Registry
mcp mcpRuntime mcp mcpRuntime
hookRuntime hookRuntime
steering *steeringQueue steering *steeringQueue
mu sync.RWMutex mu sync.RWMutex
@ -534,7 +534,7 @@ func (al *AgentLoop) drainBusToSteering(ctx context.Context, activeScope, active
"sender_id": msg.SenderID, "sender_id": msg.SenderID,
}) })
} }
return continue
} }
// Transcribe audio if needed before steering, so the agent sees text. // Transcribe audio if needed before steering, so the agent sees text.
@ -717,11 +717,12 @@ func (al *AgentLoop) emitEvent(kind EventKind, meta EventMeta, payload any) {
Payload: payload, Payload: payload,
} }
al.logEvent(evt)
if al == nil || al.eventBus == nil { if al == nil || al.eventBus == nil {
return return
} }
al.logEvent(evt)
al.eventBus.Emit(evt) al.eventBus.Emit(evt)
} }