Commit Graph

2533 Commits

Author SHA1 Message Date
Levi Neely 7b870443bb remove desktop notification for bypass requests
Bypass approval now flows through:
1. GUI - via event stream and banner
2. CLI - via agent loop (to be implemented)

Removed:
- bypass_notify.go (D-Bus notification)
- BypassNotifyFunc type and all references
- godbus/dbus dependency

The bypass event is still published via SetBypassPending.
2026-10-06 14:03:07 +02:00
Levi Neely 5882192ae9 gui: fix bypass banner not appearing until session switch
QML's property var change detection doesn't reliably trigger
binding updates when comparing to null. Added explicit bool
hasPendingBypass property that properly triggers visibility.
2026-10-06 13:56:28 +02:00
Levi Neely a4378c1be4 server: also match /event path in read handler 2026-10-06 13:51:25 +02:00
Levi Neely 5077dfea8e server: fix event file fallthrough when fid lookup fails
If fidOK was false for the event file, we fell through to the
default stream handling path which doesn't work for events.
Now we return 'bad fid' error instead of falling through.
2026-10-06 13:50:58 +02:00
Levi Neely d7d9e9654a replace pubsub library with simple fan-out event hub
The pubsub library had issues:
- Published to literal '*' topic (nonsensical)
- Used TrySend which drops events
- Complex hierarchical wildcard publishing

New implementation:
- Simple eventHub with map of subscribers
- PublishEvent fans out to all subscribers (blocking send)
- SubscribeEvents returns channel, cleaned up on ctx cancel
- SubscribeEventsFiltered filters client-side with MatchTopic
- Removed simonfxr/pubsub dependency
2026-10-06 13:43:57 +02:00
Levi Neely 63e7ed5c65 server: clarify event subscription uses 9P client connection context 2026-10-06 13:37:56 +02:00
Levi Neely 43d3051a78 server: fix event subscription context - use connection ctx not request ctx
The subscription was being cancelled after the first read completed
because we used the per-request context. Now using the connection
context so the subscription lives until the fid is clunked or
connection closed.
2026-10-06 13:36:26 +02:00
Levi Neely 79ab165ffd server: fix event dropping - use blocking callback instead of TrySend
The pubsub library's SubscribeChan uses non-blocking TrySend which
drops events when the channel is full. Switch to Subscribe with a
blocking callback to ensure no events are lost.

Also increased channel buffers from 64 to 256.
2026-10-06 13:32:56 +02:00
Levi Neely cd94cdf259 server: event file plain read now uses per-fid subscription
Plain reads (without writing a filter first) now get a per-fid
subscription with '*' filter, identical to 'echo * | rdwrs event'.

This fixes event loss — the old EventStream path overwrote events
when multiple arrived before the reader consumed them.
2026-10-06 13:27:02 +02:00
Levi Neely c96ccd51e8 doc: simplify size table - focus on core runtime only
~25K core + ~15.7K KDE = ~40.7K interesting code.
Backends, prompts, skills, docs excluded from headline.
2026-10-06 12:59:53 +02:00
Levi Neely 53efc8945e doc: refine size snapshot to highlight core runtime vs boilerplate
Backend adapters (~8.3K) are mostly mechanical API glue.
Core runtime is ~25K lines (22K Go core + 3K compiled tools).
KDE adds another ~15.7K. The interesting logic is concentrated.
2026-10-06 12:59:20 +02:00
Levi Neely 83f51dffef doc: add Phase 38 (streaming rdwr, event filtering) and size snapshot
- Document streaming rdwr pattern for filtered event subscriptions
- Add current size table (~59,600 SLOC total)
- Record removal of statewait, bypasswait, feed files
- Update timeline with explicit tool loading and event filters
2026-10-06 12:57:46 +02:00
Levi Neely a90ca6b57c remove unused feed file and observer agent support
The feed file was documented but never used by any frontend
or script. The observer agent pattern was never adopted.

- Remove feed.go, FeedWrite, ConsumeFeed
- Remove WatchFeed constant
- Remove feed file from 9P namespace
- Remove ConsumeFeed goroutine spawns from session
- Update docs (architecture-9p, architecture-ide, architecture, usage)

The event stream now covers real-time observation patterns better.
2026-10-06 12:55:39 +02:00
Levi Neely 88062d0ed0 server: remove redundant bypasswait file
Bypass requests are delivered via the event stream.
The bypasswait file was unused.
2026-10-06 12:47:57 +02:00
Levi Neely b6d6d9e41e doc: add event topics reference 2026-10-06 12:45:18 +02:00
Levi Neely 3b6c78d08d docs: state file is read-only 2026-10-06 12:44:37 +02:00
Levi Neely 86fbc90b43 server: remove statewait file, use event stream instead
The event stream with filtering replaces statewait:
- echo filter | rdwrs event

Removed:
- statewait file from agent namespace
- All non-historical references in docs and code

The state file remains for simple polling reads.
2026-10-06 12:44:02 +02:00
Levi Neely 7e7c29c900 docs: update to reflect event stream pattern over statewait
- AGENTS.md: simplified architecture description
- architecture-9p.md: examples use event stream with filtering
- usage.md: o tui and wiring examples use rdwrs event
2026-10-06 12:40:58 +02:00
Levi Neely 9d0b59671c o: use filtered event stream instead of statewait loop
Subscribe to agent-specific state events via streaming rdwr pattern.
No more polling loop - single filtered subscription.
2026-10-06 12:39:25 +02:00
Levi Neely 59f162a57e doc: document streaming rdwr pattern for filtered subscriptions 2026-10-06 12:35:10 +02:00
Levi Neely 772d77940c server: implement filtered event subscriptions
Event file now supports streaming rdwr pattern:
- Read: streams all events (unchanged)
- Write filter, then read: streams only matching events

Filter syntax:
- * matches single segment
- > matches rest of topic
- Examples: session.*.agent.*.state, session.abc.>

Usage: echo filter | rdwrs event

Per-fid subscription state is cleaned up on clunk.
2026-10-06 12:34:14 +02:00
Levi Neely 13831fb9f3 experiments: remove accidentally committed binary 2026-10-06 12:31:53 +02:00
Levi Neely 9a66944859 ollie-9p: add rdwrs command for streaming rdwr
rdwrs writes stdin then streams reads (does not wait for EOF).
Use for event subscription: echo filter | rdwrs event

Also adds prototype in experiments/streamrdwr demonstrating:
- Write topic filter, stream matching events
- Glob-style filtering: * (single segment), > (rest)
2026-10-06 12:31:06 +02:00
Levi Neely 6ea2bc052e server: add non-blocking state file separate from statewait
- state: immediate read of current agent state
- statewait: blocks until state changes

Clearer semantics than overloading statewait with both behaviors.
2026-10-06 12:17:19 +02:00
Levi Neely 021436bfbf gui: remove per-agent statewait stream, use server event bus
The server event stream already delivers state change events for all
agents. Removed the redundant per-agent statewait streamer - now agent
switching has no teardown/startup overhead for state monitoring.

- Removed m_state streamer entirely
- State updates come via event stream's session.{sid}.agent.{aid}.state events
- Only chat stream needs per-agent setup/teardown
2026-10-06 12:11:14 +02:00
Levi Neely f86c8d3cdc docs: update all references from eventwait to event 2026-10-06 12:08:35 +02:00
Levi Neely 25d7fbfc5b server: rename eventwait to event 2026-10-06 12:02:37 +02:00
Levi Neely adb08fc51d server: fix eventwait to use Stream instead of BlockOnce
EventValue was storing only the latest event and using hash comparison,
which caused events to be overwritten if they arrived faster than the
client could read them.

Now eventwait uses Stream mode with EventStream which delivers each
event as it arrives. Events won't be lost due to rapid arrival.
2026-10-06 12:01:26 +02:00
Levi Neely 70c00541df gui: poll bypass file on session switch
Events can be missed if GUI wasn't connected when they were published.
Now checkPendingBypass() reads the bypass file directly when switching
agents/sessions to catch any pending requests.
2026-10-06 11:51:27 +02:00
Levi Neely f2f1f80e4e gui: integrate bypass requests into chat UI
Server changes:
- Session tracks pending bypass request and exposes methods
- New 9P files: session/{sid}/bypass (read/write), bypasswait (blocking)
- Publish bypass.request events for GUI listeners

GUI changes:
- Handle bypass.request events from eventwait
- Show inline amber banner with command and cwd
- Approve/Deny buttons resolve via 9P

Desktop notifications still work in parallel for non-GUI usage.
2026-10-06 11:44:15 +02:00
Levi Neely 79738a4a39 gui: reduce stopWorker wait from 200ms to 10ms
The fid close should immediately unblock reads. Don't wait long.
2026-10-06 11:38:28 +02:00
Levi Neely 65014395b7 gui: fix slow agent switching by closing fid on stop
When switching agents, the old state/chat streams would block until
data arrived (up to 500ms for statewait, indefinitely for chat).

Now requestStop() closes the fid from the calling thread, which
unblocks the worker's blocking read immediately. This makes agent
switching instant instead of waiting for the read timeout.
2026-10-06 11:36:30 +02:00
Levi Neely 0c30ec71d2 server: reduce statewait timeout from 5s to 500ms
When reading statewait with the same state value, the server now waits
500ms instead of 5 seconds before returning. This makes state polling
much more responsive.
2026-10-06 11:32:31 +02:00
Levi Neely 3655b16b4b gui: fix QThread crash in Lib9pStreamer::onWorkerFinished
QThread::~QThread() aborts if the thread is still running. The previous
code called delete unconditionally after a 100ms wait timeout. Now we
follow the same pattern as stopWorker(): check if wait() succeeded,
and if not, abandon the thread safely via deleteLater.
2026-10-06 11:29:26 +02:00
Levi Neely 3838078394 gui: fix compact button to send /compact command 2026-10-06 11:24:05 +02:00
Levi Neely 1dcc9638df gui: replace NativeStreamer with Lib9pStreamer
Switch streaming reads (chat, state, events) from subprocess-based
ollie-9p to native lib9p via worker threads. This eliminates:
- Process spawn/teardown overhead
- Subprocess failure modes
- Signal handling complexity

Lib9pStreamer uses QThread workers with blocking reads. On stop,
workers are given 200ms to exit cleanly, then abandoned (they'll
exit when the read completes or connection closes).

Also: make KRunner/Kate/KIO plugins optional in CMakeLists.txt
to fix build when KF6Runner etc aren't installed. Added
QT_DEFAULT_MAJOR_VERSION=6 to fix Qt6 detection with CMake 4.x.
2026-10-06 11:16:53 +02:00
Levi Neely c9c26d3a3d fix bypass+background hang: signal started immediately
Background procs with bypass were hanging because the caller blocked on
<-startedCh waiting for the process to start, but bypass.Submit blocks
until approval. Now we signal started immediately when entering bypass
path (with Process: nil), so the agent sees the proc ID right away.

Also handle term/kill when proc.proc is nil — cancel the context to stop
the operation (e.g., abort a pending bypass request).
2026-10-06 11:00:23 +02:00
Levi Neely 7ac1b6faf5 fix bypass+background: wire streamOut through bypass path
executeBypassDirect was missing the streamOut parameter, so background
processes running via bypass never had their output written to the proc
buffer. Now both bypass and sandboxed paths receive the streaming writer.
2026-10-06 10:53:06 +02:00
Levi Neely cd76864f19 fix agent profile selection from GUI
Two bugs:
1. GUI sends 'agent=<profile>' but server only recognized 'profile='
   - Added 'agent' as alias for 'profile' in parseAgentNewRequest

2. Model dropdown showed cost columns appended to model names
   - /models format: backend<tab>model[<tab>in<tab>out...]
   - Parser took everything after first tab as model name
   - Now stops at second tab to extract just the model name
2026-10-06 10:42:35 +02:00
Levi Neely 65e26f4a69 codeintel: fix codebase_overview to accept string or int for offset/limit
LLMs sometimes send integer parameters as strings (e.g. "20" instead of 20).
Add flexInt type that unmarshals from either JSON int or string.
2026-10-02 09:32:36 +02:00
Levi Neely f85612a4da session: pause all sessions on shutdown, fix agent config loading
Shutdown changes:
- Shutdown() now calls PauseAll() before closing sessions
- PauseAll() interrupts agents then pauses each session
- Sessions persist their state, allowing resume on next startup

Agent loading fix:
- LoadConfig returns (*AgentConfig, error) instead of *AgentConfig
- Parse errors are no longer silently discarded
- Callers handle nil config gracefully (no nil pointer dereferences)
2026-10-01 13:34:33 +02:00
Levi Neely c1888d31fe agent: increase tool result hard limit from 32KB to 128KB 2026-10-01 09:23:38 +02:00
Ollie Agent 3f9f4753ef session: make session/new get-or-create
CreateEmpty now returns (session, created, error): if a session with the
given name already exists it is returned untouched instead of erroring,
and only a freshly created session receives the provided cwd/workflow/
variant. The o script no longer suppresses errors from session/new, so
real failures surface while re-creating an existing session stays a
no-op success.
2026-09-29 23:01:44 +02:00
Ollie Agent 72239fe3d5 kde: remove KF5/Qt5 support, build KF6/Qt6 only
Drop the OLLIE_KF5 CMake option and the entire Qt5/KF5 build branch;
delete KF5-only assets (99-ollie-kf5.sh, ollie-actions-kf5.desktop);
collapse all QT_VERSION_MAJOR and KTEXTEDITOR_VERSION_MAJOR conditionals
to the KF6 path in the KRunner, Kate, KIO, and GUI sources; update
Makefile, README, and docs. Verified: KF6 configure + full build of
ollie-gui, krunner_ollie, ollie_kate, kio_ollie.
2026-09-29 16:44:12 +02:00
Levi Neely 50b02b7a1e sandbox: skip sockets and FIFOs in Landlock rules
Landlock cannot add rules for sockets (S_IFSOCK) or FIFOs (S_IFIFO).
Previously, attempting to add a path like /run/user/1000/wayland-0
would fail with EINVAL.

Now these special file types are detected and skipped gracefully.
2026-09-25 16:33:39 +02:00
Levi Neely f88b5fcc32 kiro: only set additionalModelRequestFields for supported models
The field is rejected by models that don't support thinking/reasoning
configuration. Check model name before setting the field; 'auto' and
unknown models skip it to avoid ValidationException errors.
2026-09-21 14:40:30 +02:00
Levi Neely 48bd852594 kde/gui: add Yes/No to templates menu 2026-09-21 14:20:07 +02:00
Ollie Agent 6b745aaad1 AGENTS.md: document experimental/unstable stability policy
Ollie is experimental and unstable; optimize for a clean minimal
codebase over preserving behavior. No backward-compatibility shims,
deprecation aliases, or legacy fallbacks — change things fully and
delete the old form. Standing preference, applied without asking, so
agent behavior doesn't need per-task course correction.
2026-09-07 13:56:55 +02:00
Ollie Agent 42cae9ee2e human-friendliness: self-describing ctl, structured errors, status, overview
Make the namespace explain itself instead of requiring prior knowledge.

- ctl is self-describing: reading it (empty write) or writing 'help'
  returns the valid verbs with one-line descriptions; an unknown verb
  errors with the valid list. Refactor dispatch to an ordered []ctlCmd
  carrying descriptions; drop the undocumented '.' alias and the
  drift-prone hardcoded help verb. Keep 'i' (drop 'inject') for fast
  injects. o's ctl usage now reads the live listing.
- Errors carry severity + remediation. backend.ClassifyError maps the
  typed errors to transient/config/fatal with a one-line fix; the error
  event renders [[[error:<severity>]]] and a 'remediation:' line so a
  human knows whether to wait or intervene.
- Add a human status file: 'thinking · 12s', 'calling shell · 3s',
  'idle' — distinct from the machine-facing raw state. Wire the TUI bar
  to it.
- Bare 'o' shows an overview of running sessions/agents with status, so
  you don't need to know any names to get oriented.

Tests: dispatch help/unknown/routing, ClassifyError severity table.
2026-09-07 13:55:45 +02:00
Ollie Agent f3933e21e7 backend: make reasoningEffort the primary knob with documented thresholds
reasoningEffort (low|medium|high) is now the single human-facing control
for model deliberation. Backends that speak a discrete level (OpenAI,
OpenRouter, Copilot, Gemini, Kiro) send it verbatim; Anthropic, which
needs a numeric budget, translates via documented thresholds
(low=4096, medium=8192, high=16384). thinkingBudget remains an advanced
explicit override that wins when set.

- Add EffortLow/Medium/High, threshold consts, ValidReasoningEffort,
  EffortThinkingBudget, and GenerationParams.ResolvedThinkingBudget.
- Anthropic: derive budget from effort, grow max_tokens above the budget
  (Anthropic requires budget < max_tokens), and force temperature=1 when
  thinking is enabled (both are Anthropic requirements).
- Validate reasoningEffort at config load so typos fail loudly instead
  of silently no-opping.
- theo: drop explicit thinkingBudget/inflated maxTokens; reasoningEffort
  high now implies the 16384 budget.
- Document thresholds and per-backend behavior in data/agents/README.md;
  fix stale autoLoad/maxSteps references.
- Add unit tests for the mapping and Anthropic thinking behavior.
2026-09-07 13:34:58 +02:00