Agent sessions killed by an interruption should be resumable from their on-disk transcript (explicit revive opt-in)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- ai-infra-agents, cli
调研方向
Start by locating the session state-transition logic and the existing idle-session rehydration path used when continuing from an on-disk transcript. Identify the message/continue API where an explicit revive opt-in and machine-readable stop reason would fit, then add focused tests for failed, cancelled, running, and normal-completion sessions. Done means opt-in revival retains prior context, non-opt-in behavior remains unchanged, and callers can distinguish active sessions from dead sessions after a restart.
由索引模型根据 Issue 内容生成。
描述
Summary
A background agent session that is interrupted — because the agent host restarts, the editor crashes, the model endpoint restarts mid-response, or the operator accidentally sends a destructive interrupt — lands in a terminal state (failed / cancelled) that cannot be revived, even though the conversation transcript for that session is still on disk and the session is still listed. A session in idle state can be sent a message and continues with its full context intact, which shows the rehydration machinery already exists; it just isn't reachable for the states that actually need it.
The result is that a single interruption converts in-flight work into a from-scratch re-dispatch, and anything the agent knew that wasn't written to disk is gone.
Observed behavior
Background sub-agent sessions tracked by the host survive a restart in the agent list with their titles and history visible. Attempting to continue one, however, is refused based on its status:
- A session in
idleaccepts a follow-up message and resumes with full prior context. Repeatedly verified, including after three interruptions in one incident. - A session reported as
failedrefuses:
Agent <id> is failed and cannot receive messages. - A session that was started in synchronous mode refuses, even when it is otherwise continuing normally:
Agent <id> is in sync mode. A new background task must be started with a self-contained prompt.
The two refusals are correct as statements of the current design, but they mean there is no path back for the case that matters: the agent was doing good work, the transport underneath it died through no fault of the agent or the operator, and the transcript needed to continue is sitting right there.
Why this matters
The cost is asymmetric. Re-dispatching means the new agent has to rediscover everything the dead agent had already read — for a research or code-modification task that is often the majority of the work — and if the dead agent had acquired any exclusive resource (a lock file, a scratch directory, a reservation on a file it was about to write), the successor has to reason about state the dead agent left behind without being able to ask it what it had done.
Meanwhile the recovery signal is unreliable at exactly the moment it is needed. During the incident that prompted this report, the session list returned an incomplete set, then zero sessions, then a partial set again, while the host itself stayed responsive. So an operator cannot reliably tell "this agent is still working" from "this agent died and I need to restart it," and a naive re-dispatch risks two agents doing the same write at once.
What I'd expect
- A session whose turn ended due to a transport/host/endpoint interruption should remain resumable, not terminal. If the distinction is hard to make reliably, an explicit
forcepath is perfectly acceptable. - An explicit opt-in parameter on the message/continue path — something like
revive: true— so that resuming afailedorcancelledsession is a deliberate act by the caller, not an accident, and not a change in behavior for callers who don't ask for it. I'd find a parameter that says "I understand I am reviving this session and it may need to recover" entirely satisfactory. - A machine-readable reason for why the session stopped, distinguishable at least between: operator cancellation, an interruption caused by a host or endpoint failure, a timeout, and a normal completion. That single field would let orchestration logic decide between "revive it" and "re-dispatch it" instead of guessing.
Acceptance criteria
- Given a background agent session in
failedorcancelledstate whose transcript exists on disk, a caller can resume it with an explicit opt-in and the agent retains its prior context. - Resuming without the opt-in keeps today's refusal, so nothing that currently fails silently starts working by accident.
- The session record exposes why it stopped, in a form a program can branch on rather than a display string.
- A caller can distinguish "still running" from "dead and awaiting revival" after a host restart, from a source other than timing out.
Environment
Editor-integrated Copilot on Windows, agent sessions driven from an interactive chat as background sub-agents. Reproduced across several sessions in one incident on 2026-11-28.
I have not included repository, project, or infrastructure details; they aren't needed to reproduce the status-transition behavior described above.
- 主要语言
- Python
- 星标
- 11.5k
- 派生
- 2k
- 平均合并
- 6 小时 34 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-cli 的其他 Issue
-
area:plugins
难度 2/5 1-3 小时 新手友好度 75/100
github/copilot-cli#5567 ·
-
难度 1/5 1-3 小时 新手友好度 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncation未关闭area:tools
难度 2/5 1-3 小时 新手友好度 72/100
github/copilot-cli#5476 ·
-
triage
难度 1/5 1 小时以内 新手友好度 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
难度 1/5 1 小时以内 新手友好度 74/100
github/copilot-cli#5340 ·
查看 github/copilot-cli 的全部 Issue
相似的 Issue
-
fidelity
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
backlog
难度 2/5 1-3 小时 新手友好度 72/100
sagemathinc/sagebrush#3434 ·
维护者通常 1 天内回复
-
marketing
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
wuisabel-gif/MemWhale#576 ·
维护者通常 1 天内回复
-
Status: Triage Suggestion
难度 2/5 1-3 小时 新手友好度 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
维护者通常 1 天内回复