mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:01:01 +00:00
fix: use prompt snapshots for live context diagnostics
This commit is contained in:
@@ -101,6 +101,13 @@ Assistant transcript entries persist the same normalized usage shape, including
|
||||
returns usage metadata. This gives `/usage cost` and transcript-backed session
|
||||
status a stable source even after the live runtime state is gone.
|
||||
|
||||
OpenClaw keeps provider usage accounting separate from the current context
|
||||
snapshot. Provider `usage.total` can include cached input, output, and multiple
|
||||
tool-loop model calls, so it is useful for cost and telemetry but can overstate
|
||||
the live context window. Context displays and diagnostics use the latest prompt
|
||||
snapshot (`promptTokens`, or the last model call when no prompt snapshot is
|
||||
available) for `context.used`.
|
||||
|
||||
## Cost estimation (when shown)
|
||||
|
||||
Costs are estimated from your model pricing config:
|
||||
|
||||
Reference in New Issue
Block a user