← Back to library

故障排查技巧:提示缓存异常时用“0 输出高成本”规则触发自动降级

场景:升级后 cacheWrite 异常偏高,出现“输出为 0 但单次高费用”。做法:建立会话成本哨兵,触发后自动切换到低成本模型并暂停高风险自动任务。

GITHUBDiscovered 2026-02-18Author @qonnectv
Prerequisites
  • Session usage/cost telemetry is enabled and queryable per turn.
  • You have an approved fallback model profile for emergency cost control.
Steps
  1. Define anomaly thresholds (e.g., output_tokens=0 with unusually high input cost over N consecutive turns).
  2. When threshold triggers, freeze non-critical automations and route new work to fallback model.
  3. Capture before/after telemetry snapshot and compare cacheRead/cacheWrite ratio.
  4. Open incident record and only re-enable primary model after controlled regression prompts pass.
Commands
openclaw gateway status
openclaw session status
openclaw gateway restart
Verify

Fallback path reduces per-turn spend and restores non-zero outputs while incident remains contained.

Caveats
  • Issue report is community evidence, not a confirmed root cause; treat mitigations as temporary until upstream fix is verified.
  • Thresholds are workload-dependent; overly tight limits can create false positives and unnecessary failovers(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post