opencode-codex-memory 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/src/capture.js +4 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,8 +52,8 @@ anything.
|
|
|
52
52
|
immediately (codex ships the same system behind a default-off feature flag
|
|
53
53
|
with a consent prompt; a standalone memory plugin *is* the consent).
|
|
54
54
|
|
|
55
|
-
Requires
|
|
56
|
-
no `git` binary or any other external tool needed.
|
|
55
|
+
Requires opencode 1.18 or newer (official release). Git is bundled
|
|
56
|
+
(`isomorphic-git`) — no `git` binary or any other external tool needed.
|
|
57
57
|
|
|
58
58
|
The two restricted sub-agents that do the background learning (`memorize`,
|
|
59
59
|
`memorize-extract`) register themselves automatically while background learning
|
|
@@ -95,7 +95,7 @@ echo 'I prefer TypeScript strict mode and 2-space indentation.' \
|
|
|
95
95
|
|
|
96
96
|
```
|
|
97
97
|
~/.local/share/opencode/
|
|
98
|
-
├── memory.db # the plugin's own database (opencode's is only
|
|
98
|
+
├── memory.db # the plugin's own database (opencode's data is only accessed via its API)
|
|
99
99
|
└── memories/
|
|
100
100
|
├── memory_summary.md # compact summary injected into the system prompt
|
|
101
101
|
├── MEMORY.md # searchable index of everything learned
|
|
@@ -117,8 +117,10 @@ those too.)
|
|
|
117
117
|
session transcripts and extracted memories before anything is written or sent
|
|
118
118
|
to a model. Notes you explicitly dictate ("remember that ...") are stored as
|
|
119
119
|
you said them.
|
|
120
|
-
- **The learning agents are sandboxed** —
|
|
121
|
-
the
|
|
120
|
+
- **The learning agents are sandboxed** — the extraction agent has no tools at
|
|
121
|
+
all (the transcript is handed to it inline), and the consolidation agent gets
|
|
122
|
+
only file tools plus access to the memory folder. Shell, network, IDE, and
|
|
123
|
+
MCP tools are denied for both.
|
|
122
124
|
- **Reset is safe.** `memory_reset` refuses to run if the memory folder is a
|
|
123
125
|
symlink, so it can't be tricked into deleting something else.
|
|
124
126
|
- **Web/MCP sessions:** by default, sessions that used web search, fetch, or MCP
|
|
@@ -196,6 +198,17 @@ explicitly, so they win over an agent-level `model`.
|
|
|
196
198
|
## Under the hood
|
|
197
199
|
|
|
198
200
|
opencode-codex-memory is a faithful port of the memory system from OpenAI's codex.
|
|
201
|
+
|
|
202
|
+
One design choice is worth calling out, because it shapes everything else: **memory
|
|
203
|
+
is global.** There's a single store for all your work, not one per project. That's
|
|
204
|
+
not an accident of the port — it's codex's own hard-won shape. codex *started* with
|
|
205
|
+
per-project memory (a separate bucket per directory, plus a user scope) and
|
|
206
|
+
**deliberately removed it** in early 2026, collapsing everything into one global
|
|
207
|
+
root for simplicity: one store, one lock, one consolidation pass. Project awareness
|
|
208
|
+
didn't disappear — it moved out of storage and into the prompt, as soft "this looks
|
|
209
|
+
like it belongs to that project" hints rather than hard partitions. This port
|
|
210
|
+
mirrors that exactly.
|
|
211
|
+
|
|
199
212
|
If you want to understand the design, the trade-offs, or contribute, see
|
|
200
213
|
[`ARCHITECTURE.md`](./ARCHITECTURE.md). Contributor guidance lives in
|
|
201
214
|
[`CONTRIBUTING.md`](./CONTRIBUTING.md) and [`AGENTS.md`](./AGENTS.md) —
|
package/dist/src/capture.js
CHANGED
|
@@ -49,8 +49,10 @@ export async function listRecentSessions(limit = SCAN_LIMIT) {
|
|
|
49
49
|
continue;
|
|
50
50
|
try {
|
|
51
51
|
const res = await withTimeout(client.session.list({
|
|
52
|
-
// scope/roots/limit are in the server's ListQuery since
|
|
53
|
-
//
|
|
52
|
+
// scope/roots/limit are in the server's ListQuery (accepted since
|
|
53
|
+
// opencode 1.14.30, well under our 1.18 floor); the pinned SDK types
|
|
54
|
+
// still omit them (SessionListData.query is just { directory } as of
|
|
55
|
+
// 1.18.1), hence the cast at the call site.
|
|
54
56
|
query: { directory: project.worktree, scope: "project", roots: true, limit },
|
|
55
57
|
}), API_TIMEOUT_MS, "session.list");
|
|
56
58
|
if (!res || res.error || !Array.isArray(res.data))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-codex-memory",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Persistent memory plugin for opencode — ports codex's two-phase memory system (extraction → consolidation → injection → citation feedback)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
],
|
|
46
46
|
"license": "Apache-2.0",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@opencode-ai/plugin": "^1.
|
|
48
|
+
"@opencode-ai/plugin": "^1.18.0",
|
|
49
49
|
"diff": "^9.0.0",
|
|
50
50
|
"isomorphic-git": "^1.38.6"
|
|
51
51
|
},
|