Session Observer
Overview
Inspect OpenClaw session state with minimal disruption. Prefer session_status first, then summarize token usage, context pressure, cache ratio, model/runtime details, and any obvious follow-up actions.
Workflow
1. Start with session status
Use session_status first when the user asks about:
- - token usage
- model in use
- context usage
- cache hit rate
- premium/chat budget remaining
- session health
If the user refers to another session, target that session explicitly.
2. Extract the practical signals
Report the fields most useful to the user:
- - current model
- input/output token counts
- context used and total context window
- cache hit ratio
- budget or usage percentage when available
- runtime mode and whether reasoning is enabled
Do not dump raw status cards unless the user asks.
3. Interpret, do not just repeat
Classify the situation:
- - healthy: low or moderate context pressure, no obvious issues
- watch: context is growing, cache low, or usage notably climbing
- high pressure: context is large enough that compaction, a new thread, or cleanup may help
4. Recommend the smallest next step
Examples:
- - continue as-is
- start a fresh thread for a new topic
- reduce unnecessary logs or verbose outputs
- use a sub-agent for a large parallel task
- check a specific session if the user suspects cost spikes
Output format
Use:
- - Current state
- What it means
- Recommended next step
Keep it short unless the user asks for detail.
Safety rules
- - Do not invent cost numbers not shown by the tool.
- If a field is unavailable, say unavailable.
- Prefer
session_status over guesswork.
Session Observer
概述
以最小干扰检查OpenClaw会话状态。优先使用session_status,然后总结令牌使用量、上下文压力、缓存比率、模型/运行时详情,以及任何明显的后续操作。
工作流程
1. 从会话状态开始
当用户询问以下内容时,优先使用session_status:
- - 令牌使用量
- 当前使用的模型
- 上下文使用情况
- 缓存命中率
- 高级版/聊天预算剩余量
- 会话健康状态
如果用户提及另一个会话,则明确针对该会话。
2. 提取实用信号
报告对用户最有用的字段:
- - 当前模型
- 输入/输出令牌数量
- 已用上下文及总上下文窗口
- 缓存命中率
- 预算或使用百分比(如有)
- 运行时模式及是否启用推理功能
除非用户要求,否则不要直接转储原始状态卡片。
3. 解读而非简单复述
对情况进行分类:
- - 健康:上下文压力低或中等,无明显问题
- 关注:上下文正在增长,缓存较低,或使用量明显攀升
- 高压:上下文足够大,可能需要压缩、新建线程或进行清理
4. 推荐最小的下一步操作
示例:
- - 继续当前操作
- 为新主题开启新线程
- 减少不必要的日志或冗长输出
- 使用子代理处理大型并行任务
- 如果用户怀疑成本激增,检查特定会话
输出格式
使用:
除非用户要求详细信息,否则保持简洁。
安全规则
- - 不要编造工具未显示的成本数字。
- 如果某个字段不可用,则说明不可用。
- 优先使用session_status而非猜测。