This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Levi Neely 19fac99a3d Add model r/w endpoint to session
Exposes the active model name as a readable/writable file. Initialized
from be.Model() at session creation. Writes submit "/model <name>" via
the agent core and update modelName optimistically, rolling back on an
error event.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 01:49:20 +02:00
internal/p9 Add model r/w endpoint to session 2026-04-10 01:49:20 +02:00
LICENSE Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
README.md Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
go.mod Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
go.sum Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
main.go Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
mkfile Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00

README.md

olliesrv

A 9P server that exposes ollie agent sessions as a virtual filesystem. Mount it with 9pfuse and interact with AI sessions using ordinary shell tools.

Filesystem layout

ollie/
  ctl                   write: "new [backend] [agent]" | "kill <session-id>"
  <session-id>/
    prompt              write: submit a prompt to the agent
    chat                read:  cumulative conversation history
    state               read:  current agent state (idle, thinking, calling: <tool>)
    ctl                 write: stop | interrupt | /<slash-command>
    backend             r/w:   active backend name
    agent               r/w:   active agent name

Building

mk

Installs olliesrv to $HOME/bin.

Usage

olliesrv start       # start daemon (backgrounds itself)
olliesrv fgstart     # start in foreground
olliesrv stop        # stop daemon
olliesrv status      # check if running

The server listens on a Unix socket in the Plan 9 namespace ($NAMESPACE/ollie) and optionally mounts via 9pfuse to $HOME/mnt/ollie (or $OLLIE_9MOUNT).

Sessions

Create a session

echo new > ~/mnt/ollie/ctl                    # default backend and agent
echo "new ollama" > ~/mnt/ollie/ctl           # specific backend
echo "new ollama myagent" > ~/mnt/ollie/ctl   # specific backend and agent

A new session directory appears under the mount point named by timestamp + random suffix (e.g. 20260410-014002-ba70fc).

Send a prompt

echo "what files are in the current directory?" > ~/mnt/ollie/<session-id>/prompt

Writes dispatch asynchronously on close, so the shell returns immediately. The agent runs in the background.

Read the conversation

cat ~/mnt/ollie/<session-id>/chat             # full history snapshot
tail -f ~/mnt/ollie/<session-id>/chat         # follow output as it arrives

The chat file is an append-only log of the full conversation. Format:

user: <prompt>
assistant: <response>
-> <tool>(<args>)
= <result>

Check agent state

cat ~/mnt/ollie/<session-id>/state
# idle | thinking | calling: <toolname>

Control a session

echo stop > ~/mnt/ollie/<session-id>/ctl          # interrupt the current turn
echo /compact > ~/mnt/ollie/<session-id>/ctl      # summarize context
echo /clear > ~/mnt/ollie/<session-id>/ctl        # clear session history
echo /model qwen3:8b > ~/mnt/ollie/<session-id>/ctl

ctl accepts stop/interrupt or any /slash-command supported by the agent. Arbitrary text is rejected.

Switch backend or agent

echo ollama > ~/mnt/ollie/<session-id>/backend
echo myagent > ~/mnt/ollie/<session-id>/agent

Kill a session

echo "kill <session-id>" > ~/mnt/ollie/ctl

Example shell session

$ echo new > ~/mnt/ollie/ctl
$ ls ~/mnt/ollie/
20260410-014002-ba70fc  ctl
$ sid=20260410-014002-ba70fc
$ tail -f ~/mnt/ollie/$sid/chat &
$ echo "list the go files in /home/lkn/src/ollie" > ~/mnt/ollie/$sid/prompt
user: list the go files in /home/lkn/src/ollie
assistant: -> execute_code({"code":"find /home/lkn/src/ollie -name '*.go'","language":"bash"})
= pkg/agent/core.go
pkg/agent/loop.go
...
assistant: The Go source files are: core.go, loop.go, ...
$ cat ~/mnt/ollie/$sid/state
idle