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