diff --git a/9p b/9p index dfd7dc2..bd3dec3 160000 --- a/9p +++ b/9p @@ -1 +1 @@ -Subproject commit dfd7dc2ef36e9f84c1fe92253e60021f827a2270 +Subproject commit bd3dec3696c0be130f54be1ad2d918cd47078329 diff --git a/core b/core index ee82ac7..74a6715 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit ee82ac7181fc57fc1fad72b751cea1b8bc88341a +Subproject commit 74a6715cd7dfe11aec99665e3f8e59d3c471d58d diff --git a/doc/ARCHITECTURE.md b/doc/ARCHITECTURE.md index 3faf2bf..7374383 100644 --- a/doc/ARCHITECTURE.md +++ b/doc/ARCHITECTURE.md @@ -38,7 +38,7 @@ Consumers extend ollie by implementing or composing its interfaces: - **`backend.Backend`** — swap or add LLM backends - **`tools.Server`** — add a new tool server (built-in or MCP-backed); all servers are equal - **`tools.Dispatcher`** — replace the tool router entirely (e.g. remote dispatcher, mock) -- **`agent.Core`** — the agent's public API; frontends drive it without knowing internals +- **`agent.Core`** — the agent's public API; frontends drive it without knowing internals. Includes `Close()` to release session resources (tmpdir under `/tmp/ollie/`). All tool servers implement the same `tools.Server` interface regardless of whether they are built-in or backed by MCP. There is no special "builtin" concept — `execute.Server` and `file.Server` are registered by name the same way MCP servers are, and are torn down and recreated on `/agent` switches just like MCP connections. @@ -139,6 +139,12 @@ core := agent.NewAgentCore(agent.AgentCoreConfig{ `Core.ListServers()` returns all registered tool servers and their tools, grouped by server name. Accessible via the `/mcp` command or `ollie/s/{sid}/mcp` in ollie-9p. +## Session Lifecycle + +`NewAgentCore` creates `/tmp/ollie/{sessionID}` when a session starts. `Core.Close()` removes it recursively. Callers (e.g. olliesrv's `killSession`) must call `Close()` when tearing down a session. `SetSessionID` renames the tmpdir atomically alongside the persisted session files. + +`!` shell commands run in the session's current working directory (`Core.CWD()`), not the process working directory. + ## Session and Context `agent.Session` owns the message history. A `contextBuilder` enforces a rolling window to prevent unbounded prompt growth. When the window fills, older messages are either evicted (with a compaction notice injected) or proactively summarized via `/compact`. diff --git a/doc/help.md b/doc/help.md index 7e6b466..0c6ffcc 100644 --- a/doc/help.md +++ b/doc/help.md @@ -38,6 +38,7 @@ ollie/ prompt submit prompt (w) reply last reply (ro) state agent state (ro) idle | thinking | calling: + systemprompt rendered system prompt (ro) usage token counts (ro) cwd working directory (r/w) sk/ skills (r/w) ls, cat, edit diff --git a/tui b/tui index 19bbfac..88c4017 160000 --- a/tui +++ b/tui @@ -1 +1 @@ -Subproject commit 19bbfac1dcb67f3715662aa644b3254eaf4cb321 +Subproject commit 88c401718a6a4d04103d334632597b73b658df2c