20260514:增加新内容
This commit is contained in:
39
concepts/system-message-abuse.md
Normal file
39
concepts/system-message-abuse.md
Normal 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|提示分层]]
|
||||
Reference in New Issue
Block a user