Skip to content

[Bug] opencode-mem stopped working after OpenCode update #73

Closed

Description

@CPUrising

Environment

  • OpenCode Version: v1.3.5 (Desktop)
  • opencode-mem Version: 2.12.0
  • OS: Windows 11

Description

After updating OpenCode a few hours ago, the opencode-mem plugin stopped working properly:

  • No new memories saved today (2026-03-29)
  • Memory data stops at 2026-03-28 14:40:53
  • Using /memory add command has no effect

Troubleshooting

  • Reinstalled opencode-mem: bun add opencode-mem@latest (no fix)

Additional Info

  • Config: ~/.config/opencode/opencode-mem.jsonc
  • Data dir exists: ~/.opencode-mem/data/
  • user-prompts.db file was modified today (21:19) but no new records added

Activity

  1. CPUrising commented on Mar 29, 2026

    @CPUrising
    Author

    Unable to open http://127.0.0.1:4747/ either

  2. tickernelz commented on Mar 31, 2026

    @tickernelz
    Owner

    Thanks for the detailed report. A few questions to help narrow this down:

    1. Do you have an embedding API configured? (i.e. embeddingApiUrl + embeddingApiKey in your config). If not, the plugin loads a local embedding model (Xenova/all-MiniLM-L6-v2) via @xenova/transformers during warmup. This can be slow or silently fail on some environments.

    2. Did opencode v1.3.5 change the plugin API? The plugin uses @opencode-ai/plugin and @opencode-ai/sdk types. If the new opencode version changed the plugin interface (e.g. ctx.client.session.messages, event types, etc.), the plugin could silently fail.

    3. Check for error logs: The plugin logs errors via a custom logger. Look for any opencode logs around the time it stopped working (2026-03-29).

    Most likely cause: The warmup at src/index.ts:32-38 catches errors silently and the plugin continues in a broken state. If the embedding model fails to load (network issue, disk space, model cache corruption), all subsequent operations (add, search) will fail because memoryClient.isReady() returns false.

    Suggested investigation:

    • Delete the embedding model cache at ~/.opencode-mem/data/.cache/ and restart opencode
    • Or try setting embeddingApiUrl + embeddingApiKey to bypass local model loading entirely

    If you can share any error logs from opencode, that would help pinpoint the exact failure.

  3. CPUrising commented on Mar 31, 2026

    @CPUrising
    Author

    Environment

    • OpenCode Version: v1.3.9
    • opencode-mem Version: 2.12.1
    • OS: Windows 11

    Issue Description
    After updating OpenCode, the plugin stopped working. No new memories are being saved, no new logs are being generated.

    Troubleshooting Steps Completed

    1. Cleared model cache - Deleted ~/.opencode-mem/data/.cache/

    2. Configured remote Embedding API - Added embeddingApiUrl and embeddingApiKey to the config file

    3. Checked ports - No other processes using ports 4747 or 4096

    4. Reinstalled plugin - Executed bun remove opencode-mem && bun add opencode-mem@latest

    5. Checked logs - No new entries after 2026-03-15
      No other log files found (e.g., from opencode itself). The opencode-mem log (~/.opencode-mem/opencode-mem.log) only records up to March 15th, with no new logs after that.

      Log Content

      --- Session started: 2026-03-15T06:22:20.877Z ---
      [2026-03-15T06:22:20.878Z] Compaction memory injected: {"sessionID":"ses_30fe42835ffebQ2Hp6wpnJlOqv","count":1}
      

    Key Findings

    Item Status
    HuggingFace model cache ❌ Never downloaded (~/.cache/huggingface/ directory does not exist)
    Plugin loading ❌ No new logs after 2026-03-15
    Remote API config ⚠️ Configured but not being called
    Web UI (port 4747) ❌ Connection refused
    Main UI (port 4096) ❌ Connection refused

    Notes

    • Plugin worked normally from 2026-03-15 to 2026-03-28 (confirmed by database timestamps, and the web interface was accessible)
    • After OpenCode v1.3.5 update, the plugin completely stopped working
    • opencode-mem depends on @opencode-ai/plugin@^1.0.162 and @opencode-ai/sdk@^1.2.26
      Actually installed: @opencode-ai/plugin@1.3.7 and @opencode-ai/sdk@1.3.7
      opencode v1.3.x may have changed the plugin API, causing hooks (chat.message, event) to be incompatible
  4. NaNomicon commented on Apr 2, 2026

    @NaNomicon
    Collaborator

    I am investigating this issue, seems like this is blocking everything. If anyone has any information, feel free to send them here.

  5. NaNomicon commented on Apr 2, 2026

    @NaNomicon
    Collaborator

    I finished tracing this and the root cause is now confirmed.

    This is not a warmup, embedding, web-server, or database regression inside opencode-mem itself. The failure happens earlier, during plugin loading.

    On the opencode-mem side, the published package currently exposes only a bare default plugin export from dist/plugin.js, and its package.json does not expose the newer plugin metadata/entrypoints such as oc-plugin, exports, or ./server.

    On the OpenCode side, recent 1.3.x plugin loading expects target-aware entrypoints and validates the module as a plugin object with a server() entrypoint instead of a bare default-exported function. Because of that contract mismatch, opencode-mem is skipped before its runtime logic starts, which explains the missing behavior end-to-end.

    That is also why the runtime theories did not hold up:

    • warmup/embedding failures would still produce plugin logs and tool-level errors
    • web server startup is detached from hook registration and would not prevent plugin load
    • user-prompts.db timestamp changes do not prove prompt capture succeeded

    I’m preparing a PR to update opencode-mem to the current OpenCode plugin loading contract.

  6. added a commit that references this issue on Apr 2, 2026
    f07a99f
  7. added a commit that references this issue on Apr 8, 2026
    b190922
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions