mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Update memory plugin documentation for v0.0.9 changes
This commit is contained in:
1 parent
7ee5bd3e68
commit
f8ba586364
2 files changed
+25
-8
No files matched your search
+20
-3
@@ -358,8 +358,11 @@ Create a new Code session and send an implementation plan as the first prompt. D
|
||||
|-----------|------|----------|-------------|
|
||||
| `plan` | string | Yes | The full implementation plan to send to the Code agent |
|
||||
| `title` | string | Yes | Short title for the session (shown in session list, max 60 chars) |
|
||||
| `objective` | string | No | Short description of what we're building |
|
||||
| `phases` | array | No | Phase list from the plan: `[{title, status, notes?}]` |
|
||||
| `findings` | array | No | Key architectural decisions discovered during research |
|
||||
|
||||
Creates a new session via the OpenCode API, then sends the plan as the first message to the Code agent. Returns the session ID and title. Only the Architect agent has access to this tool — it is excluded from Code and Memory agents.
|
||||
Saves planning state (objective, phases, findings) for the Architect session, creates a new session via the OpenCode API, then sends the plan as the first message to the Code agent. Returns the session ID and title. Only the Architect agent has access to this tool — it is excluded from Code and Memory agents.
|
||||
|
||||
---
|
||||
|
||||
@@ -397,7 +400,9 @@ The Code agent's system prompt instructs it to:
|
||||
- Check for duplicates with `memory-read` before writing new memories
|
||||
- Update stale memories with `memory-edit` rather than creating duplicates
|
||||
|
||||
The Code agent does not have access to `memory-plan-execute` — only the Architect agent can create implementation sessions.
|
||||
Code and Architect agents do not have direct access to `memory-planning-update` or `memory-planning-search` — these tools are exclusive to the Memory subagent. To update planning state or search across sessions, the Code agent delegates to @Memory via the Task tool.
|
||||
|
||||
The Code agent does not have access to `memory-plan-execute`, `memory-planning-update`, or `memory-planning-search`. It delegates planning operations to the @Memory subagent and can only read its own session's planning state via `memory-planning-get`.
|
||||
|
||||
### Memory Agent (subagent)
|
||||
|
||||
@@ -413,6 +418,7 @@ The Memory agent handles:
|
||||
- Curation: merging duplicates, archiving outdated entries
|
||||
- Planning state management after compaction events
|
||||
- Post-compaction knowledge extraction (invoked automatically via SubtaskPart)
|
||||
- Planning state management: updating phase progress, searching plans across sessions (exclusive access to `memory-planning-update` and `memory-planning-search`)
|
||||
|
||||
The Memory agent receives planning state directly in its subtask prompt — it does NOT call `memory-planning-get`. This eliminates an extra LLM round-trip and makes extraction deterministic.
|
||||
|
||||
@@ -431,12 +437,14 @@ The Architect agent follows a Research → Design → Plan → Execute workflow:
|
||||
1. **Research** — Reads relevant files, searches the codebase, checks memory for conventions and decisions
|
||||
2. **Design** — Considers approaches, weighs tradeoffs, asks clarifying questions
|
||||
3. **Plan** — Presents a structured plan with objectives, phases, decisions, conventions, and key context
|
||||
4. **Execute** — When the user approves, first calls `memory-planning-update` to save the planning state (objective, phases, findings), then calls `memory-plan-execute` to create a new Code session with the full plan
|
||||
4. **Execute** — When the user approves, calls `memory-plan-execute` with the plan, objective, phases, and findings. Planning state is saved automatically before the plan is dispatched to the Code agent.
|
||||
|
||||
The Architect is the only agent with access to the `memory-plan-execute` tool. Plans must be fully self-contained since the Code agent receiving them has no access to the Architect's conversation.
|
||||
|
||||
When `memory-plan-execute` runs, it automatically appends a planning instruction to the plan telling the Code agent to update the Architect session's planning state as it progresses through phases. It also updates the Architect session's planning state to reflect that the plan has been dispatched.
|
||||
|
||||
The Architect agent does not have direct access to `memory-planning-update` or `memory-planning-search`. It delegates broad memory research to the @Memory subagent and reads its own session's planning state via `memory-planning-get`.
|
||||
|
||||
### Built-in Agent Enhancements
|
||||
|
||||
The plugin also modifies built-in OpenCode agents:
|
||||
@@ -491,6 +499,15 @@ The core compaction hook that fires when a session is about to be compacted. It
|
||||
|
||||
7. **Diagnostics** — Appends a summary line showing how many planning phases, conventions, decisions, and tokens were injected
|
||||
|
||||
### experimental.chat.messages.transform
|
||||
|
||||
Injects a read-only enforcement reminder into user messages when the Architect agent is active:
|
||||
|
||||
1. Scans messages to find the last user message
|
||||
2. If the message is addressed to the Architect agent, appends a synthetic `<system-reminder>` part
|
||||
3. The reminder instructs the agent that plan mode is active and it must not make file edits or run non-readonly tools
|
||||
4. This provides message-level enforcement on top of the agent's `edit: { '*': 'deny' }` permission config
|
||||
|
||||
---
|
||||
|
||||
## Data Lifecycle
|
||||
|
||||
@@ -24,7 +24,7 @@ Memory management plugin for OpenCode that enables semantic search and persisten
|
||||
| `memory-health` | Health check or full reindex of the memory store |
|
||||
| `memory-planning-update` | Update session planning state (phases, objectives, progress) |
|
||||
| `memory-planning-get` | Get the current planning state for a session |
|
||||
| `memory-plan-execute` | Create a new Code session and send an approved plan as the first prompt |
|
||||
| `memory-plan-execute` | Create a new Code session, save planning state, and send an approved plan as the first prompt |
|
||||
|
||||
Planning state differs from memories: it stores temporary session data (objectives, phase progress, findings, errors) with a 7-day TTL, while memories are persisted indefinitely and retrieved via semantic search.
|
||||
|
||||
@@ -34,11 +34,11 @@ The plugin bundles three agents that integrate with the memory system:
|
||||
|
||||
| Agent | ID | Mode | Description |
|
||||
|-------|----|------|-------------|
|
||||
| **Code** | `ocm-code` | primary | Primary coding agent with memory awareness. Checks memory before unfamiliar code, stores architectural decisions and conventions as it works. |
|
||||
| **Architect** | `ocm-architect` | primary | Read-only planning agent. Researches the codebase, checks memory for conventions and decisions, designs implementation plans, then hands off to Code via `memory-plan-execute`. |
|
||||
| **Memory** | `ocm-memory` | subagent | Expert agent for storing, retrieving, and curating project knowledge. Handles post-compaction memory extraction and contradiction resolution. |
|
||||
| **Code** | `ocm-code` | primary | Primary coding agent with memory awareness. Checks memory before unfamiliar code, stores architectural decisions and conventions as it works. Delegates planning operations to @Memory subagent. |
|
||||
| **Architect** | `ocm-architect` | primary | Read-only planning agent. Researches the codebase, delegates to @Memory for broad knowledge retrieval, designs implementation plans, then hands off to Code via `memory-plan-execute`. |
|
||||
| **Memory** | `ocm-memory` | subagent | Expert agent for managing project memory and planning state. Handles post-compaction memory extraction, contradiction resolution, planning state updates, and cross-session plan searches. |
|
||||
|
||||
The Architect agent operates in read-only mode (`temperature: 0.0`, all edits denied). After the user approves a plan, it calls `memory-plan-execute` to create a new Code session with the full plan as context.
|
||||
The Architect agent operates in read-only mode (`temperature: 0.0`, all edits denied) with additional message-level read-only enforcement via the `experimental.chat.messages.transform` hook. After the user approves a plan, it calls `memory-plan-execute` which saves planning state and creates a new Code session with the full plan as context. Code and Architect agents delegate `memory-planning-update` and `memory-planning-search` to the Memory subagent.
|
||||
|
||||
## CLI
|
||||
|
||||
|
||||
Reference in new issue
Block a user