Files
nexus/wiki/concepts/Context-Reset.md
2026-05-03 05:42:12 +08:00

1.5 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Context Reset concept
agentic-ai
context-window
recovery
Your-AI-Isn-t-Stupid---It-Just-Needs-a-Better-Harness--Lychee-Technology-Engineering-Blog
2026-04-20

Overview

Context Reset——当 Context-Anxiety 触发时Harness 将当前 Agent 状态保存至磁盘、终止实例、启动全新 Agent 的程序化操作,用于解决长周期任务超出单次 context window 的问题。

Trigger Condition

if (tokens_used / max_context) > 0.7:  # 阈值需按模型调优
    trigger_context_reset()

Procedure

  1. Save state: 完整项目状态写入持久存储(磁盘文件)
  2. Terminate: 终止当前 LLM 实例
  3. Launch fresh: 启动全新 Agent加载保存状态
  4. Orient: 新 Agent 读取状态、定位自身、继续工作

Why Not In-Place Summarization?

原地摘要summarize → keep in same context仍让模型在嘈杂、退化的上下文中操作。Context Reset 提供完全干净的上下文窗口——代价更高,但可靠性显著提升,适用于超长周期任务。

Trade-off

  • In-place summarization: 便宜,但 context 仍嘈杂
  • Context Reset: 昂贵(需重新加载状态),但可靠性高

Source

See Also