demote plan from session level to agent level

plan now lives at session/{id}/agent/{aid}/plan instead of
session/{id}/plan. Moved the Leaf declaration from fs/sessionfiles.go
to fs/agentfiles.go. Updated both prompt docs to match.
This commit is contained in:
Ollie Agent 2026-08-03 01:06:16 +02:00
parent c55615bf1b
commit bc4c27b602
4 changed files with 27 additions and 28 deletions

View File

@ -5,7 +5,7 @@ You are a coding agent.
- Before non-trivial tasks: inspect, plan, act, verify, update plan.
- Verify means: run the build, run affected tests. Not "looks right to me".
- Keep plans short, explicit, and task-focused.
- Use `${OLLIE}/session/${OLLIE_SESSION_ID}/plan` for multi-step work.
- Use `${OLLIE}/session/${OLLIE_SESSION_ID}/agent/${OLLIE_AGENT_NAME}/plan` for multi-step work.
- Update the plan after major progress, blockers, or changes in approach.
# Constraints

View File

@ -77,7 +77,6 @@ Sessions live at `session/`. Each session is a directory; all operations are 9P
| `models` | read | Available models for current backend |
| `offset` | read | Byte offset after last user prompt |
| `peer/` | dir | Peer links. `create` to add, `remove` to remove (both sides updated). Write to send prompt to peer. |
| `plan` | r/w | Session-scoped markdown checklist; survives compaction; visible to peers |
| `proc/` | dir | Detached background processes |
| `prompt` | write | Submit a prompt to the agent |
| `prompt.prev` | read | Previous prompt text |
@ -87,6 +86,14 @@ Sessions live at `session/`. Each session is a directory; all operations are 9P
| `tail` | exec | Tail helper |
| `usage` | read | Token usage stats |
### Agent Directory (`session/{id}/agent/{aid}/`)
Each agent in a session gets its own subdirectory with its own plan, state, and chat log.
| File | Mode | Purpose |
|---|---|---|
| `plan` | r/w | Markdown checklist; survives compaction; visible to peers |
## Operations
```bash

View File

@ -168,6 +168,24 @@ func listAgents(ctx HandlerCtx) ([]FsNodeDecl, error) {
return []byte(fmt.Sprintf("%d\n", al.ChatOffset)), nil
})),
// plan — agent plan (markdown checklist, survives compaction)
Leaf("plan", 0666,
Read(func(_ HandlerCtx) ([]byte, error) {
al.mu.RLock()
data := make([]byte, len(al.plan))
copy(data, al.plan)
al.mu.RUnlock()
return data, nil
}),
Write(func(_ HandlerCtx, data []byte) error {
al.mu.Lock()
al.plan = make([]byte, len(data))
copy(al.plan, data)
al.mu.Unlock()
return nil
}),
),
// cfg — agent config (backend, model, etc.)
Leaf("cfg", 0666,
Read(func(_ HandlerCtx) ([]byte, error) {

View File

@ -42,32 +42,6 @@ func listSessions(ctx HandlerCtx) ([]FsNodeDecl, error) {
}),
),
// plan — session plan
Leaf("plan", 0666,
Read(func(_ HandlerCtx) ([]byte, error) {
al := s.AgentLog()
if al == nil {
return nil, nil
}
al.mu.RLock()
data := make([]byte, len(al.plan))
copy(data, al.plan)
al.mu.RUnlock()
return data, nil
}),
Write(func(_ HandlerCtx, data []byte) error {
al := s.AgentLog()
if al == nil {
return nil
}
al.mu.Lock()
al.plan = make([]byte, len(data))
copy(al.plan, data)
al.mu.Unlock()
return nil
}),
),
// name — mutable session name
Leaf("name", 0666,
Read(func(_ HandlerCtx) ([]byte, error) {