Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

opencode_cli: OPENCODE_DISABLE_DEFAULT_PLUGINS breaks OAuth logins (ChatGPT, Copilot)

クローズ 初心者向け
#809 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #810 @elliottwaves-20 による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

skillspector/providers/_agent_cli.py の _prepare_opencode_env から始めてください。そこでは OPENCODE_DISABLE_DEFAULT_PLUGINS が設定されています。この項目は削除し、OPENCODE_PURE は残してください。次に、既存の _prepare_opencode_env 用のテストを更新し、その変数が存在しないことを検証するようにしてください。テストが通り、issue の再現スクリプトが OAuth ログイン時に pong を返せば完了です。報告者が PR を作成することを申し出ているので、作業を始める前に既存の PR があるか確認してください。

索引モデルが issue の本文から書いたものです。

説明

Summary

With the opencode_cli provider, an OpenCode login that uses OAuth (ChatGPT Plus/Pro via opencode auth login → OpenAI, also GitHub Copilot, GitLab, …) cannot be used: every call fails with

{"type":"error",...,"error":{"name":"UnknownError","data":{"message":"Unexpected server error. Check server logs for details."}}}

The cause is OPENCODE_DISABLE_DEFAULT_PLUGINS=1 in _prepare_opencode_env. In OpenCode 1.18.33 that flag skips all internal plugins, and the OAuth logins are implemented as internal plugins. The docstring of _prepare_opencode_env states the intent the flag defeats: "The real OpenCode authentication store remains available so this CLI provider can use the user's existing login." For API-key logins it works; for OAuth logins the stored token is never attached.

Reproduction

OpenCode 1.18.33, logged in with ChatGPT (opencode auth login → OpenAI → ChatGPT Plus/Pro). SkillSpector main (3c8e4b9). The script uses SkillSpector's own _build_opencode_argv and _prepare_opencode_env and only toggles the one variable:

import os, shutil, subprocess, tempfile
from skillspector.providers import _agent_cli as a

argv = a._build_opencode_argv(shutil.which("opencode"), "openai/gpt-6-luna")
for drop in (False, True):
    root = tempfile.mkdtemp()
    env = a._prepare_opencode_env(dict(os.environ), root, argv)
    if drop:
        env.pop("OPENCODE_DISABLE_DEFAULT_PLUGINS")
    p = subprocess.run(argv, input="Reply with the single word: pong", env=env,
                       capture_output=True, text=True, encoding="utf-8")
    print(drop, p.returncode, "pong" in (p.stdout + p.stderr).lower())

Result:

OPENCODE_DISABLE_DEFAULT_PLUGINS exit answer
1 (as today) 1 Unexpected server error
unset 0 pong

Every other variable of the sandbox stays as it is.

What the flag disables (OpenCode 1.18.33)

packages/opencode/src/plugin/index.ts at tag v1.18.33:

for (const plugin of flags.disableDefaultPlugins ? [] : internalPlugins(flags)) {

internalPlugins() returns CodexAuthPlugin, CopilotAuthPlugin, ModalPlugin, GitlabAuthPlugin, PoeAuthPlugin, CloudflareWorkersAuthPlugin, CloudflareAIGatewayAuthPlugin, AzureAuthPlugin, DigitalOceanAuthPlugin, SnowflakeCortexAuthPlugin, XaiAuthPlugin, CerebrasPlugin. None of them registers a tool hook; they only provide auth and the chat.headers / chat.params request hooks for their provider. External plugins stay off independently through --pure / OPENCODE_PURE=1 (flags.pure ? [] : cfg.plugin_origins), and tool access stays denied by the per-invocation deny-all agent and OPENCODE_PERMISSION.

So the flag adds no tool isolation, but it breaks OAuth-based logins.

Proposed fix

Drop OPENCODE_DISABLE_DEFAULT_PLUGINS from the sandbox env and pin the reasoning in the test (assert it is absent, keep the OPENCODE_PURE assertion). I can open a PR.

主要言語
Python
スター
20.2k
フォーク
1.8k
平均マージ
4日 11時間
マージ済み PR(30日)
115

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/SkillSpector のほかの issue

NVIDIA/SkillSpector の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。