[1.1.10][Windows] CLI-session visibility migration deletes workspace link and cannot re-import it
- 主要语言
- 没有语言数据
- 星标
- 2.1k
- 派生
- 153
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Short summary
Updating to 1.1.10 silently removed an existing CLI-backed workspace when the new Show Copilot CLI Session setting defaulted to Off. The transcript survived, but the workspace link and 101 activity records were deleted; selecting 90 days did not restore it.
### Affected version or release
GitHub Copilot App 1.1.10 (database schema user_version 79 -> 91)
### Installation context
Windows 11 Enterprise 24H2, build 26100; local in-place repository workspace; CLI-created session imported into Copilot App before the update.
### What happened?
I had a long-running CLI-backed session that was visible and usable in Copilot App before the update. It contained approximately 88 MB / 21,574 events and had current activity well within 90 days.
At app launch, logs show:
```text
Applying deferred update on app launch version=1.1.10
Created pre-update database backup ... target_version="1.1.10"
list_workspaces {"cli_max_age_days":0}
```
A read-only comparison of the automatic pre-update backup with the migrated database showed:
| Table | Before | After migration |
|---|---:|---:|
| `sessions` | 2 | 2 |
| `workspaces` | 2 | 1 |
| `workspace_checkout_bindings` | 2 | 1 |
| `activity_items` | 107 | 8 |
The missing workspace was the CLI-backed session. Its `sessions` row and on-disk `events.jsonl` remained intact, but its `workspaces` row, checkout binding, and 101 associated activity rows were gone (consistent with FK cascade behavior). The UI presented this as complete session loss: it disappeared from both sidebar and search. It could still be resumed only by knowing its UUID and running `copilot --resume=`.
Changing **Settings -> Sessions -> Show Copilot CLI Session** to 90 days sent:
```text
list_workspaces {"cli_max_age_days":0}
list_workspaces {"cli_max_age_days":90}
```
The setting persisted as 90, but the orphaned session was not re-imported and remained absent.
To confirm the behavior, I restored only the deleted workspace/binding/activity rows from the automatic backup while retaining schema 91. The session became usable in the app immediately. Opening/changing the setting caused the app to send `0` first and delete those restored rows again; the subsequent `90` request still did not recreate them. A second manual restore under the persisted 90-day setting was required.
### Steps to reproduce
1. On a version before 1.1.10, have a CLI-created session imported into Copilot App and linked to an in-place repository workspace.
2. Update to 1.1.10.
3. Let the new CLI-session visibility setting use its default Off value.
4. Observe that the session disappears from sidebar and search.
5. Change the setting to 90 days while the session's last activity is within 90 days.
6. Observe that it remains missing.
7. Compare the pre-update backup with the current database: the CLI session row remains, but its workspace, checkout binding, and activity rows have been deleted.
### Expected behavior
1. A visibility preference must hide records, not delete workspace links or activity data.
2. Upgrading must preserve sessions that were already visible before the setting existed, or explicitly prompt before hiding them.
3. Selecting 90 days must re-import any qualifying session even if its `sessions` row exists but its workspace link is missing.
4. A settings control must not transiently reconcile at `0` before applying the selected value.
5. Reconciliation should repair orphaned CLI sessions rather than silently skip them.
6. The app should expose a recovery action instead of making a large session appear destroyed.
### Additional context
No private transcript or repository data is attached. The automatic pre-update database backup and sanitized logs are preserved and can be provided privately. `PRAGMA integrity_check` passes; this is referential/reconciliation behavior, not SQLite corruption.
贡献指南
调研方向
首先跟踪 1.1.10 迁移和 list_workspaces 的协调调用,尤其要关注设置从 cli_max_age_days=0 变为 90 的转换。将 workspace、workspace_checkout_bindings 和 activity_items 与更新前的自动备份进行比较,同时保留 sessions 行。完成标准是:可见性变化不再删除链接或活动数据,并且在选择 90 天时,可以恢复符合条件的孤立 CLI 会话。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- sqlite
- 领域
- cli, database, desktop
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100