From 41f95e84c23a23f598718312d7f6e2b6944ec025 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 2 Aug 2026 23:51:40 +0200 Subject: [PATCH] session ended as disconnect signal --- gui/ollie9pclient.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index ff657e0..a43819a 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -45,7 +45,14 @@ Ollie9pClient::Ollie9pClient(QObject *parent) if (!data.isEmpty()) emit chatReceived(QString::fromUtf8(data)); }); - connect(m_chat, &StreamFsm::died, this, &Ollie9pClient::streamingDone); + connect(m_chat, &StreamFsm::died, this, [this]() { + // The chat stream closes when the selected session ends. Treat that + // existing signal as an immediate disconnect for connection tracking; + // the periodic connection probe will confirm or recover it later. + if (!m_activeSessionId.isEmpty() && !m_agentId.isEmpty()) + setAgentConnected(agentKey(m_activeSessionId, m_agentId), false); + emit streamingDone(); + }); // State stream — guarded, reads agent statewait. Auto-restarts until // session/agent is deselected (guard returns false).