Skip to content

fix(opencode): use symlinks for credentials in isolated summarization env#515

Open
OrnelasD-Rogers wants to merge 1 commit intozilliztech:mainfrom
OrnelasD-Rogers:fix/opencode-symlink-credentials
Open

fix(opencode): use symlinks for credentials in isolated summarization env#515
OrnelasD-Rogers wants to merge 1 commit intozilliztech:mainfrom
OrnelasD-Rogers:fix/opencode-symlink-credentials

Conversation

@OrnelasD-Rogers
Copy link
Copy Markdown

Problem

The OpenCode capture daemon (capture-daemon.py) creates an isolated environment
for opencode run summarization to prevent recursive plugin loading. However,
the isolation was incomplete:

  • auth.json (provider credentials) was not available in the isolated env
  • opencode.json was copied once on first run, so config changes were never
    picked up
  • This prevented opencode run from using small_model configurations that
    rely on credentials registered with the OpenCode CLI

Solution

Replace file copying with symlinks for all required files in the isolated
environment:

File Symlink target
~/.config/opencode/opencode.json .../opencode/opencode.json
~/.local/share/opencode/auth.json .../data/opencode/auth.json

Benefits:

  • ✅ Provider credentials always available (auth.json)
  • ✅ Config changes reflected immediately (symlinks, not stale copies)
  • ✅ Still fully isolated (XDG_CONFIG_HOME + XDG_DATA_HOME separate)
  • ✅ No recursion loop (daemon and subprocess use different SQLite DBs)

Files changed

  • plugins/opencode/scripts/capture-daemon.py: Rewrite ensure_isolated_config()
    to use symlinks; add _ensure_symlink() helper
  • docs/platforms/opencode/how-it-works.md: Update architecture diagram and
    isolation explanation to reflect symlink approach

Testing

Tested locally:

  • Daemon starts successfully and creates correct symlinks
  • opencode run in isolated env resolves models configured in small_model
  • Summarization output appears as bullet points in .memsearch/memory/YYYY-MM-DD.md

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.

1 participant