/restart fails when the CLI was launched with --new-session-id
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
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
copilot --new-session-id 11111111-2222-4333-8444-555555555555(any fresh UUID)- 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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/copilot-cli
-
area:configuration area:input-keyboard
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
github/copilot-cli#5159 ·
-
area:input-keyboard
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
github/copilot-cli#5113 ·
-
area:sessions
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/copilot-cli#4996 ·
-
triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
github/copilot-cli#4963 · 1 comentario ·
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
github/copilot-cli#4932 ·
Todos los issues de github/copilot-cli
Issues similares
-
area: compat area: parsing bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
reubeno/brush#1526 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Micke-K/IntuneManagement#441 ·
-
review-2026-10 Trad En
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
zigbeefordomoticz/wiki#302 ·
-
Change from TAP TSI to TEL TSIAbiertorefactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
UnionInternationalCheminsdeFer/OSDM#1647 ·
Los mantenedores suelen responder en 1 día
-
Add dependabotAbiertofeat
Dificultad 2/5 Menos de una hora Aptitud para principiantes 72/100
open-nudge/opentemplate#204 ·
Los mantenedores suelen responder en 1 día