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)
This commit is contained in:
parent
7867094c41
commit
6cf283044e
|
|
@ -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.
|
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()`.
|
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 <id> <dir>`), 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 [<dir>|-]`); the GUI Agent Settings dialog shows `(inherit: <sessionCwd>)` as the placeholder.
|
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 <id> <dir>`), 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 [<dir>|-]`); the GUI Agent Settings dialog shows `(inherit: <sessionCwd>)` as the placeholder.
|
||||||
14. **Chat log files**: Each agent exposes three views of its conversation history via the 9P namespace:
|
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 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.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 (last 64KB). Non-blocking; suitable for one-shot inspection. Filters out reasoning, call, and tool blocks; shows only user/assistant/context content.
|
- `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` — 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)`.
|
Block IDs are 8-char hex strings generated deterministically from `sha256(sessionID + agentID + counter)`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 |
|
| `plan` | r/w | Markdown checklist; survives compaction |
|
||||||
| `prompt` | write | Submit a prompt to this agent |
|
| `prompt` | write | Submit a prompt to this agent |
|
||||||
| `fifo` | r/w | Prompt queue. Write: enqueue. Read: dequeue. |
|
| `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 |
|
| `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) |
|
| `block` | rdwr | Lookup block by ID (write ID, read JSON) |
|
||||||
| `state` | read | Current agent state (idle, calling, thinking, paused) |
|
| `state` | read | Current agent state (idle, calling, thinking, paused) |
|
||||||
| `cfg` | r/w | Agent config (key=value: backend, model, cwd, temperature, etc.) |
|
| `cfg` | r/w | Agent config (key=value: backend, model, cwd, temperature, etc.) |
|
||||||
|
|
|
||||||
|
|
@ -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/idx` | r | Agent index: `session-id\tagent-id\tagent-name\tparent-id\tdepth\tstate`. |
|
||||||
| `agent/{aname}/prompt` | w | Queue a user turn. |
|
| `agent/{aname}/prompt` | w | Queue a user turn. |
|
||||||
| `agent/{aname}/fifo` | r/w | Prompt queue. |
|
| `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}/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}/block` | rdwr | Lookup block by ID (write ID, read JSON). |
|
||||||
| `agent/{aname}/state` | r | Current agent state (idle, calling, thinking, paused). |
|
| `agent/{aname}/state` | r | Current agent state (idle, calling, thinking, paused). |
|
||||||
| `agent/{aname}/plan` | r/w | Persistent planning scratch space. |
|
| `agent/{aname}/plan` | r/w | Persistent planning scratch space. |
|
||||||
|
|
|
||||||
|
|
@ -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`.
|
**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:
|
**fs/spec.go**: New 9P files:
|
||||||
- `log.raw` — JSONL stream (blocking, suitable for live tailing)
|
- `log.raw` — JSONL stream (blocking, for GUI)
|
||||||
- `log` — Rendered text (non-blocking, last 64KB)
|
- `log` — Rendered text snapshot (non-blocking, last 64KB)
|
||||||
|
- `chat` — Rendered text stream (blocking, for TUI)
|
||||||
- `block` — Rdwr lookup: write block ID, read JSON
|
- `block` — Rdwr lookup: write block ID, read JSON
|
||||||
|
|
||||||
Deleted: `chat`, `chat.raw`, `chat.search`
|
Deleted: `chat.raw`, `chat.search`
|
||||||
|
|
||||||
### GUI changes
|
### GUI changes
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue