github / github/copilot-cli

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

Abierto
#4,531 1 comentario 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

area:configuration area:platform-windows
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

El informe no nombra ningún archivo del repositorio ni ninguna prueba. Empieza reproduciendo el lanzamiento de Windows de code . y siguiendo dónde Copilot CLI construye y exporta el entorno GIT_CONFIG_* indexado; compáralo con la ejecución directa de Git. Se considera terminado cuando las aplicaciones secundarias reciben un bloque completo y válido, o ningún bloque a nivel de proceso, y git rev-parse --show-toplevel tiene éxito en VS Code.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, shell, vscode
Área
cli, devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
58/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.