docs: refresh status token fallback refs

This commit is contained in:
Peter Steinberger
2026-04-04 12:42:42 +01:00
parent fb0d60d7f3
commit a375635a9a
7 changed files with 26 additions and 14 deletions

View File

@@ -22,7 +22,9 @@ Notes:
- `--deep` runs live probes (WhatsApp Web + Telegram + Discord + Slack + Signal).
- `--usage` prints normalized provider usage windows as `X% left`.
- MiniMax's raw `usage_percent` / `usagePercent` fields are remaining quota, so OpenClaw inverts them before display; count-based fields win when present. `model_remains` responses prefer the chat-model entry, derive the window label from timestamps when needed, and include the model name in the plan label.
- When the current session snapshot is missing cache counters, `/status` can backfill `cacheRead` / `cacheWrite` from the most recent transcript usage log. Existing nonzero live cache values still win over transcript fallback values.
- When the current session snapshot is sparse, `/status` can backfill token and cache counters from the most recent transcript usage log. Existing nonzero live values still win over transcript fallback values.
- Transcript fallback can also recover the active runtime model label when the live session entry is missing it. If that transcript model differs from the selected model, status resolves the context window against the recovered runtime model instead of the selected one.
- For prompt-size accounting, transcript fallback prefers the larger prompt-oriented total when session metadata is missing or smaller, so custom-provider sessions do not collapse to `0` token displays.
- Output includes per-agent session stores when multiple agents are configured.
- Overview includes Gateway + node host service install/runtime status when available.
- Overview includes update channel + git SHA (for source checkouts).

View File

@@ -14,9 +14,11 @@ title: "Usage Tracking"
- No estimated costs; only the provider-reported windows.
- Human-readable status output is normalized to `X% left`, even when an
upstream API reports consumed quota, remaining quota, or only raw counts.
- Session-level `/status` cache counters can fall back to the latest transcript
usage entry when the live session snapshot is missing `cacheRead` /
`cacheWrite`. Existing nonzero live cache values still win.
- Session-level `/status` and `session_status` can fall back to the latest
transcript usage entry when the live session snapshot is sparse. That
fallback fills missing token/cache counters, can recover the active runtime
model label, and prefers the larger prompt-oriented total when session
metadata is missing or smaller. Existing nonzero live values still win.
## Where it shows up

View File

@@ -209,7 +209,9 @@ OpenClaw also normalizes OpenAI usage counters across transport variants before
they reach session/status surfaces. Native OpenAI/Codex Responses traffic may
report usage as either `input_tokens` / `output_tokens` or
`prompt_tokens` / `completion_tokens`; OpenClaw treats those as the same input
and output counters for `/status`, `/usage`, and session logs.
and output counters for `/status`, `/usage`, and session logs. When native
WebSocket traffic omits `total_tokens` (or reports `0`), OpenClaw falls back to
the normalized input + output total so session/status displays stay populated.
You can set `agents.defaults.models.<provider/model>.params.transport`:

View File

@@ -18,9 +18,10 @@ OpenClaw features that can generate provider usage or paid API calls.
- `/status` shows the current session model, context usage, and last response tokens.
- If the model uses **API-key auth**, `/status` also shows **estimated cost** for the last reply.
- If live session metadata is missing cache counters, `/status` can recover
`cacheRead` / `cacheWrite` from the latest transcript usage entry. Existing
nonzero live cache values still take precedence.
- If live session metadata is sparse, `/status` can recover token/cache
counters and the active runtime model label from the latest transcript usage
entry. Existing nonzero live values still take precedence, and prompt-sized
transcript totals can win when stored totals are missing or smaller.
**Per-message cost footer**

View File

@@ -70,10 +70,14 @@ field names do not change `/status`, `/usage`, or session summaries.
Gemini CLI JSON usage is normalized too: reply text comes from `response`, and
`stats.cached` maps to `cacheRead` with `stats.input_tokens - stats.cached`
used when the CLI omits an explicit `stats.input` field.
When the current session snapshot is missing cache counters, `/status` can also
recover `cacheRead` / `cacheWrite` from the most recent transcript usage log.
Existing nonzero live cache values still take precedence over transcript
fallback values.
For native OpenAI-family Responses traffic, WebSocket/SSE usage aliases are
normalized the same way, and totals fall back to normalized input + output when
`total_tokens` is missing or `0`.
When the current session snapshot is sparse, `/status` and `session_status` can
also recover token/cache counters and the active runtime model label from the
most recent transcript usage log. Existing nonzero live values still take
precedence over transcript fallback values, and larger prompt-oriented
transcript totals can win when stored totals are missing or smaller.
Usage auth for provider quota windows comes from provider-specific hooks when
available; otherwise OpenClaw falls back to matching OAuth/API-key credentials
from auth profiles, env, or config.

View File

@@ -72,7 +72,8 @@ For image work, use `image` for analysis and `image_generate` for generation or
`session_status` is the lightweight status/readback tool in the sessions group.
It answers `/status`-style questions about the current session and can
optionally set a per-session model override; `model=default` clears that
override.
override. Like `/status`, it can backfill sparse token/cache counters and the
active runtime model label from the latest transcript usage entry.
### Plugin-provided tools

View File

@@ -183,7 +183,7 @@ of treating `/tools` as a static catalog.
## Usage surfaces (what shows where)
- **Provider usage/quota** (example: “Claude 80% left”) shows up in `/status` for the current model provider when usage tracking is enabled. OpenClaw normalizes provider windows to `% left`; for MiniMax, remaining-only percent fields are inverted before display, and `model_remains` responses prefer the chat-model entry plus a model-tagged plan label.
- **Cache usage line** in `/status` can fall back to the latest transcript usage entry when the live session snapshot is missing `cacheRead` / `cacheWrite`. Existing nonzero live cache values still win.
- **Token/cache lines** in `/status` can fall back to the latest transcript usage entry when the live session snapshot is sparse. Existing nonzero live values still win, and transcript fallback can also recover the active runtime model label plus a larger prompt-oriented total when stored totals are missing or smaller.
- **Per-response tokens/cost** is controlled by `/usage off|tokens|full` (appended to normal replies).
- `/model status` is about **models/auth/endpoints**, not usage.