From b432ba987cd063828b71c5ca538f80bbe23a9a2a Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 24 Apr 2026 07:42:58 +0200 Subject: [PATCH] server: update mode mappings for spec; drop removed session files spec is 0666; offset/statewait/systemprompt/models/ctxsz/usage are 0444 explicitly. Remove mode cases for state, backend, model, agent, cwd, params, cwdwait, usagewait, ctxszwait. Update README. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 25 ++++++++++++------------- server.go | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 787e118..87ca311 100644 --- a/README.md +++ b/README.md @@ -44,25 +44,24 @@ ollie/ Interactive session directories (multi-turn, idle<=>running): / rm -r to kill; mv to rename - agent r/w: active agent name - backend r/w: active backend name + spec r/w: KV snapshot of config and current state; write partial KV to mutate + read fields: state, backend, model, agent, cwd, usage, ctxsz, offset, + maxTokens, temperature, frequencyPenalty, presencePenalty + writable fields: backend, model, agent, cwd, maxTokens, temperature, + frequencyPenalty, presencePenalty + (state, usage, ctxsz, offset are read-only; silently ignored on write) chat read: cumulative conversation history ctl write: stop | - ctxsz read: estimated context size vs context window - ctxszwait read: blocks until ctxsz changes; returns new value - cwd r/w: working directory for tool execution - cwdwait read: blocks until cwd changes; returns new value fifo.in write: queue a prompt for later execution fifo.out read: pop the next queued prompt - model r/w: active model name - models read: available models from the backend - params r/w: generation parameters (maxTokens, temperature, etc.) + offset read: byte offset in chat immediately after the last user prompt prompt write: submit a prompt to the agent - state read: current agent state (idle, thinking, calling: ) - statewait read: blocks until state changes; returns new value - systemprompt read: fully rendered system prompt for this session + statewait read: blocks until state changes; returns new state usage read: token counts (input, output, requests; [estimated] if not reported by backend) - usagewait read: blocks until usage changes; returns new value + ctxsz read: estimated context size vs context window + models read: available models from the backend + systemprompt read: fully rendered system prompt for this session + tail exec: exec tail -f chat Batch job directories (one-and-done: running => done | failed): / rm -r to cancel and remove diff --git a/server.go b/server.go index fff6842..e6d3dac 100644 --- a/server.go +++ b/server.go @@ -1362,9 +1362,9 @@ func (s *Server) makeStat(path string) plan9.Dir { switch base { case "ctl", "prompt", "fifo.in": mode = 0200 - case "chat", "state", "usage", "ctxsz", "models", "fifo.out": + case "chat", "usage", "ctxsz", "models", "fifo.out", "offset", "statewait", "systemprompt": mode = 0444 - case "backend", "agent", "model", "cwd": + case "spec": mode = 0666 case "tail": mode = 0555