opencode_cli: OPENCODE_DISABLE_DEFAULT_PLUGINS breaks OAuth logins (ChatGPT, Copilot)
メンテナーはふだん 4 日以内に返信
関連するプルリクエストがすでにマージされています。
- #810 @elliottwaves-20 による — マージ済み
評価
調査の方向性
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
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/SkillSpector のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NVIDIA/SkillSpector#832 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NVIDIA/SkillSpector#821 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
RP1 `npx` pattern matches across line breaks, so a line ending in "npx" plus the next word becomes a command対応中かも @agentsope が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NVIDIA/SkillSpector#639 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
Quoted version metadata creates a false missing-file reference and changes score 0 from SAFE to CAUTION対応中かも @goodhee が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/SkillSpector#524 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on Windows対応中かも @mohgupta-ship-it が 43 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
NVIDIA/SkillSpector#485 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
NVIDIA/SkillSpector の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 66/100
AlexsLemonade/scpca-docs#518 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
rocketride-org/rocketride-server#2705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Metabuilder-Labs/tokenjam#786 ·
メンテナーはふだん 1 日以内に返信
-
prototype(verifier_token): map disallowed warning to contraindicated before composite precedence check対応中かも @drk-ram が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
agentrust-io/trace-spec#582 ·
メンテナーはふだん 1 日以内に返信
-
area:cli priority:low refactor size:small
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
RonaldHensbergen/composable-data-stack#906 ·
メンテナーはふだん 1 日以内に返信