Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

/restart fails when the CLI was launched with --new-session-id

Abierto Apto para principiantes
#5,147 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cli, javascript
Área
cli

Línea de trabajo

El argv de reinicio se construye en cli-main.js (1.0.98): busca el helper de eliminación que quita --session-id, --resume y flags relacionados de process.argv.slice(2). Añade --new-session-id y --new-session-id= a esa lista, consumiendo el valor siguiente en la forma simple (sin =). Verifícalo iniciando con --new-session-id <uuid> y ejecutando /restart; el argv reconstruido debería contener solo una flag de sesión.

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

Descripción

area:sessions
What happened

Launching the CLI with --new-session-id <uuid> and then running /restart fails every time:

error: the argument '--new-session-id <id>' cannot be used with '--session-id <id>'

Usage: copilot --log-dir <directory> --plugin-dir <directory> --add-dir <directory> --additional-mcp-config <json> --yolo

For more information, try '--help'.

By the time this surfaces the foreground session has already been shut down, so the restart is not recoverable.

Repro
  1. copilot --new-session-id 11111111-2222-4333-8444-555555555555 (any fresh UUID)
  2. Run /restart

This matters for embedding hosts, which pass --new-session-id on every session launch, so /restart is permanently unusable there rather than occasionally.

Cause

/restart rebuilds the child argv from process.argv.slice(2), strips the session-selection flags, then appends --session-id <current session id>.

In cli-main.js (1.0.98) the strip helper removes -r, --resume, --resume=, --session-id, --session-id=, --continue, --cloud, -i, --interactive, --interactive=, --experimental, --no-experimental, --fleet and -C. --new-session-id is absent from that list, so it survives into the restart argv next to the freshly appended --session-id, and the parser declares the two mutually exclusive.

The same rebuilt argv is persisted for the supervised restart path, so both the supervised and unsupervised paths fail identically.

Expected

The strip helper should drop --new-session-id and --new-session-id=<uuid>, consuming the following value in the bare form, exactly as it already does for --session-id. The session exists by restart time, so re-asserting a creation ID is both wrong and rejected.

Workaround

Patching the strip helper locally to treat --new-session-id like --session-id resolves it, but the file lives in the extracted package folder and the fix is lost on every CLI update.

Version

1.0.98 on Windows, win32-x64.

Lenguaje dominante
Shell
Estrellas
11.3k
Forks
2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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.

Más de github/copilot-cli

Todos los issues de github/copilot-cli

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.