20260514:增加新内容

This commit is contained in:
2026-05-14 13:54:52 +08:00
parent 56c4d3ef7c
commit b116710e4c
294 changed files with 10682 additions and 255 deletions

View File

@@ -0,0 +1,39 @@
---
title: "System Message Abuse系统消息滥用"
created: 2026-05-11
updated: 2026-05-11
type: concept
tags: [agent-architecture, anti-pattern, state-management]
sources: [[prompt-caching-architecture]]
---
# System Message Abuse系统消息滥用
## 定义
System Message Abuse 是指在 Agent 运行期间频繁更新 System Message 来切换状态的反模式行为。每次更新 System Message 本质上等同于发送一个新 Prompt → [[cache-invalidation|缓存破裂]]。
## 错误示例
```
system("你现在处于高波动监控模式") → 缓存失效!
system("切换到常规交易模式") → 再次失效!
```
## 正确做法
**状态管理工具化**:通过 `set_system_state` 工具调用或在 User Message 中追加 XML 标签:
```xml
<state_update>
mode: emergency_liquidation
trigger_reason: volatility_spike
</state_update>
```
前缀System Prompt + Tools保持缓存命中模型通过解析最新消息理解当前状态。
## 相关概念
- [[prompt-caching|Prompt Caching]]
- [[cache-invalidation|缓存失效]]
- [[prompt-layering|提示分层]]