archive_session times out after 60 seconds and leaves large worktrees orphaned
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
`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
贡献指南
调研方向
从 archive_session 入口开始,将其清理状态与超时后 get_session 报告的状态进行比较。如果可能,在大型关联 worktree 上复现 60 秒失败,然后跟踪报告了哪个 Git 操作以及哪些清理步骤。完成标准包括超时处理、结构化的剩余状态、安全的重试或恢复,以及有文档说明的部分归档行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100