github / github/app

[1.1.10][Windows] CLI-session visibility migration deletes workspace link and cannot re-import it

Aperta
#2,944 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
triage
Lingua principale
Nessun dato sulla lingua
Stelle
2.1k
Fork
153
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing the 1.1.10 migration and the list_workspaces reconciliation calls, especially the settings transition from cli_max_age_days=0 to 90. Compare workspace, workspace_checkout_bindings, and activity_items against the automatic pre-update backup while retaining the sessions row. Done means visibility changes no longer delete links or activity data, and a qualifying orphaned CLI session can be restored when 90 days is selected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
sqlite
Ambito
cli, database, desktop
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.