github / github/copilot-cli

Feature Request: Selective per-file accept/revert for Copilot CLI agent changes like `git add -p`

Aperta
#3,640 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:sessions area:tools
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### Describe the feature or problem you'd like to solve

After Copilot CLI applies file changes in a turn, the only recovery option is `/rewind` which reverts **everything** in that turn. There is no way to selectively keep some file changes while discarding others.

### Proposed solution

1. **post-apply interactive review**: After a turn completes, offer a `/review-changes` command that lists modified files and lets you revert selected ones
2. **`/rewind --file `**: Extend `/rewind` to accept a file path argument
3. **Plan mode enhancement**: In plan mode, show actual code diffs (not just natural language descriptions) before execution, with per-file approval
4. **VS Code `/ide` integration**: When connected via `/ide`, route file-level accept/discard through VS Code's native diff editor

Any of these would be a significant improvement over the current all or nothing model

### Example prompts or workflows

After a turn applies file changes, users should be able to selectively accept or revert on a **per-file** basis and ideally **per chunk** within a file similar to `git add -p`.

Something like:

Copilot modified 5 files. Review changes?
[1] src/auth.ts - 12 lines changed [keep/revert]
[2] src/config.ts - 4 lines changed [keep/revert]
[3] tests/auth.test.ts - 28 lines changed [keep/revert]

### Additional context

### Problems

| Mechanism | Granularity | Limitation |
|---|---|---|
| Write permission prompt | Per write-call | Binary yes/no; one call can touch many files |
| `/diff` | Read-only, post-apply | Shows changes but cannot act on them |
| `/rewind` | Entire turn | All-or-nothing cannot keep partial changes |

`/rewind` is a blunt instrument - it treats a multi-file turn as atomic. Real-world agent tasks often span several files, and it's common for most changes to be correct while one file went in an unintended direction. Forcing an all-or-nothing revert actively works against iterative, confident use of the agent.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing the existing /rewind and /diff command flows and the /ide integration described in the issue. Clarify which proposal is in scope, then define completion around selectively keeping or reverting changes at file or chunk granularity after a multi-file turn, with an appropriate review or integration test.

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

Valutazione

Stack tecnologico
git, shell, vscode
Ambito
cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.