feat: configurable plans directory and opt-out for plugin dependency installs - #46199
Open
log0u7 wants to merge 1 commit into
Open
feat: configurable plans directory and opt-out for plugin dependency installs#46199log0u7 wants to merge 1 commit into
log0u7 wants to merge 1 commit into
Conversation
…installs Plan files were hardcoded to <worktree>/.opencode/plans for git projects, and every discovered .opencode config directory got an automatic @opencode-ai/plugin dependency install plus generated package manifest, lockfile and .gitignore files. This pollutes every project plan mode is used in, with no way to opt out. - add plans_directory config key to relocate plan files (supports ~) - add OPENCODE_DISABLE_PLUGIN_DEPS=1 to skip the per-directory dependency install and generated files - extend the plan agent built-in edit/external_directory permissions to cover the configured plans directory Refs anomalyco#46189
Author
|
For anyone landing here from the issue: ways to keep this clean today, before and after this PR. On released versions (no PR needed):
With this PR: Options 1-4 become unnecessary. Set |
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.
Issue for this PR
Closes #46189
Type of change
What does this PR do?
Opening opencode in a git project and using plan mode creates
<project>/.opencode/plans/. On the next start, that directory is picked up as a config directory and gets an automatic@opencode-ai/plugindependency install, plus generated package manifest, lockfile and.gitignorefiles. Every project plan mode was used in ends up with its own copy, and~/.config/opencodegets one too when it is a git repo. There is currently no way to opt out (details and code refs in #46189).This PR adds two opt-outs, both default-preserving:
plans_directoryconfig key (supports~): plan files are written to the configured directory instead of the worktree/global defaults, e.g. the global data dir, so project trees stay untouched. The plan agent's built-inedit/external_directoryallows were extended to the configured directory so plan mode keeps working.OPENCODE_DISABLE_PLUGIN_DEPS=1env flag: skips the per-directory dependency install and the generated files. Config discovery (agents, commands, plugins) is unaffected.Default behavior is unchanged when neither is set.
How did you verify your code works?
Session.plan(): default paths (git / non-git),plans_directoryoverride (absolute,~, bare~, relative), and a config-loader test asserting nothing is written into a config dir when the flag is setbun run typecheck: 30/30 turbo tasks pass on bun 1.3.14 (the pinned version).opencodedirectory is created in the projectScreenshots / recordings
Not a UI change.
Checklist