opencode_cli: OPENCODE_DISABLE_DEFAULT_PLUGINS breaks OAuth logins (ChatGPT, Copilot)
Los mantenedores suelen responder en 4 días
Ya se ha fusionado un pull request relacionado.
- #810 de @elliottwaves-20 — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza en _prepare_opencode_env en skillspector/providers/_agent_cli.py, donde se establece OPENCODE_DISABLE_DEFAULT_PLUGINS, y elimina esa entrada manteniendo OPENCODE_PURE. Luego actualiza la prueba existente para _prepare_opencode_env para verificar que la variable está ausente. Se considera terminado cuando la prueba pasa y el script de reproducción del issue devuelve pong para un inicio de sesión OAuth. La persona que reportó ofreció abrir un PR, así que revisa si ya existe uno antes de empezar.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 20.2k
- Forks
- 1.8k
- Merge medio
- 4 d 15 h
- PR fusionados (30 d)
- 117
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/SkillSpector
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
NVIDIA/SkillSpector#832 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NVIDIA/SkillSpector#821 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
RP1 `npx` pattern matches across line breaks, so a line ending in "npx" plus the next word becomes a commandPosiblemente ocupada @agentsope la tomó hace 23 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
NVIDIA/SkillSpector#639 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
Quoted version metadata creates a false missing-file reference and changes score 0 from SAFE to CAUTIONPosiblemente ocupada @goodhee la tomó hace 39 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NVIDIA/SkillSpector#524 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on WindowsPosiblemente ocupada @mohgupta-ship-it la tomó hace 44 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
NVIDIA/SkillSpector#485 · 4 comentarios ·
Los mantenedores suelen responder en 4 días
Todos los issues de NVIDIA/SkillSpector
Issues similares
-
Use mhctools predictor_required=False for saved-result rescoringPosiblemente ocupada @iskandr la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
521xueweihan/HelloGitHub#4051 · 1 comentario ·
-
bug documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
awslabs/visual-asset-management-system#514 ·
Los mantenedores suelen responder en 1 día
-
backend bug spec:REQ-053
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
nolte/kamerplanter#2547 ·
Los mantenedores suelen responder en 1 día