github / github/copilot-cli

[CLI] copilot --resume "Name With Spaces" fails silently with exit 1

未關閉
#3,754 2 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area:sessions
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

## Summary
`copilot --resume ""` fails with exit code 1 and no output whenever `` contains spaces, even when the name is an exact, case-correct match for an existing session created via `--name`. Names without spaces (e.g. kebab-case) resolve correctly.

This contradicts the documented usage in `copilot --help`:

```
# Resume a session by name
$ copilot --resume="my feature"
```

That example cannot work today.

## Version
- Copilot CLI **1.0.61**
- Windows 11, PowerShell 7
- Launched via the `agency` wrapper (the standard Windows install)

## Reproduction

Resuming with the command copilot provides after `/exit`
Image

But with just `copilot --resume`:
Image

```powershell
# 1. Create a session with a spaced name
copilot --name "Spaced Name Session" -p "echo init" --allow-all-tools --no-ask-user
# exit 0, session created. workspace.yaml shows: name: Spaced Name Session

# 2. Resume by that exact name
copilot --resume "Spaced Name Session" -p "echo go" --allow-all-tools --no-ask-user
# Observed: exit 1, no stdout, no stderr.
```

Control (changes only one variable — removing the spaces):
```powershell
copilot --name "UnspacedSession" -p "echo init" --allow-all-tools --no-ask-user
copilot --resume "UnspacedSession" -p "echo go" --allow-all-tools --no-ask-user
# Observed: exit 0, session resumes correctly.
```

Both `--resume "Name"` and `--resume="Name"` forms fail identically for the spaced case. Failure also reproduces against a real long-running session whose `name` contains spaces.

## Expected
Either:
1. Spaced names resolve correctly (matching the documented example), OR
2. The CLI emits a clear error explaining the lookup failed and exits non-zero.

Current silent exit with no diagnostic output sends users down the wrong debugging path: shell quoting, terminal lock, session in-use, version skew. Each of those is a plausible suspect for an exit-1-with-no-output failure.

## Workarounds (none acceptable as a fix)
- `copilot --resume <7-char-id-prefix>` works but defeats the purpose of friendly names
- `copilot --resume` (interactive picker) works but requires UI interaction
- Rename to kebab-case works but loses readability

## Why this matters
The documented and expected workflow for users who name sessions with descriptive labels (the example in `--help` is literally `"my feature"`) is broken. Every user who follows the docs hits a wall. The silent failure mode multiplies the cost.

貢獻指南

開啟貢獻指南

研究方向

從 `copilot --resume` 入口開始,在 PowerShell 中重現文件記錄的名稱含空格情況,同時重現不含空格的對照情況。追蹤名稱查找流程,並驗證含空格的名稱要麼能夠成功恢復,要麼產生明確的診斷,而不是靜默退出並返回 exit 1。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
powershell, shell
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
描述清楚
新手友好度
58/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。