gui: clicking a session clears explicit agent selection

- Session row click now calls setActiveSessionId(id)
- setActiveSessionId no longer returns early for same-session clicks;
  it always clears m_agentId and stops per-agent streams
- This enforces a clean 'session selected, no agent selected' state
This commit is contained in:
Levi Neely 2026-08-01 21:22:33 +02:00
parent 38cd1313ec
commit b8fc64fb18
2 changed files with 4 additions and 2 deletions

View File

@ -604,6 +604,7 @@ ApplicationWindow {
} }
if (renamingIndex >= 0) return if (renamingIndex >= 0) return
if (type === "session") { if (type === "session") {
ollie.setActiveSessionId(id)
toggleExpand(parent.modelIndex) toggleExpand(parent.modelIndex)
} else if (type === "agent") { } else if (type === "agent") {
activateAgent(parentId, agentId) activateAgent(parentId, agentId)

View File

@ -49,8 +49,9 @@ Ollie9pClient::~Ollie9pClient()
void Ollie9pClient::setActiveSessionId(const QString &id) void Ollie9pClient::setActiveSessionId(const QString &id)
{ {
if (m_activeSessionId == id) return; // Session selection must be side-effect free for per-agent streams.
// Even re-selecting the same session should clear agent selection and stop
// statewait/chat so the UI can stay in a pure "session selected" state.
stopStreams(); stopStreams();
m_activeSessionId = id; m_activeSessionId = id;
m_agentId.clear(); m_agentId.clear();