diff --git a/kde/gui/nativestreamer.h b/kde/gui/nativestreamer.h index b963ad8..faedb2a 100644 --- a/kde/gui/nativestreamer.h +++ b/kde/gui/nativestreamer.h @@ -11,7 +11,7 @@ * NativeStreamer - Streaming file reader using ollie-9p subprocess. * * Uses ollie-9p subprocess for streaming reads (blocking wait files like - * chat, statewait, event). The native library is used for request/response + * chat, event). The native library is used for request/response * operations, but subprocess is needed for streaming because: * - Blocking reads in Go can't be interrupted by closing the fid * - Subprocess can be killed cleanly diff --git a/kde/gui/ollie9pclient.cpp b/kde/gui/ollie9pclient.cpp index cbbb09f..6e7e6b1 100644 --- a/kde/gui/ollie9pclient.cpp +++ b/kde/gui/ollie9pclient.cpp @@ -25,21 +25,9 @@ Ollie9pClient::Ollie9pClient(QObject *parent) emit chatReceived(QString::fromUtf8(data)); }); - // State stream — guarded, reads agent statewait. Auto-restarts until - // session/agent is deselected or daemon disconnects (guard returns false). - m_state = new Lib9pStreamer(Lib9pStreamer::Guarded, this); - m_state->setGuard([this]() { - return m_daemonConnected && !m_activeSessionId.isEmpty() && !m_agentId.isEmpty(); - }); - connect(m_state, &Lib9pStreamer::dataReady, this, [this](const QByteArray &data) { - QString state = QString::fromUtf8(data).trimmed(); - if (!state.isEmpty()) { - m_activeState = state; - emit activeStateChanged(); - } - }); - // Event stream — looping, reads server event for session/agent events. + // This single stream handles all state changes across all agents — no + // teardown/startup overhead on agent switch. m_event = new Lib9pStreamer(Lib9pStreamer::Looping, this); connect(m_event, &Lib9pStreamer::dataReady, this, [this](const QByteArray &data) { // Events may come in batches separated by newlines @@ -829,7 +817,6 @@ void Ollie9pClient::startActiveAgentStreams() if (m_activeSessionId.isEmpty() || m_agentId.isEmpty()) return; m_chat->start(agentPath() + "/chat.raw"); - m_state->start(agentPath() + "/statewait"); // Check for pending bypass request on this session checkPendingBypass(); @@ -861,7 +848,6 @@ void Ollie9pClient::checkPendingBypass() void Ollie9pClient::stopAgentStreams() { if (m_chat) m_chat->stop(); - if (m_state) m_state->stop(); } void Ollie9pClient::stopStreams() diff --git a/kde/gui/ollie9pclient.h b/kde/gui/ollie9pclient.h index 064fd33..d82bde1 100644 --- a/kde/gui/ollie9pclient.h +++ b/kde/gui/ollie9pclient.h @@ -12,7 +12,7 @@ #include "lib9pstreamer.h" // 9P-based client for ollie. Uses native libollie9p for all operations. -// Streaming files (chat, statewait, event) use Lib9pStreamer threads. +// Streaming files (chat, event) use Lib9pStreamer threads. class Ollie9pClient : public QObject { Q_OBJECT @@ -149,8 +149,7 @@ private: // Native streaming readers Lib9pStreamer *m_chat = nullptr; // Guarded — reads agent chat log - Lib9pStreamer *m_state = nullptr; // Guarded — reads agent statewait - Lib9pStreamer *m_event = nullptr; // Looping — reads server event + Lib9pStreamer *m_event = nullptr; // Looping — reads server event (includes state changes) }; #endif // OLLIE9PCLIENT_H \ No newline at end of file