diff --git a/apps/macos/Sources/Moltbot/AgentEventsWindow.swift b/apps/macos/Sources/Moltbot/AgentEventsWindow.swift index 8e2f43eb1..32f4bab75 100644 --- a/apps/macos/Sources/Moltbot/AgentEventsWindow.swift +++ b/apps/macos/Sources/Moltbot/AgentEventsWindow.swift @@ -67,7 +67,7 @@ private struct EventRow: View { private var tint: Color { switch self.event.stream { - case "job": .blue + case "lifecycle": .blue case "tool": .orange case "assistant": .green default: .gray diff --git a/apps/macos/Sources/Moltbot/ControlChannel.swift b/apps/macos/Sources/Moltbot/ControlChannel.swift index 2af7c721d..093e89983 100644 --- a/apps/macos/Sources/Moltbot/ControlChannel.swift +++ b/apps/macos/Sources/Moltbot/ControlChannel.swift @@ -379,8 +379,11 @@ final class ControlChannel { let sessionKey = (event.data["sessionKey"]?.value as? String) ?? "main" switch event.stream.lowercased() { - case "job": - if let state = event.data["state"]?.value as? String { + case "lifecycle": + // Gateway emits phase: "start" | "end" | "error" + // WorkActivityStore expects state: "started" | "streaming" | (anything else = done) + if let phase = event.data["phase"]?.value as? String { + let state = phase.lowercased() == "start" ? "started" : "done" WorkActivityStore.shared.handleJob(sessionKey: sessionKey, state: state) } case "tool":