fix: respect OPENCODE_DISABLE_CLAUDE_CODE env vars (fixes #2037)#2763
Merged
code-yeongyu merged 1 commit intodevfrom Mar 23, 2026
Merged
fix: respect OPENCODE_DISABLE_CLAUDE_CODE env vars (fixes #2037)#2763code-yeongyu merged 1 commit intodevfrom
code-yeongyu merged 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
- There is a concrete regression risk in
src/features/claude-code-plugin-loader/loader.ts: plugin loading is blocked by the new check, but commands can still leak throughdiscoverPluginCommandDefinitions(). - Because this is a high-severity (7/10), high-confidence (9/10) behavior mismatch that could expose commands unexpectedly, the merge risk is moderate rather than low.
- Pay close attention to
src/features/claude-code-plugin-loader/loader.ts- ensure command discovery and plugin-loading checks are enforced consistently to prevent command leakage.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/features/claude-code-plugin-loader/loader.ts">
<violation number="1" location="src/features/claude-code-plugin-loader/loader.ts:37">
P1: This check prevents plugin loading here, but commands will still leak via discoverPluginCommandDefinitions().</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| } | ||
|
|
||
| export async function loadAllPluginComponents(options?: PluginLoaderOptions): Promise<PluginComponentsResult> { | ||
| if (isClaudeCodePluginsDisabled()) { |
There was a problem hiding this comment.
P1: This check prevents plugin loading here, but commands will still leak via discoverPluginCommandDefinitions().
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/features/claude-code-plugin-loader/loader.ts, line 37:
<comment>This check prevents plugin loading here, but commands will still leak via discoverPluginCommandDefinitions().</comment>
<file context>
@@ -27,7 +27,26 @@ export interface PluginComponentsResult {
+}
+
export async function loadAllPluginComponents(options?: PluginLoaderOptions): Promise<PluginComponentsResult> {
+ if (isClaudeCodePluginsDisabled()) {
+ log("Claude Code plugin loading disabled via OPENCODE_DISABLE_CLAUDE_CODE env var")
+ return {
</file context>
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
Claude plugin commands leak into OpenCode despite
OPENCODE_DISABLE_CLAUDE_CODE*env vars being set.Fix
Check
OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_PLUGINSenv vars before loading Claude Code plugins. Tests added (6 pass).Fixes #2037
Automated fix by Sisyphus (oh-my-opencode)
Summary by cubic
Respect
OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_PLUGINSto fully disable Claude Code plugin loading and stop command leakage into OpenCode. Fixes #2037.loadAllPluginComponentsand return an empty result when disabled.Written for commit f3c2138. Summary will update on new commits.