session ended as disconnect signal

This commit is contained in:
Levi Neely 2026-08-02 23:51:40 +02:00
parent b50a2e01b2
commit 41f95e84c2
1 changed files with 8 additions and 1 deletions

View File

@ -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).