发布于 更新于 Published Updated
目录Table of Contents

长程 Agent:状态、计划与可验证的数小时执行

Jul 2026 · Long-Horizon Agents / Memory / Planning / Harness Engineering

长程 agent 不是把 timeout 从 10 分钟改成 10 小时,也不是把所有历史塞进更长 context。它是一个可恢复的状态机:在持续变化的环境里维护目标和约束、把计划分解为可验证的局部行动、在失败后从正确边界恢复,并让外部 evaluator 能够判断最后完成的究竟是任务、奖励代理,还是一段看起来很忙的轨迹。

中心命题:长程结果属于完整配置,而不是底层模型:model + native harness + state store + tool/authority policy + environment + evaluator + time/cost budget。任何只报最终 success rate 的报告,都无法说明中断、恢复、重试、权限和资源是否悄悄改变了结论。

1. 什么算“长程”,什么不算

一次长程运行至少同时具有四个条件:状态跨多个决策仍有因果关系;中间错误会改变之后的可行路径;agent 需要在局部反馈与全局约束之间取舍;中断后必须从外部工件重建而不是靠聊天记忆猜测。这样定义后,长程的难点不在“步数多”,而在依赖、恢复和可问责性

观察到的现象 可以支持的结论 不应推出的结论
一次长轨迹最终成功 该配置完成过一个特定初态的任务 模型具有稳定的长期能力
工具调用很多、context 很长 运行消耗了很多行动或上下文 状态被正确维护或计划正确
断点后能够继续 某个恢复路径在已测初态可用 所有外部服务和副作用都可安全 replay
多 worker 并行更快 该调度在给定预算和任务上有吞吐收益 团队本身更可靠或更便宜

WildClawBench 的价值在于把 native CLI harness 也放回评测配置:在其容器化任务中,同一模型切换 harness 会显著改变结果。它支持“long-horizon performance 属于 model-harness configuration”的结论,而不是建立某个模型的脱离运行时的固定排名。

2. 先标注任务包络:长程、单题大工程与科学工作流不是同一主张

“长程”描述的是执行和依赖,不是一个统一的任务类型。LongCLI-Bench 将需求满足与回归避免分成 dual-set 测量,说明一次终态测试不足以描述长程编程的失败位置。Terminal-Bench Challenges 则是 token-intensive、单题大工程;其运行文档明确允许自定义、有状态的 rollout 处理 checkpoint、orchestration、retry 与 memory,同时保留 task source 和 verifier 作为契约。

另一方面,截至 2026-07-13,Terminal-Bench Science 仍在建设中,定位为自然科学中的计算工作流:要求容器化、程序化且确定性的验证,并明确不把开放式假说生成或文献综述当作目标。它适合研究“能否完成一个受约束、可复核的科学计算 workflow”,不等于已发布的科学基准成绩、独立科研发现,或数天持续服务的证据。

任务包络 最直接验证什么 仍必须补什么 不能据此声称什么
长程 CLI / 软件任务 需求、回归与早期失败位置 初态、harness、预算与恢复 trace 一次 pass 证明跨日稳定运行
单题大工程 challenge 一个大型工件在受控 task/verifier 下能否完成 checkpoint、重试、并行、人类介入和取消账本 大工程成功已测量所有恢复或安全性质
科学计算 workflow 一个预声明、可程序验证的计算过程 材料/环境谱系、确定性、负结果与领域复核 完成 workflow 等于提出新假说、做出发现或发表论文
数小时到数天的持续服务 状态能否跨等待、故障和 session 延续 时间 ledger、故障注入、外部状态漂移与安全停机 更长 timeout 或更多 token 本身证明可靠性

因此每个报告先写清 task envelope,再写 agent 运行了多久。否则“science”“challenge”“long-horizon”会把完全不同的 verifier、时钟和结论混成一个分数。

3. Memory 与状态:从相似度检索到可恢复、可验证的执行状态

无论任务包络是哪一种,长程 agent 的状态都不是聊天摘要。Agent memory 常被简化成“把历史放进向量库,必要时检索回来”。这在问答或个人化场景中有用,但不足以支撑长程行动:一个 agent 还要知道什么已提交、什么只是计划、哪些观察已过期、哪些失败分支不能再次执行,以及哪些记忆根本不应影响权限或最终判断。memory 的研究对象应是有来源、时效、可见性、权限和恢复语义的执行状态系统。

Memory 中心命题:context window != event log != semantic retrieval != execution state != verified memory。把它们混为一谈,会把“找到了相似文本”误写成“正确恢复了世界状态”。

3.1 先分清四种不同的 memory

对象 最适合回答的问题 可以测量什么 不能自动证明
Context / working set 当前一步推理需要什么? token、时延、当前上下文是否覆盖必需约束 历史事实已被持久、正确或可恢复地保存
Event / evidence ledger 发生过什么、谁观察到、何时观察到? event digest、来源、时间、完整性和访问记录 该事件仍然有效,或应指导下一动作
Long-term retrieval memory 在当前任务下,什么历史信息值得取回? retrieval、时间推理、更新、遗忘、abstention 相似条目就是正确、授权或安全的控制信息
Execution state / checkpoint 已提交什么、未决什么、可否继续或回滚? state reconstruction、恢复、重复副作用、safe stop 单纯的摘要、聊天记录或最终回答可替代它

这一区分解释了为何更长 context 不是 memory 方案:它既不声明信息来源,也不表示某个写入已提交,更不能处理冲突、过期或恢复。对 agent 而言,context 是一次计算的输入;memory 是跨步骤、跨 session 甚至跨 agent 的外部状态和访问协议

3.2 从“储存文本”到可管理的 memory operations

真实 agent memory 来自连续的 agent-environment 交互流,而不只是人机对话。AMA-Bench 指出,缺失因果与目标信息的相似检索会限制表现。Agentic Memory / AgeMem 将长期与短期 memory management 直接暴露为 agent 可调用的 tool action,包括 store、retrieve、update、summarize 和 discard,并在自身的五个长程 benchmark 上训练和评测。这支持一个具体想法:memory 操作可以是 policy 的一部分,而不是固定启发式;它不证明任何带 RL 的 memory controller 都会泛化或安全。

Agent Memory 从系统角度区分 construction、retrieval 与 generation 阶段,分析不同设计如何把成本移到写入或读取路径,并讨论 freshness-latency 等权衡。它提醒我们:一次“memory 提升”可能来自更频繁的 extraction、更大的上下文或更多生成调用,必须把这些资源拆开报告。

操作 它应记录什么 独立验收问题
Observe / append 来源、时间、可见性、content/artifact digest、可信度标签 此观察是真的、完整的吗,还是来自不可信网页、tool output 或模型猜测?
Retrieve query、候选集、排序、admission/rejection、成本 取回内容是否及时、相关、允许在当前 authority scope 中使用?
Update / reconcile 被替换的版本、冲突、时间区间、理由 新信息是否真的覆盖旧状态,还是制造了静默矛盾?
Summarize / compress 输入 event set、摘要版本、可追溯指针、丢失信息类别 压缩后还能重建关键约束和已提交操作吗?
Checkpoint / branch active goal、constraints、environment/artifact digest、plan、authority、resource clock 中断后能否恢复,而不重复副作用或暴露隐藏状态?
Expire / revoke TTL、撤销理由、关联 credential/permission 过期或错误的 memory 是否仍能改变决策或权限?

MAGE 将长程记忆组织为层级 execution-state tree:active root-to-current path 组合当前子目标、最近轨迹和已验证提示,Grow、Compress、Maintain、Revise 分别写入、压缩、校验和分支恢复。其结果只在论文的 MemoryArena 设定中成立,但它提供了比“相似度最高的片段”更精确的对象:应测量的是状态谱系、分支隔离和错误恢复

3.3 Memory 是 execution state,不是“更聪明的检索”

在具备外部副作用的任务中,最重要的 state 往往不是一段知识,而是对行动的约束:

MemoryEvent     = source, observed_at, visible_to, trust_label, digest, temporal_validity
ExecutionState  = goal, constraints, committed_effects, pending_effects, artifact/env_digest
Checkpoint      = state_version, authority_snapshot, plan, budget_clock, recovery_policy
RetrievalRecord = query, candidate_ids, admission, excluded_items, reason, cost
Acceptance      = independent_postcondition, evidence_digest, verifier_version, outcome

这样设计有五个关键作用:

  1. 区分事实、推断与计划。 “用户要求付款”“账户余额为 100”“准备付款”与“已付款”是不同类型,不能由同一摘要句子承载。
  2. 区分可见与真实。 screenshot、DOM、tool response 和聊天内容是 observation;后端状态、文件 digest 和独立 verifier 才能提供更强的 postcondition 证据。
  3. 区分失败分支与活跃路径。 已知失败的尝试可用于诊断,却不应默默混入当前 state,诱使 agent 重试错误副作用。
  4. 区分 retrieval 与 authority。 一条旧偏好、网页提示或 tool description 可以影响检索优先级,不能自身授予写权限、扩大域名范围或修改 verifier。
  5. 区分 memory 与 acceptance。 memory 可帮助形成行动;最终 completion 仍由 agent 不可写的 postcondition 检查。

这也与Agent Research Environments的世界模型与环境 contract 对齐:状态转移、观察 provenance、action authority、reset/recovery 与 verifier 是不同对象,memory 不能替代任何一个。因此每一个跨 context handoff 至少要从外部状态中重建下表,而不是依赖“上一轮摘要”。

状态对象 应保存什么 如何在恢复时验证
目标与约束 成功条件、时间/成本/权限边界、不可逆动作 与 task manifest 和 policy 重新比对
世界与工件 环境 image、文件 / 服务状态、artifact hash、输入版本 checkpoint digest 与只读重检
决策理由 当前子目标、假设、已排除路径、失败原因 下一步是否仍服务于未完成约束
工具与权限 tool version、参数、授权、网络 / credential 状态 不重放不安全副作用;重新审批升级
资源与时钟 token、工具调用、墙钟、队列、重试和取消 总预算在恢复前后连续计算

Context compaction 不是 checkpoint。 前者只能帮助下一轮读懂历史;后者还要能定位环境、工件和授权状态。若某个外部服务无法回到原状态,系统应把它记为不可 replay 的观察式证据,而不是假装可以确定性重跑。

3.4 现有 benchmark 在测什么,又没有测什么

来源 它贡献的测量视角 不能借用的结论
LongMemEval chat assistant 的 extraction、multi-session/temporal reasoning、knowledge update 与 abstention 个性化聊天记忆的得分等于工具或环境的执行状态正确
MemoryAgentBench incremental multi-turn 下的 retrieval、test-time learning、long-range understanding 与 selective forgetting 覆盖四种能力即证明实际 agent 的所有 memory 行为可靠
MemGym 在 tool dialogue、deep research、coding 和 computer use 中分离 memory from reasoning/retrieval/tool use,并使用 memory-isolated score 一个 proxy 或 benchmark 分数可代替完整 terminal verification、成本和安全评测
A-MEM 动态 note、attribute 与 link 组织的 agentic memory 图结构或可演化索引天然避免陈旧、冲突、隐私和 prompt injection
Agent Memory construction/retrieval/generation 的系统成本与 freshness-latency 权衡 profiling taxonomy 是长期执行或安全的完整评价

这些来源共同支持的最窄结论是:memory 需要单独测量,且不同任务会暴露不同故障。它们没有给出一种通用 memory winner,也不能将问答正确率外推成有真实副作用的 web、terminal 或 research workflow 的可靠性。

3.5 Memory read 是一个 trust boundary

Beyond Similarity 研究 personal agent 中的 memory search,将语义相关但上下文不适当的 retrieval 视为控制面风险:它可能造成跨域泄露、迎合、tool-call drift 或 memory-induced jailbreak。论文在指定的 frameworks、环境和攻击设置中评测,不应读作所有 memory product 的普遍漏洞比例;但它提供了一条必要设计规则:被检索到,不等于被允许影响行动。

因此 memory admission 至少需要同时检查:

检查面 一个可执行问题 典型反例
来源与完整性 这条记录来自谁,内容是否被篡改或只是模型生成? 网页中的注入文本被长期存储为“用户偏好”
时间与冲突 它在哪个时间区间有效,是否被更可靠的新状态覆盖? 旧地址/旧约束覆盖最新的明确指令
作用域与隐私 当前 task、user、tenant 和 authority 能否读取/使用它? 将 A 项目的内部细节用于 B 项目的 tool call
行动影响 它能建议、过滤还是实际授权一个动作? 检索到的 description 直接扩大网络、文件或 credential 权限
审计与撤销 谁允许它进入 active state,之后能否追查和移除? 有害 summary 被压缩后无法定位来源或回滚

将 memory 当作 untrusted input 与网页 Agent 环境的工具治理原则一致:工具返回、网页、reference、script 和记忆条目都可能影响 policy,但只有 runtime capability 与独立 verifier 能控制实际副作用。

3.6 恢复状态不等于从经验中学习

恢复回答的是“同一条工作能否在中断后继续”;持续学习回答的是“前面的任务经验能否让后面的任务在相同能力与预算条件下变好”。Continual Learning Bench(CL-Bench) 将序列任务设计为共享可在线发现的潜在结构,并以 gain metric 区分原有能力与经验后的增益。其在特定六领域设置中的结果提醒我们:专门的 memory system 并不自动带来可靠的在线学习;把历史放进 context、store 或 skill library 不能单独证明系统从经验中泛化。

下面的区分是本文提出的报告协议,不是对任何一篇论文的通用实验结论:

主张对象 最小反事实与记录 能支持什么 仍不能支持什么
状态恢复 相同任务在中断前后的 checkpoint、state digest、权限与终态检查 该配置可从已测状态重建并继续工作 后续任务从早期任务中学习,或模型能力改变
运行内适应 同一任务中有 / 无历史观察、相同模型 / harness / 预算的对照 当前 run 的反馈被该策略利用 跨任务、跨 session 或跨环境的经验迁移
序列持续学习 时间有序的任务序列、冻结 future task、初始能力基线、mutable surface 与每次 update 的版本、后续任务增益 在声明的任务分布与序列协议上,前序经验改善后续表现 权重必然更新、任意分布泛化,或 RSI

任何声称“agent 越用越好”的系统还应记录经验进入哪里:context、event ledger、检索记忆、skill、policy / adapter 参数,还是 harness / scheduler。固定 base model、harness、tool authority、任务顺序、总 token / wall-clock 预算与独立 final sequence;比较 no-experience、仅 checkpoint / retrieval、以及声明的学习更新,并分别报告 initial_capabilitysequential_gain、遗忘 / 回归、更新成本、泄漏与最终 verified outcome。否则较强初始模型、额外 context、更多尝试或 future task 信息都可能伪装成“学习”。

3.7 可训练的 memory 不等于训练集里的“成功摘要”

AgeMem 说明 store/retrieve/update 等 operation 可以做成可学习 action;MemGym 说明 memory 的影响可以尽力与推理、检索和工具能力解耦。这给合成实例与 agentic RL 一个严谨入口,却也引出更强的隔离要求:训练时不能让 agent 通过 memory 看见 final task、hidden verifier、成功评测轨迹或 evaluator 的答案通道。

一个可反驳的 training protocol 应固定 base model、harness、tool policy、动作权限、总 token/rollout/wall-clock budget 和 hidden verifier,并比较:

条件 它改变什么 必须报告的结果
no-memory / bounded context 不持久化外部 memory task outcome、遗忘、上下文和 token 成本
append-only log 保留完整事件但不做筛选 reconstruction、检索噪声、成本与隐私暴露
retrieval-only memory 固定 write 与 retrieval policy stale/conflict error、admission precision、tool/action drift
execution-state manager 版本、checkpoint、分支、recovery 进入 state contract recovery、重复副作用、safe stop、verified completion
learned memory operations 只在相同 editable action surface 上训练 store/retrieve/update/discard held-out transfer、integrity、operation cost 与训练/评测 split 隔离

最终评测至少按 environment、workflow/rule、memory schema 或 generator family、privacy/security family 进行隔离。若合成器或训练轨迹已经见过测试的唯一 state template、hidden postcondition 或成功 action,memory gain 只是测试泄漏的另一种形式。详见Agent Research Environments中的合成实例与 Agent 训练部分。

3.8 一套足够尖锐的 memory failure suite

不要只问“模型记住了吗”。每个 memory system 至少应面对以下对照:

  1. 陈旧覆盖: 后来的高可信状态与早期低可信记录冲突,agent 必须更新或 abstain。
  2. 部分提交: 工具调用返回成功但后端只提交一部分,恢复时不得重复外部副作用。
  3. 失败分支污染: 一个已证伪的计划与有效轨迹语义相似,不能被当作当前事实取回。
  4. 不可信写入: web/tool text 诱导 agent 存储、总结或转发越权 instruction。
  5. 跨作用域泄露: 同一 agent 的不同 user/task/tenant memory 不得交叉影响 retrieval 或 action。
  6. 压缩不可逆: summary 丢掉 artifact digest、约束或 commit status 后,独立 runner 无法重建关键 state。
  7. 恢复与停止: checkpoint 缺失、工具拒绝或环境漂移时,agent 要恢复、升级或安全停止,而非编造成功。

对应的最低输出列是:verified_successstate_reconstructionstale_or_conflict_errormemory_admission_violationcross_scope_leakduplicate_side_effectrecovery_costsafe_stoptrace_completeness。这些列把 memory 从一项模糊能力变成环境、harness 和 evaluator 都能共同审计的对象。

3.9 Memory 对五条核心线的补充

核心线 Memory / state 应增加的对象 不能替代什么
RSI / OpenRSI 受限、版本化、可回滚的 memory/harness edit 与跨代 regression 独立 acceptance、sealed holdout 与“改进改进者”的证据
Auto Research / ART 证据来源、实验状态、失败/未决假设、artifact lineage 对照、因果解释、局限和可复跑结论
Long horizon checkpoint、state reconstruction、branch isolation、recovery/safe stop 更长 context、更多 tool calls 或 timeout 本身
ClawBench V2 / WebsiteBench self-host snapshot、作用域化 memory、backend postcondition 与 sidecar trace 截图、chat summary 或 tool success message
Synthetic training / Agentic RL memory operations、stateful instance、schema/provenance split 与 integrity regression 成功摘要、共享 generator 或开发集 reward 的局部提升

小结:agent memory 不是额外塞进 prompt 的“经验”,而是一个会影响未来行动的状态系统——价值不在于检索更多,而在于让每次写入、取回、压缩、恢复和撤销都能被定义、限制、审计和独立推翻。它是长程 agent 中第一个必须受控的层;下一层是 planning。

4. Planning 与 Replanning:从漂亮计划到可验证的重规划

执行状态之上的下一层是计划。一段条理清晰的计划文本并不等于 agent 会规划。真正的计划要在不完整观察、硬约束、工具失败、权限限制、资源预算和环境变化下持续更新,并最终由独立终态而不是 agent 的解释来验收。Planning 的研究对象不是“计划看起来合理”,而是一个能被环境反驳、能安全重规划、也能在不可行时正确停止的控制过程。

Planning 中心命题:plausible plan != executable plan != adaptive replanning != verified completion。计划、执行、调度、委托和终态验收必须分别测量;否则一个高 pass rate 无法告诉我们瓶颈究竟在哪里。

4.1 先把五个对象拆开

对象 它要回答的问题 可成立的最窄结论 不能据此推出
Plan 在当前 state 下,哪些子目标、依赖、约束与停止条件应成立? 计划结构可被检查 计划一定可执行或会成功
Execution 一个受授权的 action 是否发生并产生预期观察? 该动作/工具调用返回了指定结果 后端 postcondition、全局约束或用户目标已满足
Replanning 新观察、失败或约束改变后,是否应继续、替换、回滚、升级或停止? 一个更新策略可在指定分布中测量 agent 在所有突发环境里都有鲁棒恢复
Orchestration / scheduling 工作如何拆给 worker、工具或 GPU,并在何时合并? 某个编排/资源策略有特定成本与时延效果 它提升了 policy 的规划能力或终态正确性
Acceptance 独立 verifier 是否确认最终业务、物理或研究后置条件? 当前终态已通过指定检查 过程、计划或隐藏副作用全部正确

Agent Planning Benchmark (APB) 正是从这个缺口出发:它把 holistic planning、feedback-conditioned step-wise planning、干扰/损坏工具和不可解任务分开,作为 end-to-end execution benchmark 的上游诊断。APB 的结论限于自己的任务和模型,但它支持一个必要规则:不能把“最终失败”自动归因于计划,也不能把“计划文本好”自动归因于执行能力。

4.2 一个可执行的 plan contract

把 plan 写成聊天里的一段自然语言,会丢掉执行、比较和恢复所需的边界。一个最小 plan version 应保留:

GoalSpec       = target_postcondition, hard_constraints, soft_preferences, budget, authority
PlanVersion    = parent, state_digest, assumptions, subgoals, dependencies, stop_conditions
PlanStep       = precondition, authorized_action, expected_observation, expected_cost, recovery_boundary
Observation    = source, timestamp, provenance, state_delta | uncertainty | tool_failure
ReplanEvent    = trigger, invalidated_steps, alternatives, chosen_action, budget_delta, rationale
Acceptance     = independent_postcondition, evidence_digest, verifier_version, outcome

这不是要求每个 agent 都输出冗长 JSON,而是要求 harness 能在外部保存等价信息。它带来六个可审计问题:

  1. 目标是否可验收? 目标应指向可检查的 postcondition,而不只是“完成研究”或“处理请求”。
  2. 约束是否显式? 时间、成本、权限、不可逆 action、隐私和 policy 应是 hard/soft constraint,而非可被遗漏的文案。
  3. 每步为什么允许? precondition、authority 和 expected observation 防止用一个看似相关的工具调用遮盖越权或无效动作。
  4. 何时重规划? 失败、无信号、状态漂移、冲突写入、预算变化和不确定性都应是明确 trigger。
  5. 重规划影响什么? 记录 invalidated steps,避免重做已提交副作用,或把已失败分支当成当前事实。
  6. 何时拒绝或停止? 不可行、缺少关键信息、权限不足或预算已耗尽时,refusal/safe stop 是正确 outcome,而不是低分轨迹。

4.3 计划必须面对全局约束、隐藏工具与真实失败

DeepPlanning 将主动信息获取、局部约束与时间/财务等全局约束下的优化放进同一个 long-horizon 任务。它提醒我们:单步选择正确不等于全局计划可行,逐步看似合理的 action 序列仍可能违反整体可行性,尤其当工具失败、信息缺失或需要绕行时。

PlanBench-XL 将大型工具生态、受限工具可见性、隐含子目标和可选的缺失/失败/干扰工具放在同一交互 benchmark 中。它说明“已知固定工具列表上的计划”与“需要发现工具、根据返回证据再决定下一步的计划”是不同难度。尤其是无明确错误信号的失败,不能靠一次 tool-call success 判断。

场景 计划器应做什么 verifier 应检查什么
信息不完整 识别缺口并选择成本/权限合适的 observation action 是否查询了与目标有关且允许的证据,而非编造前提
全局预算冲突 比较备选路径与总时间/钱/token/风险 局部成功是否偷偷超出全局 hard constraint
工具返回明确错误 定位受影响 subgoal,选择替代、回滚、升级或停止 是否无界重试、重复副作用或跳过失败
工具静默失效 以 postcondition 或后续观测检测计划失配 “调用成功”是否被错误当作“状态已改变”
不可解任务 说明阻塞证据,正确拒绝或请求授权/信息 是否把不可能任务包装为虚假完成
环境漂移 比对 state digest,作局部而非全局重规划 是否保留已验证/已提交部分并标注失效假设

这也解释了为什么 browser、terminal、科学研究和跨应用 API task 需要不同 verifier。对于 AutomationBench 这类跨应用 REST workflow,计划还包括 endpoint discovery、层叠业务 policy 与正确数据写入;论文采用 programmatic end-state grading。它是后端终态如何约束计划的好例子,而不是对任意 UI、浏览器环境或现实业务的泛化证明。

VLAs-as-Tools 的架构启示也适用于软件 agent:高层 agent 维护时间上的计划和恢复,受限的局部工具执行小任务,并只在显式进度反馈或异常事件时触发重规划。BCER Agent 进一步将最终输出与中间工件/测量绑定,并强调 bounded local recovery。它们不是通用架构胜利的证明,但给出两个可测的设计变量:进度反馈是否可验证,以及恢复是否只回退到受影响的局部边界。因此可以把一个 plan-execute loop 的每个阶段拆开检查:

阶段 agent 的责任 evaluator 应检查什么
Plan 声明子目标、依赖、约束和停止条件 计划是否遗漏硬约束、是否把不可解任务误作可解
Execute 以最小权限调用有明确定义的工具 action 是否与声明子目标、权限和环境状态一致
Observe 把进度、失败和外部状态写入证据轨 观察是否来自真实工具/环境,而不是自述
Recover 定位受影响工件或子目标,选择重试、替代、回退或停止 恢复是否避免重放已完成或不可逆副作用
Accept 将最终工件交给独立 verifier 最终 state、全局预算、完整性和回归是否同时成立

4.4 Replanning 是受控变更,不是无限 retry

高质量重规划不应把所有失败都变成“再试一次”。每个 ReplanEvent 应说明:什么 observation 触发了它、哪些假设或步骤失效、什么 artifact/状态受影响、是否存在不可逆 effect、可用预算还剩多少,以及新计划如何被独立检查。

恢复动作 何时合适 它必须避免
Retry 暂态、幂等且已明确的失败,仍有预算 把永久失败或已提交动作重做
Substitute 存在等价且权限匹配的工具/路径 为成功而扩大 authority 或绕过 policy
Rollback 系统支持可验证的回退边界 假装外部副作用已撤销,或丢掉审计证据
Delegate / escalate 子问题和权限边界清楚,或需要人/更高权限判断 不受控地复制上下文、凭据或写权限
Refuse / safe stop 任务不可解、信息不足、风险过高或预算耗尽 编造完成、沉默地超支或绕过审批

把这些作为显式 action,才能测量恢复质量:replan_trigger_precisioninvalidated_step_accuracyduplicate_side_effectrecovery_costsafe_stopverified_success_after_replan。对长程场景,重规划与上文 memory 部分的 checkpoint/branch contract 相连:计划版本和环境状态必须被一起恢复,聊天摘要本身不足以承担这个角色。

4.5 多 Agent、harness edit 与 GPU scheduling 不等于 planning

ClawArena-Team 专门考察一个 leader 管理固定 subagent pool 的能力,并把 task correctness 与 least-privilege/modality routing 联合评分。它把“能否管理团队”从 worker 自身解题能力中剥离出来,说明 delegation 计划需要独立的权限、成本和最终结果度量。

Agentic Harness Engineering (AHE) 将 harness 的可编辑组件、轨迹经验和每次 edit 的预测/后续验证做成可观察对象。在它自己的 coding-agent 设定中,这种 edit-to-outcome 关联可作为 harness evolution 的受控形式。它不表示任意自改 harness 或自动 workflow search 都是 RSI;evaluator、权限和 held-out acceptance 仍必须在候选外部。

SAGA 则处理另一层问题:将完整 agent workflow 作为 GPU scheduling 单位以改进任务完成时延。它是部署系统中的资源调度研究,不是 policy 规划证据。一个系统更快地执行相同 workflow,仍需单独检查该 workflow 是否选择了正确的工具、满足约束并达到终态。

归因规则:公开结果写作 model + planner + harness + tool/authority policy + environment + scheduler + evaluator + budget。删除任何一项,读者就无法分辨计划质量、资源调度、并行 worker 或 verifier 变化到底贡献了什么。

4.6 一套能够推翻“会规划”的评测矩阵

在同一 base model、tool policy、action authority、环境初态、总 token/wall-clock/worker budget 和 hidden verifier 下,至少比较:

对照 它隔离的变量 需要报告
reactive loop vs explicit plan 是否显式维护目标、依赖和停止条件 verified outcome、遗漏约束、计划成本、方差
static plan vs feedback-conditioned replanning 是否用观察更新有效计划 recovery、stale-plan error、duplicate side effect、safe stop
fixed tools vs discovery-limited tools 是否能用证据选择和替换工具 discovery precision、无效调用、tool-noise robustness
no global ledger vs constrained plan 是否守住总预算/policy/不可逆约束 hard-constraint violation、成本、局部/终态差距
single agent vs delegation team management 在同预算下是否净收益 verified success、worker-hours、重复工作、权限/merge 违规
outcome-only vs process diagnostics 计划分数是否真正预测终态与安全 plan/outcome gap、false acceptance、calibration

最小反例集应含:正确 endpoint 但错误 payload;成功返回但没有 commit;缺失或静默失败的工具;旧 state/过期 observation;不可解任务;预算冲突;延迟返回的 subagent;以及 agent 能提高过程分数却不能通过 hidden postcondition 的轨迹。这样“计划分数上升”就必须同时面对执行、完整性和终态的反驳。

4.7 合成实例与 Agentic RL:训练重规划,不泄漏评测

合成实例不能只提供一条成功 plan。一个可训练的 planning instance 至少要有初态/可见性边界、目标与 hard constraint、候选工具与权限、可执行 transition、扰动/失败分支、替代路径、拒绝条件以及独立 verifier。训练轨迹可以记录何时提出、修订或放弃计划,但不得包含 final evaluator、hidden postcondition、成功评测轨迹或唯一答案模板。

建议在相同 action surface 上比较 SFT-only、RL-only 和 SFT+RL,并按 environment、workflow/rule、tool schema/generator family、failure/security family 分割最终任务。reward 应把 verified_outcome、hard-constraint violation、integrity violation、recovery cost 和正确 refusal 分开;不能让一个被 planner 或 agent 可写的 scalar 决定所有结论。详见Agent Research Environments中的合成实例与 Agent 训练部分,以及Agent Harness Engineering中的 Agentic RL 一节。

4.8 Planning 对五条核心线的补充

核心线 Planning 应新增的可测对象 不能替代什么
RSI / OpenRSI versioned plan/harness edit、prediction、held-out replan regression 独立 acceptance 和跨代改进改进者的证据
Auto Research / ART research question、假设、控制、成本、证据缺口和停止条件的计划谱系 新颖性、因果有效性、复现和同行检验
Long horizon global constraint、checkpoint、plan revision、recovery/safe stop 长 context 或更长 timeout 本身
ClawBench V2 / WebsiteBench tool discovery、least privilege、后端 postcondition、UI/backend mismatch replan click trace、endpoint 到达或 agent final text
Synthetic training / Agentic RL stateful plan/replan instances、failure branches、split-isolated transfer 一批成功示例或高 development reward

这里的结论同样克制:plan 是可检查的中间工件,不是能力宣言。只有当它在变化状态、受限工具、真实失败、全局约束和独立 verifier 下仍能安全地更新、拒绝或完成时,才值得把“agent 会规划”写成一个工程结论。

5. 恢复的独立测量:故障注入与恢复账本

第 4 节把恢复动作当作重规划的一部分;本节单独测量 recovery 本身。好的 recovery 有边界:它不能为了更高 pass rate 重跑完整 workflow 并掩盖失败来源。一个可审计的 recovery event 要记录:触发信号、受影响范围、恢复点、已失效的证据、重试预算、人工接管与最终结果。

最小故障注入集可以包括:工具返回不完整结果、文件或服务状态被外部修改、checkpoint 损坏、权限被拒绝、上下文摘要遗漏关键约束、以及一次局部成功但全局预算已不可行。对每类故障至少报告 recovery_successstate_reconstructionduplicate_side_effectresume_latencyrecovery_cost。若恢复只提高了过程分数,却没有改善独立终态或安全,它就是又一个可被刷的奖励代理。

6. 长程安全不是单轮 guard 的重复

AgentLAB 把 intent hijacking、tool chaining、task injection、objective drift 与 memory poisoning 放到多轮环境中。它的窄结论是:单轮防御不能自动覆盖跨轮攻击。对长程 agent,这意味着 state store、工具返回、handoff 文档和子 agent 消息都是不可信输入面;“前一轮已经批准”也不自动等于下一轮仍有权限。这与上文 memory admission 是同一条 trust boundary:被存储或被检索的内容都不自动获得授权。

因此安全状态也要进入 checkpoint:权限随时间的有效范围、被拒绝的 action、domain / tool allowlist、外部输入的 trust label、风险升级和人工确认。最终报告至少将 task_outcomeintegrity_violationsunsafe_action_ratefalse_block_rate 分开,不能用一个成功率覆盖全部。

7. “数小时”必须有可审计的时间账本

一个 wall-clock 数字本身没有解释力。每次运行至少要将 wall_clock 分拆为 active_agent_timeenvironment_build_or_resetmodel_or_tool_waitexternal_or_queue_waitrecovery_timehuman_handoff_timecancelled_or_idle_time,并把它们与 token、工具调用和外部成本连到同一 run id。这样才能分清 agent 在持续工作、等待系统、重建状态,还是被人接管。

时间记录 回答的问题 不记录会混淆什么
active agent time policy 实际在观察、推理和行动多久 等待或人工时间被误计为自主工作
environment / external wait build、reset、队列或外部服务占了多久 不同基础设施导致的“时长”差异
recovery time and attempts 哪些中断真的被系统恢复 无限重试被包装成持续性
human handoff 人何时诊断、授权或修改工件 人类贡献被误归因给 agent
cancelled / idle runs 被放弃或无进展的分支占多少预算 只报告完成样本的幸存者偏差

公平比较必须冻结 cutoff 与 continuation policy:何时 checkpoint、何时允许恢复、何时需要人工升级、何时 safe stop。一个运行可以很长,却主要在队列中等待;也可以很短,却在故障后完成了受约束的状态重建。二者是不同证据。

8. 一份可被推翻的数小时执行协议

下面是设计提案,不是已报告的 long-horizon 结果。它让“能连续工作数小时”成为可以失败的实验:

  1. 冻结任务包络与运行身份。 保存 task type、task manifest、初态 digest、model/harness/tool/policy 版本、预算、环境 image 和 evaluator hash;不能把 in-progress benchmark 的目标任务数写成已发布结果。
  2. 外化状态。 每个 checkpoint 写入目标、约束、工件、依赖、行动、观察、失败与资源;敏感内容在保留前脱敏。
  3. 主动测试恢复。 预注册故障注入时点与成功定义;区分观察式 replay 和真正重跑。
  4. 隔离接纳。 candidate 无法写入 hidden task、verifier、权限 policy 或最终 release decision;final state 和过程完整性分开判定。
  5. 同预算比较。 单 agent、顺序、多 agent、不同 memory 或 recovery 策略拥有相同总 token、worker-time、wall-clock、重试和外部工具额度。
  6. 报告完整曲线与时间账本。 不只报告 best run:保留尝试、取消、恢复、回归、方差、峰值并发、active/wait/recovery/human 时间、总成本与每个 verified success 的成本。
验收门槛:只有当独立终态、状态重建、故障恢复、预算遵守与安全指标同时成立,才可把某配置称为可靠的 long-horizon agent。更多 context、更多调用或更长 wall clock 都只是资源,不是能力证据。

9. 它如何接回五条核心线

3.9 与 4.8 已分别给出 memory 与 planning 对五条核心线的补充;下表把整条 long-horizon 线接回相邻方向。

核心线 Long horizon 提供什么 它不能替代什么
RSI / OpenRSI 跨代 candidate 的状态、恢复和回归证据 独立接纳与“更会改进”的 held-out 曲线
Auto Research / ART 实验谱系、失败、复跑和资源账本 一条窄研究结论的对照、复现和同行审查
Environment 可 reset 初态、工具事件、postcondition 与 fault injection verifier 完整性与安全的单独设计
Synthetic training checkpoint、recovery、state transition 与 stop/refusal 的训练信号 证明合成轨迹能迁移到未见长程任务
Agentic RL session-level outcome、原生 harness trace 与 credit-assignment 诊断 自动正确的 step-level reward 或 PPO/GRPO 优势

这份协议与Agent Harness Engineering互补:后者定义运行时的工程平面;本文把这些平面转成按 task envelope 区分的 long-horizon 运行、故障和验收实验,并把 memory/执行状态与 planning/重规划作为其中两个必须受控的层一起拆解。对科学工作流何时可成为可审阅研究主张,以及相邻的 memory、planning 和安全方向,另见AutoResearch;合成训练、环境边界与世界模型 contract 见Agent Research Environments,工具治理见网页 Agent 环境

Primary References

Long-Horizon Agents: State, Planning, and Verifiable Hours-Long Execution

Jul 2026 · Long-Horizon Agents / Memory / Planning / Harness Engineering

A long-horizon agent is not one whose timeout moved from ten minutes to ten hours, nor one that pours its entire history into a larger context. It is a recoverable state machine: it maintains goals and constraints in a changing environment, decomposes plans into verifiable local actions, resumes from the right boundary after failure, and lets an external evaluator determine whether the final result is task completion, a reward proxy, or merely a trajectory that looked busy.

Central claim: a long-horizon result belongs to a complete configuration, not a base model: model + native harness + state store + tool/authority policy + environment + evaluator + time/cost budget. A report that gives only final success rate cannot reveal whether interruptions, recovery, retries, authority, or resources silently changed the conclusion.

1. What Counts as Long Horizon, and What Does Not

A long-running episode has at least four properties: state remains causally relevant across decisions; intermediate errors change later feasible paths; the agent trades local feedback against global constraints; and after interruption it must reconstruct from external artifacts rather than guess from chat memory. Under this definition, the difficulty is not merely “more steps,” but dependencies, recovery, and accountability.

Observed event Conclusion it supports Conclusion it does not support
One long trajectory ends successfully This configuration completed one task from one initial state The model has stable long-term ability
Many tool calls or a large context The run consumed many actions or tokens State was maintained correctly or planning was sound
Work continues after an interruption One recovery path worked from tested states Every external service and side effect can be replayed safely
Parallel workers finish faster That schedule increased throughput on the given tasks and budget A team is inherently more reliable or cheaper

WildClawBench is valuable because it restores the native CLI harness to the evaluation configuration: in its containerized tasks, swapping harnesses for the same model can substantially change performance. It supports attributing long-horizon performance to a model-harness configuration, not assigning a runtime-free fixed ranking to a model.

2. Label the Task Envelope First: Long Tasks, Single-Project Challenges, and Scientific Workflows Are Different Claims

“Long horizon” describes execution and dependency, not one uniform task type. LongCLI-Bench separates requirement fulfilment from regression avoidance with a dual-set measurement, showing that one terminal test does not localize long-horizon programming failure. Terminal-Bench Challenges instead are token-intensive, single-project tasks. Their run guidance explicitly permits custom stateful rollouts to manage checkpoints, orchestration, retries, and memory while retaining task source and verifier as the contract.

By contrast, as of 2026-07-13, Terminal-Bench Science is still in development. It targets computational workflows in the natural sciences with containerized, programmatic, deterministic verification and explicitly excludes open-ended hypothesis generation and literature review. It can support study of whether an agent completes a constrained, reviewable scientific-computing workflow; it is not a released science-benchmark score, evidence of an independent discovery, or evidence of a days-long service.

Task envelope What it most directly verifies What still must be added What it cannot establish alone
Long CLI / software task Requirements, regressions, and early failure location Initial state, harness, budget, and recovery trace One pass proves stable multi-day operation
Single-project challenge Whether a large artifact completes under a controlled task/verifier Checkpoint, retry, parallelism, human-intervention, and cancellation ledger A large-project success measured every recovery or safety property
Scientific-computing workflow A predeclared, programmatically verifiable computational process Materials/environment lineage, determinism, negative results, and domain review Workflow completion means a new hypothesis, discovery, or publication
Hours-to-days ongoing service Whether state persists through waiting, failures, and sessions Time ledger, fault injection, external-state drift, and safe stopping More timeout or tokens proves reliability

Every report should therefore name its task envelope before saying how long the agent ran. Otherwise “science,” “challenge,” and “long horizon” collapse fundamentally different verifiers, clocks, and conclusions into one score.

3. Memory and State: From Similarity Retrieval to Recoverable, Verifiable Execution State

Whatever the task envelope, state in a long-horizon agent is not a chat summary. Agent memory is often reduced to “put history into a vector store and retrieve it when needed.” That can help question answering or personalization, but it is not enough for long-horizon action. An agent also needs to know what was committed, what is only planned, which observations are stale, which failed branches must not execute again, and which memories must not affect authority or final judgment. The research object is an execution-state system with provenance, temporal validity, visibility, authority, and recovery semantics.

Memory central claim: context window != event log != semantic retrieval != execution state != verified memory. Collapsing these makes “retrieved similar text” look like “correctly reconstructed world state.”

3.1 Separate Four Different Kinds of Memory

Object Question it is suited to answer What can be measured What it does not establish
Context / working set What is needed for the current reasoning step? Tokens, latency, whether the present context covers needed constraints Historical facts were persistently, correctly, or recoverably retained
Event / evidence ledger What happened, who observed it, and when? Event digest, provenance, time, integrity, access record The event remains valid or should guide the next action
Long-term retrieval memory Which historical information is worth retrieving for this task? Retrieval, temporal reasoning, updates, forgetting, abstention A similar item is correct, authorized, or safe control information
Execution state / checkpoint What committed, what remains pending, and can work continue or roll back? State reconstruction, recovery, duplicate side effects, safe stop A summary, chat log, or final answer can substitute for it

This explains why a longer context is not a memory system: it declares neither provenance nor whether a write committed, and it cannot resolve conflict, staleness, or recovery. For an agent, context is input to one computation; memory is external state and an access protocol across steps, sessions, and potentially agents.

3.2 From Stored Text to Managed Memory Operations

Real agent memory arises from continuous agent-environment interactions rather than only human dialogue. AMA-Bench observes that similarity retrieval without causal and objective information limits performance. Agentic Memory / AgeMem exposes long- and short-term memory management as tool actions the agent can call, including store, retrieve, update, summarize, and discard. It trains and evaluates this policy in its own five long-horizon benchmarks. That supports a concrete idea: memory operations can be part of a policy rather than fixed heuristics; it does not show that every RL memory controller generalizes or is safe.

Agent Memory separates construction, retrieval, and generation phases from a systems perspective, characterizing how designs move cost onto write or read paths and discussing freshness-latency trade-offs. It is a reminder that a reported “memory improvement” may be more frequent extraction, a larger context, or more generation calls, all of which need separate accounting.

Operation What it should record Independent acceptance question
Observe / append Source, time, visibility, content/artifact digest, trust label Is the observation true and complete, or untrusted web/tool output or model guesswork?
Retrieve Query, candidates, ranking, admission/rejection, cost Is the result timely, relevant, and permitted for the present authority scope?
Update / reconcile Superseded version, conflict, temporal interval, reason Does new information actually supersede old state, or create a silent contradiction?
Summarize / compress Input event set, summary version, traceable pointers, lost-information class Can key constraints and committed actions still be reconstructed?
Checkpoint / branch Active goal, constraints, environment/artifact digest, plan, authority, resource clock Can work resume after interruption without repeating side effects or exposing hidden state?
Expire / revoke TTL, revocation reason, related credential/permission Can stale or wrong memory still change a decision or authority?

MAGE organizes long-horizon memory as a hierarchical execution-state tree. Its active root-to-current path combines current subgoals, recent traces, and validated hints; Grow, Compress, Maintain, and Revise respectively write, compress, validate, and restore onto a branch. Its results hold only in the paper’s MemoryArena setting, but it provides a sharper object than “top similar passage”: measure state lineage, branch isolation, and error recovery.

3.3 Memory Is Execution State, Not “Smarter Retrieval”

For tasks with external side effects, the most important state is often not a knowledge passage but a constraint on action:

MemoryEvent     = source, observed_at, visible_to, trust_label, digest, temporal_validity
ExecutionState  = goal, constraints, committed_effects, pending_effects, artifact/env_digest
Checkpoint      = state_version, authority_snapshot, plan, budget_clock, recovery_policy
RetrievalRecord = query, candidate_ids, admission, excluded_items, reason, cost
Acceptance      = independent_postcondition, evidence_digest, verifier_version, outcome

This creates five key distinctions:

  1. Facts, inferences, and plans differ. “The user asked to pay,” “the balance is 100,” “prepare payment,” and “payment committed” are different types, not one summary sentence.
  2. Visible differs from true. Screenshots, DOM, tool responses, and chat are observations; backend state, file digests, and independent verifiers offer stronger postcondition evidence.
  3. Failed branches differ from the active path. A known failed attempt can aid diagnosis but must not silently enter active state and induce repeated side effects.
  4. Retrieval differs from authority. An old preference, web hint, or tool description may prioritize retrieval; it cannot grant write access, widen a domain, or modify a verifier.
  5. Memory differs from acceptance. Memory can help choose action; final completion still belongs to a postcondition verifier the agent cannot write.

This aligns with the world-model and environment contract in Agent Research Environments: state transition, observation provenance, action authority, reset/recovery, and verifier are different objects, and memory cannot substitute for any of them. Every cross-context handoff should therefore reconstruct at least the following from external state rather than a prior-turn summary.

State object What to retain How to validate on recovery
Goals and constraints Success conditions, time/cost/authority boundaries, irreversible actions Reconcile with task manifest and policy
World and artifacts Environment image, file/service state, artifact hashes, input versions Checkpoint digest and read-only reinspection
Decision rationale Current subgoal, hypotheses, excluded paths, failure causes Does the next action still serve an unmet constraint?
Tools and authority Tool version, parameters, grants, network/credential state Do not replay unsafe effects; reapprove escalation
Resources and clock Tokens, calls, wall clock, queueing, retries, cancellations Compute budget continuously across recovery

Context compaction is not a checkpoint. The former may help a fresh invocation understand history; the latter must also locate environment, artifacts, and authority. If an external service cannot return to its prior state, retain it as observational evidence rather than pretending it can be rerun deterministically.

3.4 What Current Benchmarks Measure, and What They Do Not

Source Measurement perspective it contributes Conclusion it cannot lend
LongMemEval Extraction, multi-session and temporal reasoning, knowledge update, and abstention for chat assistants A personalized-chat score equals correct execution state in a tool or environment
MemoryAgentBench Retrieval, test-time learning, long-range understanding, and selective forgetting under incremental multi-turn interaction Covering four competencies proves all practical agent memory behavior is reliable
MemGym Separates memory from reasoning/retrieval/tool use across tool dialogue, deep research, coding, and computer use, with a memory-isolated score A proxy or benchmark score replaces terminal verification, cost, and safety evaluation
A-MEM Dynamic notes, attributes, and links for agentic memory organization A graph or evolving index naturally prevents stale, conflicting, private, or injected memory
Agent Memory Systems cost across construction/retrieval/generation and freshness-latency trade-offs A profiling taxonomy is a complete long-horizon or safety evaluation

The narrow conclusion common to these sources is that memory needs its own measurement and that tasks expose different failure modes. They do not provide a universal memory winner or permit chat-QA accuracy to be extrapolated to reliable web, terminal, or research workflows with real side effects.

3.5 A Memory Read Is a Trust Boundary

Beyond Similarity studies memory search in personal agents and treats semantically related but contextually inappropriate retrieval as a control-plane risk: it can lead to cross-domain leakage, sycophancy, tool-call drift, or memory-induced jailbreaks. The paper evaluates specified frameworks, environments, and attacks, so it is not a prevalence estimate for all memory products. It does support one necessary design rule: retrieved does not mean permitted to affect action.

Memory admission should therefore check all of these surfaces:

Check Executable question Typical counterexample
Source and integrity Who produced this record, and was it altered or merely generated by a model? Prompt injection in a page is stored as a “user preference”
Time and conflict During which interval is it valid, and did a more reliable state supersede it? An old address or constraint overrides a later explicit instruction
Scope and privacy May this task, user, tenant, and authority read or use it? Internal detail from project A is used in a project-B tool call
Action influence Can it suggest, filter, or actually authorize an action? A retrieved description widens network, file, or credential authority
Audit and revocation Who admitted it to active state, and can it be traced and removed later? A harmful summary is compressed until its source and rollback path disappear

Treating memory as untrusted input aligns with the tool-governance principle in Web-Agent Environments: tool returns, pages, references, scripts, and memory items can affect policy, while only runtime capability and an independent verifier control real side effects.

3.6 State Recovery Is Not Learning from Experience

Recovery answers whether the same work can continue after interruption; continual learning answers whether earlier task experience makes later tasks better under the same capability and budget conditions. Continual Learning Bench (CL-Bench) designs task sequences around shared latent structures that a stateful system can discover online and uses a gain metric to separate prior capability from experience-dependent improvement. Its results in a specific six-domain setting remind us that a dedicated memory system does not automatically yield reliable online learning; putting history into context, a store, or a skill library alone does not show that a system generalizes from experience.

The distinction below is a reporting protocol proposed here, not a universal experimental finding from any one paper:

Claim object Minimum counterfactual and record What it can support What it still cannot support
State recovery Checkpoint, state digest, authority, and terminal checks before and after interruption of the same task This configuration reconstructed and continued from tested states Later tasks learned from earlier tasks, or model capability changed
Within-run adaptation With/without-history control inside the same task, with model, harness, and budget fixed Feedback in the current run was used by that policy Experience transfer across tasks, sessions, or environments
Sequential continual learning Time-ordered tasks, future tasks frozen, an initial-capability baseline, mutable-surface and update versions, and gains on later tasks Earlier experience improved later performance on the declared task distribution and sequence protocol Weights necessarily changed, arbitrary-distribution generalization, or RSI

Any system said to “get better with use” should also record where experience enters: context, an event ledger, retrieval memory, a skill, policy/adapter parameters, or a harness/scheduler. Fix the base model, harness, tool authority, task order, total token/wall-clock budget, and an independent final sequence; compare no experience, checkpoint/retrieval only, and the declared learning update. Report initial_capability, sequential_gain, forgetting/regression, update cost, leakage, and final verified outcome separately. Otherwise a stronger starting model, extra context, more attempts, or information from future tasks can masquerade as learning.

3.7 Trainable Memory Is Not a Training Set of “Successful Summaries”

AgeMem shows that store/retrieve/update can be learnable actions; MemGym shows that memory’s effect can be separated, as far as the benchmark permits, from reasoning, retrieval, and tools. This gives synthetic instances and agentic RL a rigorous entry point, but it also raises a stronger isolation requirement: during training, memory cannot reveal final tasks, hidden verifiers, successful evaluation traces, or an evaluator’s answer channel.

A falsifiable training protocol fixes base model, harness, tool policy, action authority, total token/rollout/wall-clock budget, and hidden verifier, then compares:

Condition What it changes Results it must report
No memory / bounded context No persistent external memory Task outcome, forgetting, context and token cost
Append-only log Full events without selection Reconstruction, retrieval noise, cost, privacy exposure
Retrieval-only memory Fixed write and retrieval policy Stale/conflict errors, admission precision, tool/action drift
Execution-state manager Versions, checkpoints, branches, recovery enter the state contract Recovery, duplicate side effects, safe stop, verified completion
Learned memory operations Train only on the same editable store/retrieve/update/discard surface Held-out transfer, integrity, operation cost, train/eval split isolation

Final evaluation should be separated at least by environment, workflow/rule, memory schema or generator family, and privacy/security family. When a generator or training trace has seen a test’s unique state template, hidden postcondition, or successful action, a memory gain is simply another form of test leakage. See the synthetic-training sections of Agent Research Environments for the data-lineage and split protocol.

3.8 A Memory Failure Suite Sharp Enough to Matter

Do not only ask “did it remember?” Every memory system should confront at least these controls:

  1. Stale override: Later high-trust state conflicts with an earlier low-trust record; the agent must update or abstain.
  2. Partial commit: A tool return says success while the backend commits only part; recovery must not repeat the external side effect.
  3. Failed-branch contamination: A disproven plan is semantically similar to a valid trace and must not return as current fact.
  4. Untrusted write: Web/tool text induces storage, summary, or forwarding of an unauthorized instruction.
  5. Cross-scope leakage: Different user/task/tenant memories in one agent cannot influence one another’s retrieval or actions.
  6. Irreversible compression: A summary loses an artifact digest, constraint, or commit status such that an independent runner cannot reconstruct key state.
  7. Recovery and stopping: With missing checkpoints, tool denial, or environment drift, the agent recovers, escalates, or safely stops rather than fabricating completion.

The minimum output columns are verified_success, state_reconstruction, stale_or_conflict_error, memory_admission_violation, cross_scope_leak, duplicate_side_effect, recovery_cost, safe_stop, and trace_completeness. They make memory an object that environment, harness, and evaluator can audit together rather than a vague capability label.

3.9 What Memory Adds to the Five Core Threads

Core thread Object memory/state should add What it cannot replace
RSI / OpenRSI Bounded, versioned, reversible memory/harness edits and cross-generation regressions Independent acceptance, sealed holdouts, and evidence that the improver improves itself
Auto Research / ART Evidence provenance, experimental state, failed/unresolved hypotheses, artifact lineage Controls, causal explanation, limits, and replayable conclusions
Long horizon Checkpoints, state reconstruction, branch isolation, recovery/safe stop A longer context, more tool calls, or timeout alone
ClawBench V2 / WebsiteBench Self-hosted snapshots, scoped memory, backend postconditions, sidecar traces A screenshot, chat summary, or tool-success message
Synthetic training / Agentic RL Memory operations, stateful instances, schema/provenance splits, integrity regressions Successful summaries, a shared generator, or local development-reward gain

In short, agent memory is not extra “experience” placed into a prompt but a state system that changes future action — its value lies not in retrieving more, but in making each write, read, compression, recovery, and revocation definable, constrained, auditable, and independently falsifiable. It is the first layer a long-horizon agent must keep under control; the next is planning.

4. Planning and Replanning: From Plausible Plans to Verifiable Replanning

The next layer above execution state is the plan. A clear, orderly plan in text does not mean an agent can plan. A real plan must keep updating under partial observations, hard constraints, tool failures, authority limits, resource budgets, and environment changes, then be accepted by an independent terminal state rather than the agent’s explanation. The research object is not “a plan that sounds reasonable,” but a control process that an environment can refute, that can replan safely, and that correctly stops when work is infeasible.

Planning central claim: plausible plan != executable plan != adaptive replanning != verified completion. Plan, execution, scheduling, delegation, and terminal acceptance need separate measurement; otherwise a pass rate cannot locate the bottleneck.

4.1 Separate Five Objects First

Object Question it answers Narrow conclusion it can support What it cannot establish
Plan Which subgoals, dependencies, constraints, and stopping conditions should hold in the present state? Plan structure can be inspected The plan is executable or will succeed
Execution Did an authorized action occur and produce its expected observation? The action/tool call returned the specified result Backend postcondition, global constraint, or user goal holds
Replanning After an observation, failure, or changed constraint, should work continue, substitute, roll back, escalate, or stop? An update policy can be measured on a stated distribution The agent recovers robustly in every surprise environment
Orchestration / scheduling How is work divided among workers, tools, or GPUs and merged? A stated orchestration/resource policy has a cost and latency effect It improves policy planning or terminal correctness
Acceptance Does an independent verifier confirm the final business, physical, or research postcondition? The current terminal state passed a specified check Process, plan, and all hidden side effects were correct

Agent Planning Benchmark (APB) starts from this gap. It separates holistic planning, feedback-conditioned step-wise planning, distracting/broken tools, and unsolvable tasks as upstream diagnostics for end-to-end execution benchmarks. Its evidence is scoped to its tasks and models, but it supports a necessary rule: do not assign final failure automatically to planning, or a good-looking plan automatically to execution ability.

4.2 A Contract for an Executable Plan

A natural-language plan in chat drops boundaries needed for execution, comparison, and recovery. A minimal plan version should retain:

GoalSpec       = target_postcondition, hard_constraints, soft_preferences, budget, authority
PlanVersion    = parent, state_digest, assumptions, subgoals, dependencies, stop_conditions
PlanStep       = precondition, authorized_action, expected_observation, expected_cost, recovery_boundary
Observation    = source, timestamp, provenance, state_delta | uncertainty | tool_failure
ReplanEvent    = trigger, invalidated_steps, alternatives, chosen_action, budget_delta, rationale
Acceptance     = independent_postcondition, evidence_digest, verifier_version, outcome

This does not require every agent to emit verbose JSON. It requires the harness to preserve equivalent information externally. It creates six auditable questions:

  1. Can the goal be acceptance-checked? A goal points to a checkable postcondition, not merely “finish the research” or “handle the request.”
  2. Are constraints explicit? Time, cost, authority, irreversible actions, privacy, and policy are hard or soft constraints, not prose that can disappear.
  3. Why is each step allowed? Preconditions, authority, and expected observations prevent a vaguely related tool call from concealing an unauthorized or ineffective action.
  4. When should replanning occur? Failure, absent signal, state drift, concurrent conflict, budget change, and uncertainty are explicit triggers.
  5. What does replanning affect? Record invalidated steps to avoid repeating committed side effects or treating a failed branch as current fact.
  6. When should the system refuse or stop? Infeasibility, missing critical information, insufficient authority, or exhausted budget make refusal/safe stop correct outcomes, not low-scoring trajectories.

4.3 A Plan Must Face Global Constraints, Hidden Tools, and Real Failure

DeepPlanning places active information gathering, local constraints, and global time/budget optimization in one long-horizon task. It reminds us that locally correct choices do not make a globally feasible plan, and a sequence of locally plausible actions can still violate overall feasibility, particularly when tools fail, information is absent, or a route must change.

PlanBench-XL combines a large tool ecosystem, limited tool visibility, implicit subgoals, and optional missing, broken, or distracting tools. It distinguishes planning over a known fixed tool list from planning that must discover tools and use returned evidence to choose the next step. Failures without explicit error signals especially cannot be judged by one successful tool-call response.

Situation What the planner should do What the verifier should inspect
Incomplete information Identify the gap and choose an observation action appropriate to cost and authority Did it seek relevant permitted evidence rather than invent a premise?
Global budget conflict Compare alternate paths against total time/money/tokens/risk Did local success silently breach a global hard constraint?
Tool returns an explicit error Locate the affected subgoal, then substitute, roll back, escalate, or stop Did it retry without bound, repeat a side effect, or skip the failure?
Tool fails silently Detect plan mismatch through a postcondition or later observation Was “call succeeded” incorrectly treated as “state changed”?
Unsolvable task State blocking evidence and correctly refuse or request authority/information Did it turn an impossible task into a fabricated completion?
Environment drift Compare state digests and replan locally rather than globally Did it preserve verified/committed work and mark invalid assumptions?

This is why browser, terminal, scientific, and cross-application API tasks need different verifiers. In AutomationBench, a cross-application REST workflow additionally requires endpoint discovery, layered business policy, and correct data writes; the paper grades programmatic end states. It is a useful example of backend terminal state constraining planning, not a generalization to every UI, browser environment, or business process.

The design lesson from VLAs-as-Tools also applies to software agents: a high-level agent keeps temporal plans and recovery, bounded local tools perform small tasks, and replanning is triggered by explicit progress or exception events rather than constant polling. BCER Agent binds final outputs to intermediate artifacts and measurements and emphasizes bounded local recovery. These works are not evidence of a universal winning architecture; they expose two testable variables: whether progress feedback is verifiable and whether recovery rolls back only to the affected local boundary. The plan-execute loop can therefore be inspected phase by phase:

Phase Agent responsibility What the evaluator should inspect
Plan State subgoals, dependencies, constraints, and stopping conditions Does the plan omit a hard constraint or treat an infeasible task as feasible?
Execute Call narrowly defined tools under minimum authority Does action match declared subgoal, authority, and environment state?
Observe Write progress, failures, and external state to an evidence trail Does observation come from a real tool/environment rather than self-report?
Recover Locate affected artifact/subgoal and retry, substitute, roll back, or stop Does recovery avoid redoing completed or irreversible effects?
Accept Submit final artifact to an independent verifier Do terminal state, global budget, integrity, and regressions all hold?

4.4 Replanning Is a Controlled Change, Not Infinite Retry

High-quality replanning does not turn every failure into “try again.” Each ReplanEvent should name the triggering observation, invalidated assumptions or steps, affected artifact/state, any irreversible effect, remaining budget, and how the replacement plan will be independently checked.

Recovery action When it is appropriate What it must avoid
Retry Transient, idempotent, explicitly identified failure with remaining budget Repeating permanent failure or a committed action
Substitute An equivalent tool/path with matching authority exists Widening authority or bypassing policy to succeed
Rollback The system offers a verifiable reversal boundary Pretending external effects were undone or losing audit evidence
Delegate / escalate Subproblem and authority boundary are clear, or human/higher-authority judgment is needed Uncontrolled copying of context, credentials, or write authority
Refuse / safe stop Work is infeasible, underspecified, too risky, or out of budget Fabricated completion, silent overspend, or approval bypass

Making these explicit actions lets us measure recovery quality: replan_trigger_precision, invalidated_step_accuracy, duplicate_side_effect, recovery_cost, safe_stop, and verified_success_after_replan. For long horizons, replanning connects to the checkpoint/branch contract in the memory section above: plan versions and environment state must recover together; a chat summary is not enough.

4.5 Multi-Agent Systems, Harness Edits, and GPU Scheduling Are Not Planning

ClawArena-Team evaluates a leader managing a fixed subagent pool and jointly scores task correctness with least privilege and modality routing. It separates team management from workers’ raw task solving, showing why delegation plans need separate authority, cost, and final-outcome measures.

Agentic Harness Engineering (AHE) makes editable harness components, trajectory experience, and each edit’s prediction/later verification observable. In its coding-agent setting, this edit-to-outcome connection is a controlled form of harness evolution. It does not establish that arbitrary self-editing harnesses or workflow search are RSI; evaluator, authority, and held-out acceptance must remain external to the candidate.

SAGA tackles a different layer: treating complete agent workflows as GPU scheduling units to improve task-completion latency. It is a resource-scheduling contribution for deployment, not evidence of policy planning. A system that executes the same workflow faster still needs a separate check that the workflow picked the right tools, respected constraints, and reached the terminal state.

Attribution rule: write public results as model + planner + harness + tool/authority policy + environment + scheduler + evaluator + budget. Remove any term and it becomes impossible to isolate planning quality from resource scheduling, parallel workers, or a changed verifier.

4.6 An Evaluation Matrix That Can Falsify “Can Plan”

Under the same base model, tool policy, action authority, environment initial state, total token/wall-clock/worker budget, and hidden verifier, compare at least:

Control Variable it isolates What to report
Reactive loop vs explicit plan Whether goals, dependencies, and stopping conditions are maintained explicitly Verified outcome, omitted constraints, plan cost, variance
Static plan vs feedback-conditioned replanning Whether observations update the valid plan Recovery, stale-plan error, duplicate side effect, safe stop
Fixed tools vs discovery-limited tools Whether tools are selected and replaced using evidence Discovery precision, invalid calls, tool-noise robustness
No global ledger vs constrained plan Whether total budget/policy/irreversible constraints are maintained Hard-constraint violation, cost, local-versus-terminal gap
Single agent vs delegation Whether team management has net benefit at equal budget Verified success, worker-hours, duplicate work, permission/merge violations
Outcome-only vs process diagnostics Whether plan scores actually predict terminal state and safety Plan/outcome gap, false acceptance, calibration

The minimum counterexample set contains correct endpoint plus wrong payload; successful response with no commit; missing or silently failing tools; stale state; unsolvable tasks; budget conflicts; late subagent returns; and trajectories that improve a process score without passing hidden postconditions. A rising plan score must then meet execution, integrity, and terminal-state evidence together.

4.7 Synthetic Instances and Agentic RL: Train Replanning Without Leaking Evaluation

A synthetic instance cannot supply only one successful plan. A training-useful planning instance has initial-state and visibility boundaries, goal and hard constraints, candidate tools and authority, executable transitions, perturbation/failure branches, alternate paths, refusal conditions, and an independent verifier. Training traces may show when a plan is proposed, revised, or abandoned; they cannot contain the final evaluator, hidden postcondition, successful evaluation trace, or unique answer template.

Compare SFT-only, RL-only, and SFT+RL on the same action surface, and separate final tasks by environment, workflow/rule, tool-schema/generator family, and failure/security family. Reward must report verified_outcome, hard-constraint violations, integrity violations, recovery cost, and correct refusal separately. One scalar writable by the planner or agent cannot decide every conclusion. See the synthetic-training sections of Agent Research Environments and the Agentic RL section of Agent Harness Engineering.

4.8 What Planning Adds to the Five Core Threads

Core thread New measurable object from planning What it cannot replace
RSI / OpenRSI Versioned plan/harness edit, prediction, held-out replanning regression Independent acceptance and evidence that the improver improves itself across generations
Auto Research / ART Plan lineage for research question, hypothesis, controls, cost, evidence gaps, and stopping Novelty, causal validity, replication, and peer scrutiny
Long horizon Global constraints, checkpoints, plan revisions, recovery/safe stop A long context or a longer timeout alone
ClawBench V2 / WebsiteBench Tool discovery, least privilege, backend postcondition, UI/backend-mismatch replanning Click trace, endpoint arrival, or agent final text
Synthetic training / Agentic RL Stateful plan/replan instances, failure branches, split-isolated transfer A batch of successful examples or high development reward

The conclusion here is equally modest: a plan is an inspectable intermediate artifact, not a capability declaration. Only when it updates, refuses, or completes safely under changing state, limited tools, real failures, global constraints, and an independent verifier does “the agent can plan” become an engineering conclusion.

5. Measuring Recovery: Fault Injection and the Recovery Ledger

Section 4 treated recovery actions as part of replanning; this section measures recovery on its own terms. Good recovery has a boundary: it must not rerun a full workflow to improve pass rate while hiding failure sources. An auditable recovery event records its trigger, affected scope, recovery point, invalidated evidence, retry budget, human handoff, and terminal outcome.

A minimal fault-injection set can include incomplete tool results, externally modified file or service state, corrupted checkpoints, denied authority, a summary that omits a key constraint, and a local success that already violates the global budget. For each fault, report recovery_success, state_reconstruction, duplicate_side_effect, resume_latency, and recovery_cost. If recovery raises a process score without improving independent terminal states or safety, it is another gameable reward proxy.

6. Long-Horizon Security Is Not a Repeated Single-Turn Guard

AgentLAB places intent hijacking, tool chaining, task injection, objective drift, and memory poisoning in multi-turn environments. Its narrow conclusion is that single-turn defenses do not automatically cover multi-turn attacks. For long-running agents, the state store, tool outputs, handoff documents, and subagent messages are all untrusted-input surfaces; a prior approval does not automatically authorize the next turn. This is the same trust boundary as the memory admission above: neither storage nor retrieval automatically confers authority.

Security state therefore belongs in the checkpoint: time-bounded authority, denied actions, domain/tool allowlists, trust labels on external inputs, risk escalation, and human confirmations. Final reports should at minimum separate task_outcome, integrity_violations, unsafe_action_rate, and false_block_rate; one success rate cannot cover all four.

7. “Hours” Require an Auditable Time Ledger

A wall-clock number alone is not explanatory. Each run should split wall_clock into active_agent_time, environment_build_or_reset, model_or_tool_wait, external_or_queue_wait, recovery_time, human_handoff_time, and cancelled_or_idle_time, then bind them to the same run id as tokens, tool calls, and external cost. That makes it possible to distinguish sustained agent work from system waiting, state reconstruction, or human takeover.

Time record Question it answers What becomes confounded without it
Active agent time How long the policy actually observed, reasoned, and acted Waiting or human time counted as autonomous work
Environment / external wait Time spent building, resetting, queueing, or waiting for services “Duration” differences caused by infrastructure
Recovery time and attempts Which interruptions the system actually recovered from Infinite retries packaged as persistence
Human handoff When a person diagnosed, authorized, or changed an artifact Human contribution attributed to the agent
Cancelled / idle runs Budget consumed by abandoned or non-progressing branches Survivor bias from reporting only finished samples

A fair comparison freezes the cutoff and continuation policy: when to checkpoint, when recovery is allowed, when human escalation is required, and when to safe-stop. One run can be long mostly because it waits in a queue; another can be short yet reconstruct state under a fault. They are different evidence.

8. A Falsifiable Protocol for Hours-Long Execution

The following is a design proposal, not a reported long-horizon result. It makes “works continuously for hours” a claim that can fail:

  1. Freeze task envelope and run identity. Retain task type, task manifest, initial-state digest, model/harness/tool/policy versions, budget, environment image, and evaluator hash; do not describe an in-progress benchmark’s target task count as a released result.
  2. Externalize state. Each checkpoint writes goals, constraints, artifacts, dependencies, actions, observations, failures, and resources; redact sensitive content before retention.
  3. Test recovery actively. Preregister fault-injection points and success definitions; distinguish observational replay from genuine reruns.
  4. Separate acceptance. A candidate cannot write hidden tasks, verifier, authority policy, or final release decision; judge final state and process integrity separately.
  5. Compare at equal budget. Single-agent, sequential, multi-agent, memory, and recovery variants receive the same total tokens, worker time, wall clock, retries, and external-tool allowance.
  6. Report the complete curve and time ledger. Report attempts, cancellations, recovery, regression, variance, peak concurrency, active/wait/recovery/human time, total cost, and cost per verified success, not only the best run.
Acceptance gate: call a configuration reliable for long-horizon work only when independent terminal state, state reconstruction, fault recovery, budget compliance, and safety metrics all hold. More context, more calls, or more wall clock are resources, not capability evidence.

9. How It Returns to the Core Five

Sections 3.9 and 4.8 listed what memory and planning add to the five core threads; the table below maps the long-horizon thread onto the adjacent threads.

Core thread What long horizon provides What it cannot replace
RSI / OpenRSI State, recovery, and regression evidence for candidates across generations Independent acceptance and a held-out curve showing better improvement
Auto Research / ART Experiment lineage, failures, reruns, and a resource ledger Controls, replication, and peer review for a narrow research conclusion
Environment Resettable initial state, tool events, postconditions, and fault injection Independent verifier-integrity and safety design
Synthetic training Training signals for checkpoints, recovery, state transition, and stop/refusal Evidence that synthetic trajectories transfer to unseen long-horizon tasks
Agentic RL Session-level outcomes, native-harness traces, and credit-assignment diagnostics Automatically correct step rewards or a PPO/GRPO advantage

This protocol complements Agent Harness Engineering: that note defines runtime engineering planes; this one turns them into task-envelope-specific long-horizon execution, fault, and acceptance experiments, and unpacks memory/execution state and planning/replanning as two of the controlled layers within them. See AutoResearch for when a scientific workflow can become a reviewable research claim and for adjacent memory, planning, and safety directions; Agent Research Environments for synthetic training, environment boundaries, and the state-transition and verifier contract; and Web-Agent Environments for tool governance.

Primary References