From 6cf283044ed5de717f1f2ebc421e56b6458dc4f0 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 9 Oct 2026 19:16:20 +0200 Subject: [PATCH] docs: add chat file to namespace documentation - AGENTS.md: four views (log.raw, log, chat, block) - system_prompt.md: add chat to agent file table - architecture-9p.md: add chat to namespace table - evolution.md: correct Phase 40 (chat not deleted) --- AGENTS.md | 7 ++++--- cmd/olliesrv/internal/prompts/system_prompt.md | 3 ++- doc/architecture-9p.md | 3 ++- doc/evolution.md | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5748438..e0d8a0b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -121,9 +121,10 @@ This is a standing preference, not a per-task instruction. Apply it without aski 11. **Peers**: Persistent agents in the same session can be linked via `peeradd`. Links are bidirectional. Agents communicate by writing to `peer/{name}`, which delivers to the target's prompt handler. Only declared peers can be messaged — the `peer/` directory is the access control surface. 12. **9P namespace declaration**: `cmd/olliesrv/internal/fs/spec.go` declares the olliesrv namespace. The toolsrv namespace is declared by `cmd/toolsrv/p9.go` using `cmd/toolsrv/internal/server.Spec`; process state and handlers are in `cmd/toolsrv/internal/server/`. Both use the `virtfs` EDSL and `virtfs.BuildTree()`. 13. **Working directory (default + override)**: Session cwd is **required** at session creation and is the inheritance root for every agent — the sane default so many agents can work in one directory with zero per-agent config. Agent cwd is an **optional** per-agent override (empty = inherit the session cwd). Because the per-session `toolsrv` sets `cmd.Dir` per tool call, per-agent cwd needs no extra process: `toolsrv` keeps an in-memory `agentCWD` map resolved per call from the `agent=` field (`cmd/toolsrv/internal/server/proc.go`), falling back to the session-level global cwd. The override is set only over the controlled `olliesrv`→`toolsrv` ctl channel (`agentcwd `), never embedded in a tool-call payload, so the model cannot influence where its own tools run. The map is process-local, so `Agent.SyncCwdToToolServer` re-pushes the override on every (re)connect — profile switch, resume, restore — matching how env and tools are resynced. Set/clear via the agent `cfg` (`cwd=...`) or ctl (`cwd [|-]`); the GUI Agent Settings dialog shows `(inherit: )` as the placeholder. -14. **Chat log files**: Each agent exposes three views of its conversation history via the 9P namespace: - - `log.raw` — JSONL stream (one JSON object per line). Blocking; suitable for live tailing. Each line is `{"role":"...","id":"...","content":"..."}` with optional `name`, `format`, and `partial` fields. Partial blocks (`"partial":true`) represent in-progress streaming; they are replaced by the final block when complete. - - `log` — Rendered text (last 64KB). Non-blocking; suitable for one-shot inspection. Filters out reasoning, call, and tool blocks; shows only user/assistant/context content. +14. **Chat log files**: Each agent exposes four views of its conversation history via the 9P namespace: + - `log.raw` — JSONL stream (one JSON object per line). Blocking; suitable for GUI live tailing. Each line is `{"role":"...","id":"...","content":"..."}` with optional `name`, `format`, and `partial` fields. Partial blocks (`"partial":true`) represent in-progress streaming; they are replaced by the final block when complete. + - `log` — Rendered text snapshot (last 64KB). Non-blocking; suitable for one-shot inspection. Filters out reasoning, call, and tool blocks; shows only user/assistant/context content. + - `chat` — Rendered text stream. Blocking; suitable for TUI live tailing. Same filtering as `log`. - `block` — Rdwr lookup: write a block ID (8-char hex), read the matching block as JSON. Returns the full block object or an error if not found. Block IDs are 8-char hex strings generated deterministically from `sha256(sessionID + agentID + counter)`. diff --git a/cmd/olliesrv/internal/prompts/system_prompt.md b/cmd/olliesrv/internal/prompts/system_prompt.md index f2f50d4..5334156 100644 --- a/cmd/olliesrv/internal/prompts/system_prompt.md +++ b/cmd/olliesrv/internal/prompts/system_prompt.md @@ -205,8 +205,9 @@ Use `client_9p` for all 9P operations. Your session ID is `${OLLIE_SESSION_ID}`. | `plan` | r/w | Markdown checklist; survives compaction | | `prompt` | write | Submit a prompt to this agent | | `fifo` | r/w | Prompt queue. Write: enqueue. Read: dequeue. | -| `log` | read | Conversation (filtered text, last 64KB) | +| `log` | read | Conversation snapshot (filtered text, last 64KB) | | `log.raw` | read | Full conversation as JSONL stream | +| `chat` | read | Conversation stream (filtered text, blocking) | | `block` | rdwr | Lookup block by ID (write ID, read JSON) | | `state` | read | Current agent state (idle, calling, thinking, paused) | | `cfg` | r/w | Agent config (key=value: backend, model, cwd, temperature, etc.) | diff --git a/doc/architecture-9p.md b/doc/architecture-9p.md index 30740d4..efe1100 100644 --- a/doc/architecture-9p.md +++ b/doc/architecture-9p.md @@ -87,8 +87,9 @@ echo "name=coding cwd=$PWD" | ollie-9p write session/myproj/agent/new | `agent/idx` | r | Agent index: `session-id\tagent-id\tagent-name\tparent-id\tdepth\tstate`. | | `agent/{aname}/prompt` | w | Queue a user turn. | | `agent/{aname}/fifo` | r/w | Prompt queue. | -| `agent/{aname}/log` | r | Filtered text conversation (last 64KB). | +| `agent/{aname}/log` | r | Filtered text conversation snapshot (last 64KB). | | `agent/{aname}/log.raw` | r | Full JSONL streaming output. | +| `agent/{aname}/chat` | r | Filtered text conversation stream (blocking). | | `agent/{aname}/block` | rdwr | Lookup block by ID (write ID, read JSON). | | `agent/{aname}/state` | r | Current agent state (idle, calling, thinking, paused). | | `agent/{aname}/plan` | r/w | Persistent planning scratch space. | diff --git a/doc/evolution.md b/doc/evolution.md index 5005859..cb64d28 100644 --- a/doc/evolution.md +++ b/doc/evolution.md @@ -2297,11 +2297,12 @@ Each line is a complete JSON object with: **agent/chatlog.go**: Event handler emits JSONL blocks via `flushPartial` (partial=true per chunk) and `closeBlock` (partial=false final). Skips internal events: `state`, `usage`, `limitretry`. **fs/spec.go**: New 9P files: -- `log.raw` — JSONL stream (blocking, suitable for live tailing) -- `log` — Rendered text (non-blocking, last 64KB) +- `log.raw` — JSONL stream (blocking, for GUI) +- `log` — Rendered text snapshot (non-blocking, last 64KB) +- `chat` — Rendered text stream (blocking, for TUI) - `block` — Rdwr lookup: write block ID, read JSON -Deleted: `chat`, `chat.raw`, `chat.search` +Deleted: `chat.raw`, `chat.search` ### GUI changes