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

1.7 KiB
Raw Blame History

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

Overview

Context Anxiety——当 LLM 的 context window 使用率超过约 70% 容量,或延迟升高时,模型表现出"仓促"行为的现象:跳过步骤、过早完成任务或过早宣告成功。

Mechanism

  • Context window 是模型的唯一记忆空间
  • 当感知到"墙壁在逼近"token 限制),模型开始优先"快速完成"而非"正确完成"
  • 这不是模型能力问题,而是 context 容量压力的系统性反应

Detection

  • 监控 tokens_used / max_context > 0.7 阈值(需按模型和工作负载调优)
  • 延迟 spikes 也是触发信号

Solution: Context Reset

当 Context Anxiety 触发时Harness 执行程序化 Context Reset

  1. save_state_to_disk(state) — 完整项目状态写入持久存储
  2. terminate_current_instance() — 终止当前 LLM 实例
  3. launch_fresh_agent(state) — 启动全新 Agent从保存状态恢复

关键代码:

if (tokens_used / max_context) > 0.7:
    save_state_to_disk(state)
    terminate_current_instance()
    launch_fresh_agent(state)

Note on In-Place Summarization

原地摘要in-place summarization不够——它仍然让模型在杂乱、退化的 context 上操作。Context Reset 给予模型干净的处理空间。

Source

See Also