From e0d09a55d3f319d33702e26d74b339932a7f5a67 Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Sat, 3 Jan 2026 06:15:03 +0000 Subject: [PATCH] Fix user message not appearing when viewing parallel missions When switching to a parallel mission, currentMission was not being updated, causing viewingId != currentId. This made the event filter skip user_message events (which have mission_id: None from main session). Now always update currentMission when switching, ensuring the filter passes events correctly. --- .../Views/Control/ControlView.swift | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/ios_dashboard/OpenAgentDashboard/Views/Control/ControlView.swift b/ios_dashboard/OpenAgentDashboard/Views/Control/ControlView.swift index d35fb3a..9f0f403 100644 --- a/ios_dashboard/OpenAgentDashboard/Views/Control/ControlView.swift +++ b/ios_dashboard/OpenAgentDashboard/Views/Control/ControlView.swift @@ -915,26 +915,15 @@ struct ControlView: View { return // Another mission was requested, discard this response } - // If this is not a parallel mission, also update currentMission - if runningMissions.contains(where: { $0.missionId == id }) { - // This is a parallel mission - just load its history - messages = mission.history.enumerated().map { index, entry in - ChatMessage( - id: "\(mission.id)-\(index)", - type: entry.isUser ? .user : .assistant(success: true, costCents: 0, model: nil), - content: entry.content - ) - } - } else { - // This is the main mission - load it fully - currentMission = mission - messages = mission.history.enumerated().map { index, entry in - ChatMessage( - id: "\(mission.id)-\(index)", - type: entry.isUser ? .user : .assistant(success: true, costCents: 0, model: nil), - content: entry.content - ) - } + // Always update currentMission when switching - this ensures + // the event filter logic works correctly (viewingId == currentId) + currentMission = mission + messages = mission.history.enumerated().map { index, entry in + ChatMessage( + id: "\(mission.id)-\(index)", + type: entry.isUser ? .user : .assistant(success: true, costCents: 0, model: nil), + content: entry.content + ) } isLoading = false