Make `--name` create or resume a session
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
Describe the feature or problem you'd like to solve
copilot --name <name> creates a new named session, but it does not resume an existing session with that name. After the first launch, users and automation must know whether the session exists before selecting --name <name> or --resume <name>.
The same distinction breaks CLI relaunches. A session started with copilot --name project-a can fail during /update when the replacement process receives both the original --name and an internal --session-id:
error: option '-n, --name <name>' cannot be used with option '--session-id <id>' when it resolves to an existing or remote session or task.
--name only names a brand-new session created by --session-id=<new-uuid>; the resolved session was not renamed.
Proposed solution
Give copilot --name <name> create-or-resume behavior. --name should use the same name lookup and matching rules as --resume <name>:
- If no session matches, create a session with that name.
- If exactly one session matches, resume that session.
- If multiple sessions match, follow the current
--resume <name>ambiguity behavior. Do not create another session. - Resume the selected session when
/restart,/update, or another command relaunches the CLI. A retained--nameshould not fail because the session now exists or because the relaunch also carries an internal session ID.
--resume should remain available for three uses: session IDs, the session picker, and existing workflows. Users and automation could then use one repeatable command whenever a stable name identifies the session.
Example prompts or workflows
- The first
copilot --name project-ainvocation creates a named session. - A later
copilot --name project-ainvocation resumes that session. /updateor/restartresumes that session without a flag conflict.- An alias or script can keep invoking
copilot --name project-awithout first querying session state.
Additional context
Issue https://github.com/github/copilot-cli/issues/3332 reports /restart failing in a session created with --name. The requested semantics address that failure and the broader need for one repeatable name-based command.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando la gestione della CLI per --name e --resume, quindi esamina i percorsi di rilancio utilizzati da /restart e /update. Confronta il comportamento con issue #3332 e verifica i quattro casi proposti: creare quando non ci sono corrispondenze, riprendere quando c’è una corrispondenza, mantenere la gestione attuale delle ambiguità ed evitare conflitti durante il rilancio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100