From 7328caba82e7922e0bcf4755b66255103ae4e272 Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Sat, 13 Jun 2026 17:57:59 +0530 Subject: [PATCH] fix(usage): simplify default full footer --- docs/concepts/usage-tracking.md | 116 ++++++++++--------- src/auto-reply/usage-bar/default-template.ts | 39 ++----- src/auto-reply/usage-bar/template.test.ts | 43 ++----- src/auto-reply/usage-bar/template.ts | 51 +++----- 4 files changed, 91 insertions(+), 158 deletions(-) diff --git a/docs/concepts/usage-tracking.md b/docs/concepts/usage-tracking.md index 737ebcb447c6..d96ce1038937 100644 --- a/docs/concepts/usage-tracking.md +++ b/docs/concepts/usage-tracking.md @@ -32,8 +32,13 @@ title: "Usage tracking" ## Custom `/usage full` footer -`messages.usageTemplate` customizes the per-response `/usage full` footer. The -value is a JSON file path (supports `~`) or an inline object: +`/usage full` shows a built-in compact footer with model, reasoning, fast/slow, +context window, final-call tokens, cache, and cost when those fields are +available. No template file is required. + +`messages.usageTemplate` is only for advanced custom layouts. The value is a +JSON file path (supports `~`) or an inline object, and it replaces the built-in +footer when valid: ```json { @@ -43,35 +48,30 @@ value is a JSON file path (supports `~`) or an inline object: } ``` -Set it to the string `"default"` to use OpenClaw's built-in footer as-is: - -```json -{ "messages": { "usageTemplate": "default" } } -``` - -When unset, the legacy single-line footer is used; `"default"` opts into the -richer built-in footer (model, reasoning, fast/slow, context-window bar, last-call -tokens, cache, cost). - -Your template is **merged over that built-in footer**, the same way other config -objects layer over defaults: nested objects (`scales`, `aliases`) extend -key-by-key, while an `output.surfaces.` piece list replaces that -channel's default. So a template only needs to contain what it adds or changes — -start from `"default"` and override just the pieces you want. A missing, -unreadable, or invalid template falls back to the built-in line. +Missing, unreadable, invalid, or empty templates fall back to the built-in +footer. ### Shape ```jsonc { "schema": "openclaw.usageBar.v1", - "scales": { "": "low→high glyphs" }, // string (1 glyph/char) or array + "scales": { "": "low-to-high glyphs" }, // string (1 glyph/char) or array "aliases": { "": { "": "