Skip to content

fix(opencode): honor MEMSEARCH_DIR for storage scope - #649

Open
yxtay wants to merge 2 commits into
zilliztech:mainfrom
yxtay:fix/opencode-memsearch-dir-v2
Open

fix(opencode): honor MEMSEARCH_DIR for storage scope#649
yxtay wants to merge 2 commits into
zilliztech:mainfrom
yxtay:fix/opencode-memsearch-dir-v2

Conversation

@yxtay

@yxtay yxtay commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Closes #627

Summary

  • resolveScope() resolves storage dir and collection in one place from MEMSEARCH_DIR env or project dir
  • Capture daemon receives --memsearch-dir and forwards through maintenance/summarize flows
  • PID file stays per-project so each project has its own daemon even when sharing MEMSEARCH_DIR
  • Legacy upgrade checkpoint (_load_legacy_last_msg_time) reads from project_dir/.memsearch for compatibility with existing installs

Test plan

  • uv run python -m pytest tests/test_opencode_turns.py — all tests pass
  • bun test plugins/opencode/index.test.tsresolveScope per-project and shared-scope tests pass
  • Set MEMSEARCH_DIR=~/.memsearch, run an OpenCode session — storage writes to shared dir
  • Two projects sharing MEMSEARCH_DIR each have their own daemon PID file and separate collections

🤖 Generated with Claude Code

yxtay and others added 2 commits July 24, 2026 09:56
- resolveScope() resolves storage dir and collection in one place from MEMSEARCH_DIR env or project dir
- Capture daemon receives --memsearch-dir and forwards through maintenance/summarize flows
- PID file stays per-project so each project has its own daemon even when sharing MEMSEARCH_DIR
- Legacy upgrade checkpoint reads from project_dir/.memsearch for compatibility with existing installs

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: opencode/openclaw plugins ignore MEMSEARCH_DIR env var

1 participant