agent-self-recovery
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent Self-Recovery
Agent 自我恢复
State file:
~/.openclaw/skill-state/agent-self-recovery/state.yaml状态文件:
~/.openclaw/skill-state/agent-self-recovery/state.yamlSigns You're Stuck
陷入卡顿的迹象
- Tried the same approach 3+ times with the same result
- Making changes that feel random rather than targeted
- Lost track of the original goal
- Taking longer than expected on a 'simple' step
- 相同方法尝试了3次以上且得到相同结果
- 做出的改动偏随机而非针对性
- 忘记了最初的目标
- 完成「简单」步骤花费的时间远超预期
Recovery Protocol
恢复流程
Step 1: Stop
步骤1:停止
Stop making changes. No more quick tries.
停止所有改动,不要再进行快速尝试。
Step 2: Write State
步骤2:写入状态
Write to the state file:
- : what were you trying to do?
what_trying - : append this latest approach to the list
what_tried - : name the pattern (see Step 3)
loop_type - : increment by 1
attempts status: recovering- : current timestamp (first time only)
started_at
向状态文件写入以下内容:
- : 你当时正在尝试完成什么任务?
what_trying - : 将本次最新的尝试方法追加到列表中
what_tried - : 为当前模式命名(见步骤3)
loop_type - : 计数加1
attempts status: recovering- : 当前时间戳(仅首次执行时填写)
started_at
Step 3: Name the Loop
步骤3:命名循环类型
Pick the :
loop_type- — trying the same fix with minor changes
same-fix-variations - — each fix reveals a new dependency
cascading-dependencies - — unclear what the actual error is
unclear-error - — lost track of original requirement
lost-goal
选择对应的:
loop_type- — 对同一个修复方案做微小改动反复尝试
same-fix-variations - — 每一次修复都会暴露新的依赖问题
cascading-dependencies - — 无法明确实际错误是什么
unclear-error - — 忘记了最初的需求
lost-goal
Step 4: Break the Loop
步骤4:打破循环
If → use systematic-debugging first.
If → re-read the original requirement.
If genuinely blocked → document clearly, ask the user. Update state .
If context too large → use context-window-management.
If truly lost → use task-handoff, ask user to redirect. Update state .
loop_type: unclear-errorloop_type: lost-goalstatus: escalatedstatus: escalated如果 → 优先使用systematic-debugging。
如果 → 重新阅读原始需求。
如果确实遭遇阻塞 → 清晰记录问题,向用户求助。更新状态 。
如果上下文体积过大 → 使用context-window-management。
如果完全失去方向 → 使用task-handoff,请用户调整任务方向。更新状态 。
loop_type: unclear-errorloop_type: lost-goalstatus: escalatedstatus: escalatedStep 5: Resume with a New Approach
步骤5:使用新方法恢复执行
Choose a genuinely different approach. Update state , append to .
On success: update state .
last_approachwhat_triedstatus: recovered选择一个完全不同的方案。更新状态 ,追加到 列表中。
执行成功后:更新状态 。
last_approachwhat_triedstatus: recovered