Commit Graph

8 Commits

Author SHA1 Message Date
Levi Neely 31cac84423 dbus: add detached process management methods
New D-Bus methods on SessionManager:
- DetachProcess(sessionID) - detach currently running process
- ListDetached(sessionID) - list detached processes (pid/cmd/started/status)
- SignalDetached(sessionID, pid, signal) - send TERM or KILL
- GetDetachedOutput(sessionID, pid) - read ring buffer output
- DismissDetached(sessionID, pid) - remove exited process from list

New signal: ProcessDetached(sessionID) emitted on detach.
2026-07-17 16:51:55 +02:00
Levi Neely 7900514548 batch ChatUpdated D-Bus signals with 50ms coalescing
Previously every streaming token fired a separate D-Bus signal,
flooding the session bus and back-pressuring the HTTP stream reader.
New chatEmitter buffers text and flushes at most every 50ms. Log
writes remain immediate so GetChat always returns current data.
flushSync() drains the buffer before StateChanged signals.
2026-07-16 06:03:06 +02:00
Levi Neely 99a8dbfe88 session persistence: SIGHUP, bus disconnect, checkpointing, chat log restore
- Add SIGHUP to signal handler for non-systemd session teardown
- Detect D-Bus session bus disconnection via conn.Context().Done()
- Checkpoint individual sessions to disk on every idle transition
- Remove checkpoint files when sessions are killed
- Rebuild visible chat log from last 8 messages on restore
2026-07-14 20:58:06 +02:00
Levi Neely bb2ced28d8 session persistence: save/restore active sessions across restarts
On shutdown (SIGTERM/SIGINT), all active sessions are persisted to
~/.local/share/ollie/active-sessions/ as JSON files containing the
full message context, backend, model, agent, and cwd metadata.

On startup, persisted sessions are automatically restored with their
complete context window, then the persist files are cleaned up.
Copilot sessions are excluded from persistence (ephemeral).
2026-07-14 20:42:08 +02:00
Levi Neely 76c4ddcdd9 feat: add Complete D-Bus method for code completion
Adds a Complete method that manages a dedicated copilot session,
sends a FIM prompt with prefix/suffix context, waits for the
result, and returns cleaned completion text. Includes unit tests
for strip helpers.
2026-07-14 12:30:01 +02:00
Levi Neely 5afe7b69ac fix nil pointer dereference on /agent command
NewDispatcher was not passed to AgentCoreConfig in the dbus session
manager, causing a nil function call when switching agents via /agent.
2026-07-14 11:59:03 +02:00
Levi Neely 93ba8ffd29 feat: emit SessionRenamed signal on successful rename 2026-07-08 19:27:20 +02:00
Levi Neely 4ba889bb41 pure Go D-Bus daemon replacing C++/cgo implementation 2026-07-07 13:02:25 +02:00