github / github/copilot-cli

Plan indicator leaks across conversations after headless session switches

未关闭
#4,249 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:non-interactive area:sessions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

When the IDE switches one headless Copilot CLI process between two conversations that share the same repository, worktree, and branch, the plan indicator/path can remain bound to the previously active conversation.

Observed result:

- Conversation A had a physical per-session `plan.md`.
- Conversation B had no `plan.md` and an empty per-session task database.
- While B was active, the IDE displayed A's session-specific `...\A\plan.md` beside B.
- The UI for A simultaneously claimed that A did not have a plan.
- Nothing had moved on disk: A's plan remained under A's session-state directory and B's directory had no plan.

The CLI/backend session state was correctly isolated; the visible conversation-to-plan association was reversed/stale.

### Affected version

```text
Copilot IDE 1.12.1
Copilot CLI backend 1.0.71
VS Code 1.130.0
Windows x64
```

### Steps to reproduce the behavior

1. Open two IDE conversations for the same repository/worktree/branch.
2. In conversation A, enter plan mode and create/update `plan.md`.
3. Leave conversation B without a plan.
4. Switch repeatedly between A and B so the IDE resumes both through the same headless CLI process.
5. Observe the plan indicator/path after B becomes active.

In the affected run, sanitized debug logs showed the same process repeatedly alternating:

```text
resume A -> Workspace initialized A
resume B -> Workspace initialized B
resume A -> Workspace initialized A
resume B -> Workspace initialized B
```

After the final `Workspace initialized B`, B displayed A's plan path. The local IDE metadata cache contained A but had no entry for B.

### Expected behavior

Plan state must be keyed and rendered strictly by conversation/session ID:

- Activating B must clear A's plan indicator before B is rendered.
- A conversation without `plan.md` must never inherit a plan based on shared cwd, repository, branch, process, or prior active state.
- Session resume/switch should atomically update conversation content, plan state, task state, and metadata-cache ownership.
- If the active session lacks a cache entry, the UI should query that session or show no plan rather than retaining the previous session's plan.

### Additional context

The backend evidence rules out a filesystem move or shared SQL state: each conversation retained its own session directory/database, and the active session's injected context pointed at the correct session folder. This appears to be stale IDE/session-controller state during rapid headless session switching.

The IDE package points to a separate private repository that is not accessible to either configured GitHub identity, so this is filed against the CLI/session tracker for routing. No private logs or conversation content are attached.

贡献指南

打开贡献指南

调研方向

跟踪交替出现的“Workspace initialized A/B”事件周围的无头会话恢复和切换,然后检查计划状态和元数据缓存所有权如何与当前会话关联。完成标准是:切换到没有 plan.md 的会话时,清除之前的指示器,并使计划、任务、内容和缓存状态都以该会话为键。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。