fix(opencode): use symlinks for credentials in isolated summarization env#515
Open
OrnelasD-Rogers wants to merge 1 commit intozilliztech:mainfrom
Open
fix(opencode): use symlinks for credentials in isolated summarization env#515OrnelasD-Rogers wants to merge 1 commit intozilliztech:mainfrom
OrnelasD-Rogers wants to merge 1 commit intozilliztech:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The OpenCode capture daemon (
capture-daemon.py) creates an isolated environmentfor
opencode runsummarization to prevent recursive plugin loading. However,the isolation was incomplete:
auth.json(provider credentials) was not available in the isolated envopencode.jsonwas copied once on first run, so config changes were neverpicked up
opencode runfrom usingsmall_modelconfigurations thatrely on credentials registered with the OpenCode CLI
Solution
Replace file copying with symlinks for all required files in the isolated
environment:
~/.config/opencode/opencode.json.../opencode/opencode.json~/.local/share/opencode/auth.json.../data/opencode/auth.jsonBenefits:
auth.json)XDG_CONFIG_HOME+XDG_DATA_HOMEseparate)Files changed
plugins/opencode/scripts/capture-daemon.py: Rewriteensure_isolated_config()to use symlinks; add
_ensure_symlink()helperdocs/platforms/opencode/how-it-works.md: Update architecture diagram andisolation explanation to reflect symlink approach
Testing
Tested locally:
opencode runin isolated env resolves models configured insmall_model.memsearch/memory/YYYY-MM-DD.md