Commit Graph

295 Commits

Author SHA1 Message Date
Levi Neely 8e4c1accaa readme: document root-level endpoints (complete, generate, route, ctl, agents) 2026-07-18 22:25:26 +02:00
Levi Neely 53df31fe7e readme: remove sales pitch, keep facts 2026-07-18 22:13:57 +02:00
Levi Neely 39d14eae16 9p: -tcp implies -nodbus for remote deployments 2026-07-18 21:42:52 +02:00
Levi Neely aeb933a3c2 9p: add -nodbus flag for headless/container deployments
When running on a remote server or in a container without a D-Bus
session bus, pass -nodbus to skip the adapter entirely. Pure 9P
still works.
2026-07-18 21:40:37 +02:00
Levi Neely f065429d24 9p: add embedded D-Bus protocol adapter
Expose org.ollie.SessionManager on the session bus directly from olliesrv.
The adapter emits StateChanged, ChatUpdated, SessionCreated, SessionKilled,
SessionRenamed, ProcessDetached, and ProcessExited signals. All KDE frontends
work without ollied.

Fixes:
- ListSessions: use Manager.List() instead of broken Readdir("")
- RenameSession: delegate to Manager.RenameSession()
- WatchExisting: start signal watchers for sessions restored at startup
- Introspection XML: declare all methods and signals
2026-07-18 21:36:07 +02:00
Levi Neely 6a9ea19abe 9p: /route output uses spaces, no newlines 2026-07-18 17:15:59 +02:00
Levi Neely d33fae7946 9p: fix readDNS to consume result on read (return EOF on second read)
Previous implementation returned data forever, causing cat to loop.
Now clears the buffer after first read so subsequent reads get EOF.
2026-07-18 17:14:44 +02:00
Levi Neely ece6c19fa6 9p: fix /net/dns read pattern — ignore offset for write-then-read
Shell fd position advances after write, so the subsequent read
arrives with offset=N (write length). readDNS always serves from
offset 0, fixing empty reads from exec 3<>file; echo >&3; cat <&3.
2026-07-18 17:13:01 +02:00
Levi Neely a01891621d 9p: rebuild with fixed route classifier 2026-07-18 17:05:48 +02:00
Levi Neely f1f7afafe1 9p: delegate /generate and /route to core backend package 2026-07-18 16:59:29 +02:00
Levi Neely 6d0be8295e remove tier routing: drop route/cascade/escalate tools and prompts
/route now uses LLM-based capability classification with
OLLIE_ROUTE_MODEL_FAST and OLLIE_ROUTE_MODEL_POWER env vars.
OLLIE_TIER_* env vars are no longer used.
2026-07-18 16:55:19 +02:00
Levi Neely 61d6b0da92 9p: /route uses LLM classification for task complexity
Write a task description to /route; a cheap local model (OLLIE_ROUTE_BACKEND/
OLLIE_ROUTE_MODEL, defaults to ollama/qwen3:8b) classifies it as worker or
expert. The resolved backend+model for that tier is returned on read.

Explicit tier still supported via JSON {"tier":"expert"} to skip classification.
2026-07-18 16:47:40 +02:00
Levi Neely 9fbdbbe642 9p: add /generate and /route files (net/dns pattern)
/generate: write a prompt (plain text or JSON with backend/model/system),
read back a one-shot LLM completion. Stateless, no session needed.

/route: write a tier name (worker/expert), read back the resolved
backend+model from OLLIE_TIER_* env vars.
2026-07-18 16:39:36 +02:00
Levi Neely 9d21601edf fix: session persistence across restart
Shutdown() was calling KillSession() which deleted the persisted
JSON files immediately after saveAllSessions() wrote them. Now
Shutdown() closes sessions directly without removing persistence
files, allowing restoreAllSessions() to find them on next start.
2026-07-18 16:28:12 +02:00
Levi Neely aa467e9b3c tools: explicit UTF-8 encoding for file_read, file_write, file_edit 2026-07-18 16:15:10 +02:00
Levi Neely d8e0b9b5ba 9p: add /complete file for stateless code completion
Follows the Plan 9 /net/dns pattern: per-fid request-response.
Write JSON request (or plain prefix), write blocks during LLM call,
read returns the completion result. Per-fid state means concurrent
clients get independent request/response pairs.

Also includes the Complete method, findOrCreateCopilot, and noise
stripping helpers in the session package.
2026-07-18 16:00:54 +02:00
Levi Neely 81ad172aa3 9p: add /agents file listing available agent configs 2026-07-18 15:27:05 +02:00
Levi Neely b13f42778a 9p: add session persistence across restarts
Sessions are saved to ~/.local/share/ollie/sessions/active-9p/ on
shutdown and restored on startup. Core auto-saves to SessionsDir
during turns. KillSession removes persisted files.

Closes the major feature gap with the D-Bus daemon.
2026-07-18 15:12:11 +02:00
Levi Neely 4ff3961dfd 9p: add proc/ directory for detached process inspection
- ls /s/{id}/proc/ lists detached PIDs
- cat /s/{id}/proc/{pid} reads ring buffer output
- rm /s/{id}/proc/{pid} dismisses the process
- echo detach > /s/{id}/ctl detaches running process
- echo "signal {pid} [TERM|KILL]" > /s/{id}/ctl signals detached process

Walk validates PID exists in detached list before succeeding.
2026-07-18 13:29:35 +02:00
Levi Neely 61240e02de 9p: add peer directory for bidirectional session communication
Implement /s/{id}/peer/ directory:
- touch /s/{id}/peer/{peer-id}: creates bidirectional peer link
- rm /s/{id}/peer/{peer-id}: removes bidirectional peer link
- ls /s/{id}/peer/: lists registered peers
- echo "prompt" > /s/{id}/peer/{peer-id}: submits prompt to peer

Peer management lives in the session Manager (core layer).
Walk validates peer existence before reporting file found.
Peer files have mode 0666 (writable).
2026-07-18 13:17:57 +02:00
Levi Neely 1db7fb9177 fix deadlock in CachedListModels: use dedicated modelsMu
content() holds sess.mu.RLock, then calls CachedListModels which
tried to acquire sess.mu.Lock for cache write — classic RLock/Lock
deadlock. Fix by giving the models cache its own mutex independent
of the session mu.
2026-07-18 12:54:38 +02:00
Levi Neely bb9b899e4e 9p: eliminate expensive API calls during readdir/stat
- Add CachedListModels() with 24h TTL to avoid repeated Models() API calls
- Cache readdir serialized bytes per-fid (rebuild only at offset=0)
- Skip all session file size computation in makeStat (report len=0)
- Short-circuit pathType() for session paths to avoid triggering Stat
- Remove e.Info() call from subdirectory readdir (unused mtime)
- Add monotonic timer to handle() for profiling 9p operations
- Add fcallTypeName() helper
- Fix stubCore for new Detach/SaveSession interface methods
- Add tools-process.md prompt

Before: ls inside a session dir took 1.38s (kiro) / 67ms (openrouter)
After: 182µs regardless of backend (7500x improvement)
2026-07-18 01:31:06 +02:00
Levi Neely 9ae36420ab strip 9P namespace to sessions only
Remove a/, p/, sk/, m/, tr/, tmp/, u/, x/, and per-session t/ from the
9P namespace. These are all files on disk that the runtime reads directly
from ~/.config/ollie/ — serving them through 9P added indirection without
value.

What remains:
- /s/ (live sessions: the dynamic state that doesn't exist on disk)
- /backends, /models, /help (synthetic root files)

This brings olliesrv's scope in line with the D-Bus daemon: session
lifecycle, prompt submission, state observation, and streaming output.
2026-07-17 23:08:29 +02:00
Levi Neely b49bbb099d docs: expand intro with Plan 9 motivation and design philosophy 2026-07-17 22:39:46 +02:00
Levi Neely b23e2ec2dd docs: add Remote Access section (9P mount, HTTP gateway, container) 2026-07-17 22:38:19 +02:00
Levi Neely d3d350efbb prompts: elevation requires proven failure first 2026-07-17 16:04:40 +02:00
Levi Neely b0f187aafb agent-copilot: aggressive no-questions format 2026-07-16 21:56:26 +02:00
Levi Neely aad89cddd9 agent-copilot: strict response format 2026-07-16 21:44:51 +02:00
Levi Neely c1b44f72d8 prompts: add agent-copilot.md 2026-07-16 21:42:01 +02:00
Levi Neely 2e4fdc38a2 prompts: clarify tools-elevate does NOT run as root 2026-07-16 21:08:04 +02:00
Levi Neely b82e4d857a prompts: add tools-image.md for image_read tool 2026-07-16 20:13:21 +02:00
Levi Neely 6c07c308e1 feat: implement 9P mount logic using core execute hooks
Created session/mount.go with all 9P FUSE mount logic previously in core.

Changes:
- New session/mount.go with MountPathFor(), WithMount9P(), and mount lifecycle functions
- WithMount9P() returns execute.Option that wires up OnEnvSet, OnPreDispatch, OnClose hooks
- Updated session.go to use WithMount9P() and MountPathFor() instead of execute.WithMount() and execute.MountPath()
- Mount logic encapsulated in mountState struct with proper synchronization

The mount implementation is now fully contained in the 9p module.
2026-07-08 15:55:23 +02:00
Levi Neely 9ab0fe58b7 add prompts, skills, tools (moved from monorepo root) 2026-07-07 12:07:35 +02:00
Levi Neely 542834b3e4 session: remove $OLLIE mount dependency
- Wire ReadPlanStep directly from sess.plan (no filesystem read)
- Add ListHandlers to ManagerConfig; passed through to AgentCoreConfig
- Hoist skillTree in main.go; populate ListHandlers for tools+skills
- Add ListHandlers to ManagerConfig
2026-06-16 12:30:42 +02:00
Levi Neely 32e8b4fc10 skip auto-mount when running with -tcp 2026-06-16 06:59:10 +02:00
Levi Neely 80c3f20609 add GNU Makefile mirroring mkfile 2026-06-16 06:50:55 +02:00
Levi Neely 23dd7fc490 remove FUSE mount responsibility from olliesrv 2026-06-15 13:31:10 +02:00
Levi Neely 921d46d2e5 Update main.go 2026-06-01 09:53:08 +02:00
ollie 60da0bbfde token efficiency: expose compactionModel in 9p cfg, fix test stubs
- Add compactionModel= to cfg read/write
- Add CompactionModel/SetCompactionModel stubs to test stubCore
- Fix NewSessionTree calls with missing invalidateModels arg
2026-05-28 18:44:57 +02:00
Levi Neely d8bd47c545 chat log: switch from line-prefix to [role] header block format 2026-05-25 23:15:02 +02:00
Levi Neely 200cb52e29 Add model cache with async prefetch and invalidate command
- Add ModelCache that prefetches models from all backends at startup
- Cache models in memory, refresh on demand via Invalidate()
- Add global /ctl file with 'invalidate' command
- Add 'invalidate' ctl command and /invalidate slash command in sessions
- Fix filePerm to query rootStore for root-level file permissions
- Add 'models' to root directory listing
2026-05-22 10:08:11 +02:00
Levi Neely 5d952633f8 add /models endpoint to root store 2026-05-21 18:49:38 +02:00
Levi Neely e7dd3987ef refactor session handling 2026-05-21 14:42:39 +02:00
Levi Neely 06a3e0f503 update session handling 2026-05-21 12:33:11 +02:00
Levi Neely 09e4f0f678 fs: centralized permission registry; FUSE mutating operations 2026-05-21 11:50:34 +02:00
Levi Neely e77c5a09f4 Format exec events with $ prefix instead of code blocks 2026-05-20 17:24:12 +02:00
Levi Neely e101db2079 session: format exec events with code fences 2026-05-20 16:49:44 +02:00
Levi Neely afb531c936 session: subscribe to event bus for chat log, drop handler from Submit
- NewSession subscribes to bus "event" topic for chat log writing
- Remove makePublish/handler threading from all Submit call sites
- Adapt tests to new bus-based event delivery
2026-05-20 16:45:37 +02:00
Levi Neely 518a31a1e2 mkfile: install ollie-9p-mount to $HOME/bin 2026-05-20 14:16:16 +02:00
Ollie 79313c2796 Deploy ollie-9p-mount to $HOME/.config/ollie/scripts/x 2026-05-20 13:59:55 +02:00