Long-running work needs recovery
An agent that can continue after interruption needs more than a retry loop. It needs durable task state, idempotent actions, refreshed authority, and an honest account of what is still true.
Most useful work does not fit into one uninterrupted session. A task waits for an approval, a dependency registry is temporarily unavailable, a preview takes longer than expected, or another person changes the priority. In each case, the agent needs to stop without turning the next attempt into a fresh guess.
This is why recovery is a core property of agent infrastructure, not a convenience feature.
Retrying is not resuming
A retry says, "Run this operation again." Resumption says, "Continue the task from a known state without repeating work that may already have had an effect."
The difference is easy to miss until an agent touches an external system. A request to create a ticket may have succeeded even though the network response was lost. A deployment may be active even though the local process exited. A migration may have completed one step and failed at the next. Blindly repeating these actions can create duplicates, overwrite a correct state, or make recovery more difficult.
Long-running tasks need a durable record of what was attempted, what was observed, and what remains unknown. They need identifiers that can be checked against external systems, actions designed to be idempotent where possible, and explicit pauses where an action cannot safely be repeated.
A pause should be a legible state
There is a large difference between "the agent stopped" and "the task is waiting for review of a deployment preview." The second statement tells a person what happened, what is needed next, and what artifacts to inspect. The first forces them to reconstruct the situation from logs and conversation.
Useful pause states are specific:
- blocked on a missing or expired credential;
- waiting for a named approval with a defined scope;
- paused after a retryable external failure;
- awaiting a dependent task or service;
- ready for review with evidence attached;
- halted because an assumption was invalidated.
The runtime should preserve this state with the task rather than relying on the model to remember it later. When the task resumes, it can refresh the assumptions that may have changed: the branch revision, environment availability, approvals, resource budgets, and the state of any external action.
Durable work requires a recovery plan
Not every task needs a formal runbook. But consequential tasks should be designed with recovery in mind before they begin.
For an engineering change, that may mean using a branch, committing meaningful progress, and recording which checks were run. For an external workflow, it may mean storing an operation identifier, writing a draft before sending, or making the final action require approval. For a data operation, it may mean defining a checkpoint and a rollback path rather than treating the process as one opaque command.
This design protects people as much as systems. An engineer returning to a paused task should not have to guess whether the agent already sent a message or altered a record. A reviewer should not have to grant a new approval because the system cannot tell whether the old one was consumed. A new agent should not inherit stale authority just because it inherited a summary.
Freshness is part of recovery
Resuming a task does not mean treating every stored fact as current. Some parts of the task are durable; some need to be checked again.
The objective may still be valid, but the branch could have moved. A test result may have been correct for the original revision but stale after a dependency update. A deployment URL may no longer describe the running application. A connector grant that was appropriate yesterday may have expired or been revoked after a policy change.
The runtime should distinguish these cases instead of presenting a paused task as a frozen, perfect snapshot. On resumption, it can check the workspace revision, refresh resource availability, validate unconsumed approvals, and mark evidence that no longer corresponds to the current state. This does not have to be intrusive. It is simply an acknowledgement that the environment continues changing while the task waits.
The same discipline protects against confused retries. If an external operation has a stable identifier, the agent can query its state before issuing another request. If an action cannot be made idempotent, the task can pause for review rather than guessing whether duplicate execution is harmless. A recovery path that refuses to fabricate certainty is more useful than one that moves quickly in the wrong direction.
Recovery exposes the real unit of work
When a task can pause and resume cleanly, it becomes clear what the system actually treats as durable: the objective, the workspace, the permissions, the evidence, and the outstanding decision. These are the parts that survive a model restart, an operator handoff, or a transient outage.
That is a better unit of work than a long conversation. It respects the fact that real systems change while tasks are in flight, and it gives both humans and agents a way to continue without pretending those changes did not happen.
Reliable agentic software will not be defined by agents that never stop. It will be defined by systems that know how to stop without losing the thread.
长时间运行的工作需要恢复能力
能够在中断后继续的 Agent 需要的不只是重试循环,还需要持久任务状态、幂等动作、刷新后的权限,以及对当前事实的诚实记录。
大多数有用的工作都无法在一个不中断的 session 里完成。任务可能等待审批,依赖仓库暂时不可用,预览比预期花费更久,或者另一个人改变了优先级。在这些情况下,Agent 需要停下来,却不能让下一次尝试重新变成一次没有依据的猜测。
所以,恢复能力是 Agent 基础设施的核心属性,而不是便利功能。
重试不等于恢复
重试的意思是:“再次运行这个操作。”恢复的意思是:“从已知状态继续任务,不重复执行可能已经产生影响的工作。”
只有当 Agent 触及外部系统时,这个区别才会真正暴露出来。创建工单的请求可能已经成功,只是网络响应丢失;部署可能已经生效,只是本地进程退出;迁移可能完成了一步,却在下一步失败。盲目重复这些动作,会制造重复记录、覆盖正确状态,或让恢复更加困难。
长时间运行的任务需要持久记录已尝试什么、观察到什么,以及哪些事实仍然未知。它需要可向外部系统核验的标识符,在可能的地方使用幂等动作,并在无法安全重复时明确暂停。
暂停应该是一种可理解的状态
“Agent 停止了”和“任务正在等待部署预览的 review”之间有很大差别。后者告诉人发生了什么、下一步需要什么,以及应该查看哪些产物;前者只会迫使人从日志和对话中重新构建上下文。
有用的暂停状态应该具体:
- 被缺少或过期的凭证阻塞;
- 等待一个范围明确的审批;
- 在一次可重试的外部失败后暂停;
- 等待依赖任务或服务;
- 已附带证据,准备 review;
- 因为某项假设失效而停止。
运行时应该把这些状态和任务一起保存,而不是依赖模型稍后记住。任务恢复时,可以刷新可能已经改变的假设:分支 revision、环境可用性、审批、资源预算和外部动作状态。
持久工作需要恢复计划
不是每个任务都需要正式的 Runbook,但有后果的任务应该在开始前考虑恢复。
对工程变更来说,这可能意味着使用分支、提交有意义的进度,并记录运行过哪些检查。对外部工作流来说,可能意味着保存操作标识符、在发送前先写草稿,或让最终动作必须审批。对数据操作来说,可能意味着定义检查点和回滚路径,而不是把过程当成一个不透明的命令。
这样的设计也保护人。回到暂停任务的工程师不应该猜 Agent 是否已经发了消息或修改了记录。Reviewer 不应该因为系统无法确认旧审批是否已经使用,就被迫重新批准。新的 Agent 也不应该只因为继承了一段摘要,就继承过期权限。
新鲜度是恢复的一部分
恢复任务不意味着把所有保存的事实都当成当前事实。有些部分可以持久保留,有些部分必须重新检查。
目标可能仍然有效,但分支可能已经移动。测试结果可能对原始 revision 正确,却在依赖升级后失效。部署 URL 可能已经不再指向正在运行的版本。昨天合适的工具授权,今天可能已经过期或被撤销。
运行时应该区分这些情况,而不是把暂停任务呈现成冻结而完美的快照。恢复时可以检查工作区 revision、刷新资源可用性、验证未消费的审批,并标记与当前状态不再对应的证据。这不是额外干扰,只是承认任务等待时环境仍在变化。
同样的纪律也能防止混乱重试。如果外部操作有稳定的标识符,Agent 可以先查询状态,再发出下一次请求。如果动作无法幂等化,任务可以停下来等待 review,而不是猜重复执行是否无害。拒绝伪造确定性的恢复路径,比快速走向错误方向更有用。
恢复会暴露真正的工作单元
当任务能够干净地暂停和恢复时,系统真正视为持久的内容就变得清楚:目标、工作区、权限、证据和未决决定。这些部分可以跨越模型重启、人员交接或短暂故障继续存在。
这比一段很长的对话更适合作为工作单元。它承认任务进行时真实系统会变化,也让人和 Agent 都能够在不假装这些变化不存在的情况下继续工作。
可靠的 Agent 软件,不会由从不停止的 Agent 定义,而会由知道如何停止、又不会丢失上下文的系统定义。