Commit Graph

4 Commits

Author SHA1 Message Date
Levi Neely 51b2013ac3 gui: fix deadlock — demand-driven chat streaming
The chat stream (ollie-9p read .../chat) blocks forever waiting for
data. Starting it on agent switch meant stopStreams() would block the
main thread trying to kill a hung process.

Fix: stream chat only while the agent is active.
- submit() starts the chat stream (agent is about to become active)
- Event handler stops chat on idle transition, starts on non-idle
- switchAgent() only starts chat if agent is already non-idle
- NativeStreamer::stop() uses SIGTERM+200ms then SIGKILL+100ms
  instead of immediate SIGKILL+1000ms
2026-08-08 23:20:03 +02:00
Levi Neely 6fda37ae96 nativestreamer: use subprocess instead of blocking thread
Go blocking reads can't be interrupted by closing the fid from another
thread. Revert to subprocess-based streaming using ollie-9p, which can
be killed cleanly.

Native library is still used for all request/response operations.
Only streaming (chat, statewait, eventwait) uses subprocess.
2026-08-07 18:05:53 +02:00
Levi Neely 16883248f0 nativestreamer: fix thread cleanup race
- Disconnect finished signal before waiting in stop() to prevent
  onThreadFinished from running after thread is deleted
- Use deleteLater() in onThreadFinished for safe cleanup during restart
- Remove redundant quit() call (QThread::create threads have no event loop)
2026-08-07 18:03:43 +02:00
Levi Neely ca4dc2d412 gui: eliminate all subprocess calls, use native 9P streaming
Replace StreamFsm and NinePConnection (QProcess-based) with NativeStreamer
which uses the new libollie9p streaming API (open/read_fid/close_fid).

All 9P operations now go through the native library:
- Chat, statewait, eventwait streams use threaded NativeStreamer
- Request/response operations use Lib9pClient directly
- No more subprocess spawning for any 9P operation

Remove ninepBin, ollie9pBin, serverAddr, run9p helper functions.
Remove streamfsm.cpp/h, ninepconnection.cpp/h from build.
2026-08-07 18:02:45 +02:00