opencode_cli: OPENCODE_DISABLE_DEFAULT_PLUGINS breaks OAuth logins (ChatGPT, Copilot)
维护者通常 4 天内回复
已经有一个关联 PR 被合并了。
- #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 天 15 小时
- 30 天内合并 PR
- 117
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 于 23 天前认领。 未关闭
难度 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 于 39 天前认领。 未关闭
难度 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
-
难度 2/5 1-3 小时 新手友好度 77/100
mihai-vlc/sublime-jsfmt#56 ·
-
comp/cli comp/plugins P2 type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#141917 · 1 条评论 ·
维护者通常 1 天内回复
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()可能已有人在做 @apoorvdarshan 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
BasedHardware/omi#22770 ·
维护者通常 1 天内回复
-
bug needs-acceptance wg/router-models-inference-runtime
难度 2/5 1-3 小时 新手友好度 66/100
vllm-project/semantic-router#5295 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/huggingface_hub#5210 ·
维护者通常 1 天内回复