Skip to content

fix: respect OPENCODE_DISABLE_CLAUDE_CODE env vars (fixes #2037)#2763

Merged
code-yeongyu merged 1 commit intodevfrom
fix/issue-2037
Mar 23, 2026
Merged

fix: respect OPENCODE_DISABLE_CLAUDE_CODE env vars (fixes #2037)#2763
code-yeongyu merged 1 commit intodevfrom
fix/issue-2037

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Mar 23, 2026

Problem

Claude plugin commands leak into OpenCode despite OPENCODE_DISABLE_CLAUDE_CODE* env vars being set.

Fix

Check OPENCODE_DISABLE_CLAUDE_CODE and OPENCODE_DISABLE_CLAUDE_CODE_PLUGINS env 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_CODE and OPENCODE_DISABLE_CLAUDE_CODE_PLUGINS to fully disable Claude Code plugin loading and stop command leakage into OpenCode. Fixes #2037.

  • Bug Fixes
    • Recognize "true" and "1" for both env vars; short-circuit loadAllPluginComponents and return an empty result when disabled.
    • Added tests for disabled, enabled, and invalid values to verify no-load behavior and default loading path.

Written for commit f3c2138. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 through discoverPluginCommandDefinitions().
  • 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()) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

@code-yeongyu code-yeongyu merged commit dc66088 into dev Mar 23, 2026
7 of 8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-2037 branch March 23, 2026 09:39
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.

Claude plugin commands leak into OpenCode despite OPENCODE_DISABLE_CLAUDE_CODE*

1 participant