github / github/copilot-cli

Launching VS Code from Copilot CLI drops empty GIT_CONFIG_VALUE and breaks Git discovery

Aperta
#4,531 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

area:configuration area:platform-windows
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

Describe the bug

Copilot CLI exports an indexed GIT_CONFIG_COUNT / GIT_CONFIG_KEY_* / GIT_CONFIG_VALUE_* block into shell-command child processes. The core.fsmonitor override is represented by an empty value.

When VS Code is launched from the Copilot CLI environment with code ., VS Code's Git extension retains GIT_CONFIG_COUNT=4 and GIT_CONFIG_KEY_3=core.fsmonitor, but GIT_CONFIG_VALUE_3 is absent. Every Git command then fails before repository discovery:

error: missing config value GIT_CONFIG_VALUE_3
fatal: unable to parse command-line config

The Source Control pane consequently does not recognize the directory as a Git repository.

Affected version

GitHub Copilot CLI 1.0.81-3

Steps to reproduce the behavior

  1. Start Copilot CLI on Windows in a Git repository.

  2. Launch VS Code from the CLI environment:

    code .
    
  3. Open the Source Control pane or inspect the VS Code Git log.

  4. Observe repository discovery failing, for example:

    > git rev-parse --show-toplevel
    error: missing config value GIT_CONFIG_VALUE_3
    fatal: unable to parse command-line config
    

The relevant environment inherited from Copilot CLI is:

GIT_CONFIG_COUNT=4
GIT_CONFIG_KEY_0=safe.bareRepository
GIT_CONFIG_VALUE_0=explicit
GIT_CONFIG_KEY_1=safe.bareRepository
GIT_CONFIG_VALUE_1=explicit
GIT_CONFIG_KEY_2=credential.interactive
GIT_CONFIG_VALUE_2=never
GIT_CONFIG_KEY_3=core.fsmonitor
GIT_CONFIG_VALUE_3=<empty>

Git works directly in the Copilot shell because the empty variable is still present and resolves as core.fsmonitor=false. Clearing the injected block before launching VS Code avoids the failure:

Get-ChildItem Env:GIT_CONFIG_* | Remove-Item
code --new-window .

Expected behavior

Programs launched from Copilot CLI should be able to run Git normally. Internal Git hardening overrides should either be scoped to Copilot's own Git subprocesses, use a non-empty value such as core.fsmonitor=false, or otherwise remain a complete valid indexed block in child applications.

Additional context

  • OS: Windows NT 10.0.26200.0, x64
  • PowerShell: 7.6.5
  • VS Code: 1.134.0, x64
  • Git: 2.55.0.windows.3
  • Copilot CLI's safe.bareRepository=explicit hardening is intentional; the failure is specifically the process-wide propagation of an empty indexed value into a GUI child process.

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Nel report non sono indicati file del repository né test. Inizia riproducendo l’avvio Windows di code . e tracciando dove Copilot CLI costruisce ed esporta l’ambiente GIT_CONFIG_* indicizzato; confrontalo con l’esecuzione diretta di Git. Il lavoro è completato quando le applicazioni figlie ricevono un blocco completo e valido, oppure nessun blocco a livello di processo, e git rev-parse --show-toplevel ha esito positivo in VS Code.

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

Valutazione

Stack tecnologico
git, shell, vscode
Ambito
cli, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.