github / github/copilot-cli

archive_session times out after 60 seconds and leaves large worktrees orphaned

Ouverte
#4,246 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:sessions
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

`archive_session` can time out while tearing down a large repository worktree, leaving the session and worktree behind without enough information to recover safely. This can consume substantial disk space and prevent reuse of the session branch.

## What happened

1. A native `archive_session` call tried to archive a terminally errored local project session with no file changes. The session used a linked worktree for a large repository.
2. The call returned:

```text
Failed to archive session: git command timed out after 60 seconds
```

3. Retrying once returned the same output.
4. After the first timeout, `get_session` still reported the session, branch, and worktree path, so cleanup had not completed.
5. The specific Git operation that timed out is unknown. The result did not say which operation failed, whether its subprocess was cancelled, which cleanup steps succeeded, or whether retrying or manual cleanup was safe.

The only safe immediate response was to leave the failed session isolated and create another session. That workaround can leave a large worktree on disk and keep its branch in use. The affected Copilot CLI version was not captured.

## Expected

Archiving should either complete for large worktrees or stop cleanly with enough structured state and supported recovery guidance to finish cleanup safely.

## Done when

- [ ] Worktree teardown uses a timeout that scales with repository size, is configurable, or assigns suitable budgets to individual Git operations.
- [ ] A timed-out Git subprocess is actually cancelled and cannot continue changing the worktree after the tool returns.
- [ ] Failure results identify the Git operation, cancellation outcome, completed cleanup steps, and remaining session, branch, and worktree state in a structured form.
- [ ] Cleanup is idempotent and resumable, or a supported cleanup primitive can safely finish a partially completed archive.
- [ ] Documentation explains when retrying is safe, how to inspect partial state, and how to recover without losing work or corrupting Git metadata.

## Related

- https://github.com/github/copilot-cli/issues/4145
- https://github.com/github/copilot-cli/issues/3675
- https://github.com/github/copilot-cli/issues/3518

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez au point d’entrée archive_session et comparez son état de nettoyage avec ce que get_session signale après un délai d’expiration. Reproduisez l’échec après 60 secondes avec un worktree lié volumineux si possible, puis déterminez quelle opération Git et quelles étapes de nettoyage sont signalées. Le travail est terminé lorsque la gestion du délai d’expiration, l’état restant structuré, une nouvelle tentative ou une récupération sûres, ainsi que le comportement documenté en cas d’archivage partiel sont assurés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, shell
Domaine
cli
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.