Thanks for your interest in improving opencode-codex-memory.
This repo has one goal: a faithful port of codex's memory system to opencode. It is not a general-purpose memory plugin, and it does not aim to grow its own feature set.
Any PR that breaks parity with the codex memory implementation will be rejected. That includes, concretely:
- Adding memory features codex doesn't have (e.g. schema-level or job-level
project partitioning — memory is global, see the design invariant in
AGENTS.md). - Changing pipeline behavior (extraction, consolidation, retention, redaction, citations, rate gating) in ways that diverge from codex without a documented reason.
- Renaming options or defaults away from their codex counterparts
(
MemoriesToml/MemoriesConfig).
Divergences are sometimes necessary — opencode's plugin API is not codex's
runtime. Those are fine only when they are deliberate and recorded as a
note: on the relevant mapping in codex-map.yaml. See ARCHITECTURE.md
(D1–D6) for the existing load-bearing workarounds.
-
Read
ARCHITECTURE.mdandAGENTS.md. -
If the change touches memory pipeline behavior or a file listed in
codex-map.yaml, find its upstream source there and run the drift check against a local codex checkout:CODEX_REPO=/path/to/codex ./scripts/check-codex-drift.sh
If upstream moved since
codex_ref, port the change intentionally (or record a deliberate divergence), then bumpcodex_ref/codex_ref_date.Skip this step for pure plugin/host fixes that have no codex counterpart (opencode integration, packaging, host API adapters, tooling, docs-only, and similar). Still keep any divergence from mapped behavior deliberate and noted in
codex-map.yamlif you touch those paths.
bun install
bun test
bun run typecheck
bun run build && bun run smoke && bun run contractGitHub Actions runs bun test, typecheck, build, and smoke on every PR to
main. Live host checks (contract, live:*) stay manual.
Live checks against the official opencode binary (XDG-sandboxed; needs provider auth + a configured model — never touches your real memory home):
bun run live:read # system-prompt injection only
bun run live:e2e # full write pipeline (Phase 1 + 2 + closed loop)- Store/DB tests use a temp root via
OPENCODE_CODEX_MEMORY_TEST_ROOT. - Templates in
src/templates/*.mdare ported from codex with deliberate platform adaptations — never byte-copy them from upstream. Read the mappingnote:incodex-map.yamlfirst;tests/prompts.test.tsguards the citation/tool/placeholder contracts. - Every agent shipped in
opencode.jsonmust start its permissions with"*": "deny"and allow only the built-in opencode file tools it needs. Shell, network, task delegation, IDE, and MCP tools must remain denied;tests/agents.test.tsenforces this sandbox. - On each opencode release:
bun run contract(OpenAPI + hook surface), then preferbun run live:e2ebefore bumping@opencode-ai/plugin.
- Concise, factual messages (
type: summary, matching the existing history). - No
Co-Authored-Bytrailers.