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:
parent
63db9e8733
commit
3b038032af
1 changed files with 11 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue