github / github/copilot-cli

Make `--name` create or resume a session

オープン
#4,642 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

triage
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

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>:

  1. If no session matches, create a session with that name.
  2. If exactly one session matches, resume that session.
  3. If multiple sessions match, follow the current --resume <name> ambiguity behavior. Do not create another session.
  4. Resume the selected session when /restart, /update, or another command relaunches the CLI. A retained --name should 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
  1. The first copilot --name project-a invocation creates a named session.
  2. A later copilot --name project-a invocation resumes that session.
  3. /update or /restart resumes that session without a flag conflict.
  4. An alias or script can keep invoking copilot --name project-a without 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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず --name と --resume の CLI 処理を追跡し、次に /restart と /update で使用される再起動経路を調べます。issue #3332 と動作を比較し、提案された 4 つのケースを検証します。一致しない場合は作成する、一致が 1 件の場合は再開する、現在の曖昧性の処理を維持する、再起動中の競合を回避する、の 4 つです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。