fix(extensions): allowUnsafeConfigPaths missing in GIT_EXTENSION_OPTIONS causes `extensions update` failure

Aperta Adatta ai principianti
#30,416 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@kccrcodes ci sta già lavorando.

Dal 25/11/2026.

  • #30459 di @kccrcodes — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, node.js, typescript
Ambito
cli

Direzione di ricerca

Apri packages/cli/src/config/extensions/github.ts e trova GIT_EXTENSION_OPTIONS, che omette allowUnsafeConfigPaths mentre getSafeGitEnv() inietta GIT_CONFIG_SYSTEM. Confrontalo con SHADOW_REPO_UNSAFE_OPTIONS in packages/core/src/services/gitService.ts, dove lo stesso flag è già impostato per lo stesso motivo. Aggiungi il flag, poi esegui i test della CLI extensions che coprono gemini extensions update per confermare che git.listRemote non lancia più.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status/need-triage
Summary

In @google/[email protected], updating any Git-based extension via gemini extensions update <extension> fails with:


Failed to check for updates for extension "...": Use of "GIT_CONFIG_SYSTEM" is not permitted without enabling allowUnsafeConfigPaths

Environment
  • Gemini CLI version: 0.70.0 (worked fine in 0.69.0)
  • Node.js version: v20+ / v22+ / v26+
  • OS: Linux / macOS / Windows
Steps to Reproduce
  1. Install Gemini CLI 0.70.0: npm install -g @google/[email protected]
  2. Install any Git-based extension.
  3. Run gemini extensions update <extension_name> (or gemini extensions update --all).
Expected Behavior

gemini extensions update fetches remote refs and checks whether the local extension is up-to-date.

Actual Behavior

The command fails immediately with:
Use of "GIT_CONFIG_SYSTEM" is not permitted without enabling allowUnsafeConfigPaths

Root Cause Analysis

In packages/cli/src/config/extensions/github.ts:

  1. checkForExtensionUpdate and cloneFromGit call getSafeGitEnv(), which injects:
    GIT_CONFIG_SYSTEM: devNullPath,
    
  2. The simple-git instance is initialized with GIT_EXTENSION_OPTIONS:
    const GIT_EXTENSION_OPTIONS: Partial<SimpleGitOptions> = {
      unsafe: {
        allowUnsafeAskPass: true,
        allowUnsafeEditor: true,
        allowUnsafePager: true,
        allowUnsafeSshCommand: true,
        // allowUnsafeConfigPaths is missing here
      },
    };
    
  3. Because simple-git blocks GIT_CONFIG_SYSTEM unless allowUnsafeConfigPaths: true is explicitly opted into, it throws before executing git.listRemote.
  4. Note that SHADOW_REPO_UNSAFE_OPTIONS in packages/core/src/services/gitService.ts already enables allowUnsafeConfigPaths: true for the exact same reason.
Proposed Fix

Add allowUnsafeConfigPaths: true to GIT_EXTENSION_OPTIONS.unsafe in packages/cli/src/config/extensions/github.ts:

const GIT_EXTENSION_OPTIONS: Partial<SimpleGitOptions> = {
  unsafe: {
    allowUnsafeAskPass: true,
    allowUnsafeEditor: true,
    allowUnsafePager: true,
    allowUnsafeSshCommand: true,
    allowUnsafeConfigPaths: true,
  },
};
Lingua principale
TypeScript
Stelle
109k
Fork
15k
Merge medio
1g 24m
PR unite (30g)
91

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-gemini/gemini-cli

Tutte le issue di google-gemini/gemini-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.