feat(runner): push channel notifications for AgentStarted + AgentCompleted

Runner HandleIPCEvents now catches AgentStarted in addition to
AgentCompleted, sending ChannelPush to MCP for both lifecycle events.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-26 11:55:44 +00:00
parent 63db9e8733
commit 3b038032af

View file

@ -122,8 +122,18 @@ func (s *Service) OnShutdown(_ context.Context) core.Result {
// PokeQueue → drain queue
func (s *Service) HandleIPCEvents(c *core.Core, msg core.Message) core.Result {
switch ev := msg.(type) {
case messages.AgentStarted:
c.ACTION(coremcp.ChannelPush{
Channel: "agent.status",
Data: map[string]any{
"agent": ev.Agent,
"repo": ev.Repo,
"workspace": ev.Workspace,
"status": "started",
},
})
case messages.AgentCompleted:
// Push channel event to Claude Code via MCP service
c.ACTION(coremcp.ChannelPush{
Channel: "agent.status",
Data: map[string]any{
@ -133,7 +143,6 @@ func (s *Service) HandleIPCEvents(c *core.Core, msg core.Message) core.Result {
"status": ev.Status,
},
})
// Poke queue to fill freed slot
s.Poke()
case messages.PokeQueue: