opencode_cli: OPENCODE_DISABLE_DEFAULT_PLUGINS breaks OAuth logins (ChatGPT, Copilot)
I maintainer di solito rispondono entro 4 giorni
Una pull request collegata è già stata integrata.
- #810 di @elliottwaves-20 — integrata
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia da _prepare_opencode_env in skillspector/providers/_agent_cli.py, dove viene impostata OPENCODE_DISABLE_DEFAULT_PLUGINS, e rimuovi questa voce mantenendo OPENCODE_PURE. Poi aggiorna il test esistente per _prepare_opencode_env in modo che verifichi che la variabile sia assente. È completato quando il test passa e lo script di riproduzione nell'issue restituisce pong per un login OAuth. Chi ha segnalato il problema si è offerto di aprire una PR, quindi verifica se ne esiste già una prima di iniziare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 20.2k
- Fork
- 1.8k
- Merge medio
- 4g 15h
- PR unite (30g)
- 117
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/SkillSpector
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NVIDIA/SkillSpector#832 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NVIDIA/SkillSpector#821 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
RP1 `npx` pattern matches across line breaks, so a line ending in "npx" plus the next word becomes a commandForse già presa @agentsope l’ha presa 23 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
NVIDIA/SkillSpector#639 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Quoted version metadata creates a false missing-file reference and changes score 0 from SAFE to CAUTIONForse già presa @goodhee l’ha presa 39 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NVIDIA/SkillSpector#524 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
compare_scan_accuracy: editable-dependency file:// URL resolves to "C:\C:\..." on WindowsForse già presa @mohgupta-ship-it l’ha presa 44 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
NVIDIA/SkillSpector#485 · 4 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di NVIDIA/SkillSpector
Issue simili
-
wr.dynamodb.read_items returns [{}] for a single partition value that does not existForse già presa @auraseb l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
aws/aws-sdk-pandas#3520 ·
I maintainer di solito rispondono entro 2 giorni
-
requires triage typing
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sqlalchemy/sqlalchemy#13704 ·
I maintainer di solito rispondono entro 1 giorno
-
Edit tool converts CRLF files to LFForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
huggingface/tau#774 ·
I maintainer di solito rispondono entro 1 giorno
-
show ignores the row limit when a column or table name contains "limit"Forse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
What happened to `check.py`?Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
linebender/resvg#1179 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni