Commit Graph

368 Commits

Author SHA1 Message Date
Levi Neely adb2760c91 fix(gui): load sessions on startup, show '(no sessions)' placeholder
- ensureRootDataLoaded() now calls refreshSessions() so the initial
  session list is populated immediately, not only on events
- Added '(no sessions)' placeholder label in the session tree ListView
  when no sessions exist
2026-08-01 20:05:31 +02:00
Levi Neely 6fcef9f60c feat(gui): handle empty sessions in ollie-gui
- getAgents(): filter out 'new' (agent creation file), return empty list
- setActiveSessionId(): skip agent init when no agents exist
- submit/interrupt/kill/streams: guard against empty m_agentId
- prompt input: disable when no agent, show 'No agent' placeholder
2026-08-01 19:51:07 +02:00
Levi Neely c4d6f2a1b9 gui: use rdwr (not write) for session/new and agent/new 2026-08-01 18:50:19 +02:00
Levi Neely 153b40cbc7 gui: write name= to session/new, then agent params to session/{name}/agent/new 2026-08-01 18:41:16 +02:00
Levi Neely 68a84a2404 gui: session group has Name only; all else under Agent 2026-08-01 18:35:32 +02:00
Levi Neely 1b67305ef7 gui: group session/agent params in new session dialog; add agent alias field 2026-08-01 18:33:05 +02:00
Levi Neely 374349622e gui: stop state stream when session is killed; don't restart if session gone 2026-08-01 18:27:55 +02:00
Levi Neely 363b2e95ed gui: add double-click to rename agent nodes in tree view 2026-08-01 18:17:13 +02:00
Levi Neely 74d346418d gui: re-discover agent ID on state stream start to pick up renames 2026-08-01 18:14:29 +02:00
Levi Neely 79d031ff04 remove 'Agent ' prefix from agent display name 2026-08-01 18:04:28 +02:00
Levi Neely cec358bdb9 omit response ID from assistant header 2026-08-01 17:18:27 +02:00
Levi Neely e8a3c6e1d8 ▶️ for call, 🖥️ for tool headers 2026-08-01 17:17:36 +02:00
Levi Neely 25492c889e ❌ for error headers 2026-08-01 17:16:19 +02:00
Levi Neely 37d4b995f4 emoji labels: 🧑 Human, 🤖 Ollie, ℹ️ Info 2026-08-01 17:15:45 +02:00
Levi Neely bd88328972 use emoji-style ⚠️ with variation selector 2026-08-01 17:13:36 +02:00
Levi Neely 8617aa5293 gui: render user-interrupt with yellow background and warning icon
- Add Interrupt block type to ChatBlock enum
- Detect <system-user-interruption> and </system-user-interruption>
  tags as block openers/closers in the parser
- Render interrupt blocks with bright yellow header
  (#3d2e00 dark, #fff8e1 light)
- Show ⚠ User Interrupt header label
2026-08-01 17:11:52 +02:00
Levi Neely ada6dc1feb fix context menu: kill target session, not active one
Right-click now stores the target session ID in a root-level
property (killTargetSessionId) before popping the menu, avoiding
unreliable QML parent chain traversal that could resolve to the
wrong delegate.
2026-08-01 17:08:22 +02:00
Levi Neely 0706a052f4 fix QML mouse parameter deprecation warning
onClicked needs explicit function(mouse) parameter instead of
implicit injection.
2026-08-01 17:06:09 +02:00
Levi Neely 3d4e50a386 kill: write to session-level ctl instead of agent ctl
Session-level kill (session/{id}/ctl) does the full cleanup:
removes from session map, cancels context, closes agent, kills
toolsrv process, removes persisted JSON. Agent-level kill just
cancels the session context without cleaning up the filesystem.

Also remove unused getAgents call.
2026-08-01 17:05:19 +02:00
Levi Neely 612adb03f8 gui: add right-click context menu with Kill action for sessions
- Add killSession(sessionId) Q_INVOKABLE to Ollie9pClient
- Accept right button in session tree MouseArea
- Context menu with Kill option on right-click
- MenuItem resolves session ID via parent chain
2026-08-01 17:02:53 +02:00
Levi Neely 998efc15c5 chat log: switch to [[[type]]]/[[[end]]] block format
Replace the single-bracket INI-like format with triple-bracket blocks
with explicit [[[end]]] terminators. The parser tracks m_inBlock to
ignore content between blocks, making the format robust against
accidental header-like content in tool output or LLM responses.

- Go sender: FormatEvent + NewEventHandler + replayMessagesToLog
- C++ parser: new regex for [[[type]]], new [[[end]]] handler, m_inBlock gate
- QML: update hardcoded [info] string
2026-08-01 16:48:57 +02:00
Levi Neely b13dc6064b gui: make session tree fully expanded by default and responsive
- Remove 300ms click delay (timer-based single/double-click disambiguation)
- Use native QML onDoubleClicked for rename instead of timer hack
- Capture model index as delegate property to fix rename targeting all nodes
- Remove dead rename code that was orphaned by the timer removal
- Clean up Escape shortcut handler
2026-08-01 16:40:45 +02:00
Levi Neely 120e4a4bd6 gui: revert reasoning block suppression in QML (handled server-side now) 2026-08-01 16:28:21 +02:00
Levi Neely 78938cb220 gui: fix chat not reloading on session switch
The C++ connection mapping activeSessionIdChanged to chatModel->reset()
raced against the QML onActiveSessionIdChanged handler which does the
actual reload (reset → readLogForSession → appendData → trimFront).
When the C++ slot fired after the QML handler, it cleared the freshly
loaded chat data.

Remove the redundant C++ connection — the QML handler owns the full
reset+reload sequence and sequences the 9P log read correctly.
2026-08-01 16:19:59 +02:00
Levi Neely 9ba1de0c1c gui: preserve session tree expansion across agent switches
buildSessionTree() was clearing the tree and setting expanded=true
only for the active session, collapsing all other sessions whenever
an agent in a different session was selected.

Now snapshot expanded state before clearing and restore it, so manually
expanded sessions stay open across agent switches.
2026-08-01 16:16:55 +02:00
Levi Neely 76f97c42eb session rename: eventwait stream for live refresh, fix infinite loop 2026-08-01 16:14:43 +02:00
Levi Neely cd0f92e16d session rename: fix renameSession, use setProgram/setArguments 2026-08-01 15:53:03 +02:00
Levi Neely 4bd7a60e78 session rename: clean up comment, use ollie-9p mv 2026-08-01 15:50:31 +02:00
Levi Neely 63cf13b891 session rename: double-click to rename sessions in tree 2026-08-01 15:47:23 +02:00
Levi Neely 2267c57b54 fix: kate plugin and krunner compilation 2026-08-01 15:07:50 +02:00
Levi Neely 95cf201f4c remove inline autocomplete state machine from prompt input 2026-08-01 13:07:43 +02:00
Levi Neely 9bab0e73c2 fix: use promptInput.text instead of bare text in root-level autocomplete functions 2026-08-01 13:00:24 +02:00
Levi Neely 1d26552675 fix: remove duplicate property declarations from TextArea 2026-08-01 12:59:19 +02:00
Levi Neely 7358e10667 fix: missing closing brace for ApplicationWindow 2026-08-01 12:58:56 +02:00
Levi Neely 2af7d65f4e convert slash autocomplete to inline text expansion with LCP and arg completion 2026-08-01 12:56:32 +02:00
Levi Neely cb5ddc6e1a fix: remove non-existent elevation property from completion popup 2026-08-01 12:49:55 +02:00
Levi Neely c0b8ed49c5 fix: add missing m_currentBackend member variable 2026-08-01 12:49:07 +02:00
Levi Neely 1c419295f9 add currentBackend property for slash command completions 2026-08-01 12:47:47 +02:00
Levi Neely 64afb587e3 add slash command autocomplete: popup, model/backend completions, keyboard nav 2026-08-01 12:47:37 +02:00
Levi Neely 3a33c4e42a add retry block support: Retry type, header color, expanded default 2026-08-01 12:45:33 +02:00
Levi Neely 80b5b1dd5d gui: expand info blocks by default 2026-08-01 12:26:38 +02:00
Levi Neely 3255522144 gui: replace backend/model text fields with editable ComboBoxes, make chat blocks collapsible
- New session dialog: Backend and Model now use proper ComboBoxes with
  editable=true so users can type or select from dropdown
- Backend picker and model picker dialogs removed (no longer needed)
- Model list populated reactively via Connections on backend selection
- Fix model caching: m_rootModels[be].toStringList() returns a copy;
  extract to local QStringList, append, store back into map
- Session creation uses correct path 'session/new' instead of 'new'
- Chat blocks are now collapsible: user/assistant/tool expanded by default,
  reasoning/call/error/info/default collapsed
- Fix chat history on session switch: readLogForSession() reads from the
  explicit session/agent path instead of relying on active state
- Fix delegate layout: use plain ColumnLayout instead of Item-wrapped
  ColumnLayout so ListView calculates implicit heights correctly
2026-08-01 12:25:36 +02:00
Levi Neely 65dee58a6a gui: remove Stop button (ESC handles it) and debug logs 2026-08-01 12:05:34 +02:00
Levi Neely 5615f69d11 gui: use Shortcut for ESC key instead of Keys handler
- Keys.onEscapePressed doesn't fire when child items have focus
- Shortcut element provides proper global key handling
- Added console.log debugging to track ESC activation and activeState
2026-08-01 12:04:27 +02:00
Levi Neely ef63dfd398 gui: ESC key interrupts active agent (Stop action) 2026-08-01 12:03:29 +02:00
Levi Neely cc472da496 gui: sessions pane 15% of window (min 300px) 2026-08-01 12:01:40 +02:00
Levi Neely da31ca05f1 gui: make sessions pane width 30% of window (min 150px) 2026-08-01 12:01:16 +02:00
Levi Neely ff9bf89bcc gui: increase sessions pane default/min width to 240px 2026-08-01 12:00:52 +02:00
Levi Neely 7d75ba8524 gui: preserve original indentation in fenced code/diff blocks
- C++: Use <pre style="white-space:pre-wrap;"> instead of <div> with <br>
  so raw newlines are preserved through to the HTML renderer
- QML: Use TextEdit (preserves whitespace) instead of Label (collapses it)
  for rendering blockRenderedHtml
2026-08-01 12:00:14 +02:00
Levi Neely 7f083c0d7a gui: replace backend/model ComboBoxes with TextField + picker dialogs
- Backend: TextField with '...' button opens ListView of available backends
- Model: TextField with '...' button opens ListView filtered by selected backend
- Auto-populate model placeholder when backend text changes
- Model picker also works on manual click for re-selection
- Update onAccepted to use field.text instead of combo.currentText
2026-08-01 11:59:11 +02:00