/restart fails when the CLI was launched with --new-session-id
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- cli, javascript
- Domaine
- cli
Piste de recherche
L'argv de redémarrage est construit dans cli-main.js (1.0.98) : repérez l'helper de nettoyage qui retire --session-id, --resume et les options associées de process.argv.slice(2). Ajoutez --new-session-id et --new-session-id= à cette liste, en consommant la valeur suivante pour la forme sans =. Vérifiez en lançant avec --new-session-id <uuid> puis en exécutant /restart ; l'argv reconstruit ne doit contenir qu'un seul flag de session.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Shell
- Étoiles
- 11.3k
- Forks
- 2k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/copilot-cli
-
area:configuration area:input-keyboard
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
github/copilot-cli#5159 ·
-
area:input-keyboard
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
github/copilot-cli#5113 ·
-
area:sessions
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/copilot-cli#4996 ·
-
triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
github/copilot-cli#4963 · 1 commentaire ·
-
triage
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
github/copilot-cli#4932 ·
Toutes les issues de github/copilot-cli
Issues similaires
-
area:cli bug good first issue priority:medium
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
rtk-ai/rtk#4615 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
MicrosoftDocs/PowerShell-Docs#13332 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
package-update
Difficulté 1/5 Moins d'une heure Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Add a script to fund and create fresh testnet player identitiesPeut-être pris @chiemezie1 l’a pris aujourd’hui. Ouvertegood first issue Stellar Wave
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
OlaGreat/starbound-realms#119 · 1 commentaire ·
-
base-files: 82_config_generate: regenerate /etc/board.json if 0-bytes / truncated after power cutOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
openwrt/openwrt#25940 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour