Skip to content

fix(usage): make built-in footer easier to wrap on Telegram#92877

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Marvinthebored:feat/usage-default-telegram-friendly
Jul 1, 2026
Merged

fix(usage): make built-in footer easier to wrap on Telegram#92877
obviyus merged 3 commits into
openclaw:mainfrom
Marvinthebored:feat/usage-default-telegram-friendly

Conversation

@Marvinthebored

@Marvinthebored Marvinthebored commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Simplify the built-in /usage full default footer so Telegram has a cleaner wrap point.
  • Keep the model/provider/status badges compact and glue the context meter label to the meter.
  • Remove the default token-count and cache-percentage atoms from the stock footer; custom templates can still add them back.

Real behavior proof

Behavior addressed: the built-in /usage full default footer should be easier to read on Telegram/mobile surfaces, with the footer on its own line and a cleaner wrap point before the context meter instead of arbitrary breaks around the meter.

Real environment tested: MarvinMBP live OpenClaw gateway, real Telegram direct chat, running the patched dist built from the matching source change before this source-only PR was extracted.

Exact steps or command run after this patch: Patched the live default template, hard-restarted the gateway with launchctl kickstart -k, sent real Telegram messages through the gateway, and asked Peter to inspect the resulting mobile Telegram footer wrap. Then extracted the same src/auto-reply/usage-bar/default-template.ts change onto this clean PR branch.

Evidence after fix: Copied live Telegram-observed footer shape from the verified turn:

pioneer🤖opus48📌🌗⚡️ |
📚[⣿⣿⡀⠐⠐]1000k 💰0.0035

Peter's live verdict after checking the patched Telegram output: "That's acceptable. Please make a PR with that minor adjustment. Then I can forget about it and put my own custom footer back :)"

Observed result after fix: The footer rendered as an acceptable mobile Telegram default. The books/meter section still can wrap on very narrow displays, but the v2 default is materially cleaner and acceptable for the stock template.

What was not tested: No isolated Telegram bot-to-bot proof run for this PR head. The behavior was proven in the live local gateway before extraction. Discord was not re-proven in this PR turn beyond preserving the same -# surface shape with the simplified atoms. Custom messages.usageTemplate overrides are unaffected by this source-only default-template change.

Verification

  • Focused usage-bar tests passed locally: node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts -- src/auto-reply/usage-bar
  • Reply-agent footer tests passed locally: node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts
  • pnpm oxfmt src/auto-reply/usage-bar/default-template.ts reported the file clean.
  • pnpm tsgo was attempted locally; it hit pre-existing unrelated main-branch TypeScript errors outside this file. The changed default-template file and focused usage-bar tests are clean.

Notes

This is intentionally a conservative default-footer adjustment, not a template-engine change. It trades some dense telemetry (↕️ token counts and 🗄 cache percentage) for better mobile readability in Telegram. Users who want the denser version can keep using a custom messages.usageTemplate.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. size: XS labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:50 PM ET / 16:50 UTC.

Summary
The PR compacts the built-in /usage full footer, removes token/cache atoms from the stock fallback and Discord layouts, and updates usage docs/tests to match.

PR surface: Source -12, Tests +3, Docs -9. Total -18 across 5 files.

Reproducibility: not applicable. as a strict bug reproduction: this is a UX/default-output change. Source inspection verifies the behavior delta, and the PR body supplies live Telegram output for the intended wrap improvement.

Review metrics: 1 noteworthy metric.

  • Stock footer layouts changed: 2 changed: fallback default and Discord. Both layouts are shipped /usage full defaults, so maintainers should notice the telemetry reduction before merge.

Stored data model
Persistent data-model change detected: persistent cache schema: docs/reference/prompt-caching.md, persistent cache schema: docs/reference/token-use.md, vector/embedding metadata: docs/reference/token-use.md. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the current merge conflict against main.
  • Get maintainer confirmation on compact stock footer everywhere versus Telegram-only layout.

Mantis proof suggestion
A native Telegram Desktop proof would directly show the footer wrapping and no-extra-blank-line behavior. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify /usage full renders the compact footer with clean wrapping and no extra blank line.

Risk before merge

  • [P2] Merging this PR changes shipped stock fallback and Discord /usage full output for existing users by removing token/count and cache-percentage atoms unless maintainers accept the compact stock contract.
  • [P2] The PR title and live proof are Telegram-focused, while the implementation changes shared fallback and Discord layouts too.
  • [P1] GitHub currently reports the PR as conflicting/dirty against current main, so conflict resolution is required before any merge decision.

Maintainer options:

  1. Accept Compact Stock Footer
    Maintainers can intentionally accept the new stock contract, relying on /usage tokens and custom messages.usageTemplate layouts for users who want dense token/cache telemetry.
  2. Scope The Change To Telegram
    Add an output.surfaces.telegram compact layout and restore fallback/Discord token/cache atoms before merge if the readability fix should not change other surfaces.
  3. Pause Until Product Direction Is Explicit
    Keep the PR open but unmerged until a maintainer chooses whether stock /usage full should become compact everywhere or only on Telegram.

Next step before merge

  • [P2] The remaining action is maintainer judgment on the product-wide footer contract plus conflict resolution, not a narrow automated code repair.

Security
Cleared: The diff changes docs, tests, and an in-repo usage footer template only; no dependency, workflow, secret, permission, or code-execution surface changed.

Review details

Best possible solution:

Land after conflict resolution only if maintainers accept the compact stock footer across fallback and Discord; otherwise add a Telegram-specific surface and keep current stock telemetry elsewhere.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a strict bug reproduction: this is a UX/default-output change. Source inspection verifies the behavior delta, and the PR body supplies live Telegram output for the intended wrap improvement.

Is this the best way to solve the issue?

Unclear as a product decision: the implementation is coherent if maintainers want a compact stock footer everywhere, but the existing surface dispatch also supports a safer Telegram-only layout.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against db97bc1e4fcf.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority user-visible footer readability improvement with limited blast radius and a clear maintainer decision point.
  • merge-risk: 🚨 compatibility: The PR changes shipped stock fallback and Discord /usage full output by removing token/cache telemetry for existing users without custom templates.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix copied live Telegram output plus a live human inspection verdict for the patched gateway footer formatting.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix copied live Telegram output plus a live human inspection verdict for the patched gateway footer formatting.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram /usage full footer formatting that can be demonstrated in a short Telegram Desktop recording.
Evidence reviewed

PR surface:

Source -12, Tests +3, Docs -9. Total -18 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 24 -12
Tests 1 14 11 +3
Docs 3 25 34 -9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 51 69 -18

What I checked:

  • PR head changes stock footer layouts: At PR head, both output.default and output.surfaces.discord keep model/context/cost pieces but no longer include split-token, total-token, or cache-percentage atoms. (src/auto-reply/usage-bar/default-template.ts:27, 30d73af1ae03)
  • Current main keeps token/cache atoms: Current main still renders split-token, total-token, cache-percent, and cost atoms in the built-in fallback footer, so the central PR behavior is not already on main. (src/auto-reply/usage-bar/default-template.ts:37, db97bc1e4fcf)
  • Latest release keeps old stock footer: The latest release tag v2026.6.11 also contains the token/cache atoms in the fallback and Discord stock layouts, making this a shipped-default behavior change. (src/auto-reply/usage-bar/default-template.ts:37, e085fa1a3ffd)
  • Renderer supports a Telegram-specific alternative: The renderer selects output.surfaces[surface] before falling back to output.default, so maintainers could scope the compact layout to Telegram if they do not want to change fallback and Discord stock output. (src/auto-reply/usage-bar/translator.ts:236, db97bc1e4fcf)
  • Single newline is caller-owned: appendUsageLine inserts exactly one newline unless the existing payload already ends with one, which explains the latest PR head removing the explicit template-leading newline while testing ok\nanthropic.... (src/auto-reply/reply/agent-runner-usage-line.ts:113, db97bc1e4fcf)
  • Proof and current merge state: Live PR metadata reports sufficient structured real-behavior proof in the body, maintainer-modifiable branch state, and mergeable=CONFLICTING / mergeStateStatus=DIRTY against current main. (30d73af1ae03)

Likely related people:

  • Marvinthebored: Live PR history for feat(usage): ship built-in /usage full footer #92657 shows this account authored the merged built-in /usage full footer work, and local commits in that lineage introduced the renderer/template files this PR changes. (role: usage renderer and default footer feature contributor; confidence: high; commits: 64d0fc83364e, cc831f8684fd; files: src/auto-reply/usage-bar/default-template.ts, src/auto-reply/usage-bar/translator.ts, src/auto-reply/usage-bar/contract.ts)
  • obviyus: GitHub metadata shows this account merged the built-in footer PR, and local history shows recent commits simplifying and preserving current footer behavior in the same template/test surface. (role: merger and recent usage-template contributor; confidence: high; commits: 7328caba82e7, 84cbaf1832dd, 30d73af1ae03; files: src/auto-reply/usage-bar/default-template.ts, src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts, docs/concepts/usage-tracking.md)
  • Peter Steinberger: Local history shows adjacent work preserving usage footers in Telegram/tool-only reply paths and earlier usage cost reporting, which makes this person relevant for footer delivery behavior. (role: adjacent usage-footer delivery contributor; confidence: medium; commits: 8f941ea0acb7, 151523f47b9b; files: src/auto-reply/reply/agent-runner-usage-line.ts, src/auto-reply/reply/agent-runner.ts, docs/reference/token-use.md)
  • Vincent Koc: Current-main blame for the inspected default template points through a recent snapshot commit, though older feature commits are stronger ownership signals. (role: recent current-main snapshot contributor; confidence: low; commits: 10d463d5ad8c; files: src/auto-reply/usage-bar/default-template.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed size: XS proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@Marvinthebored Marvinthebored force-pushed the feat/usage-default-telegram-friendly branch from 78e63bb to 367ca8e Compare June 16, 2026 01:42
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 16, 2026
@Marvinthebored Marvinthebored force-pushed the feat/usage-default-telegram-friendly branch from 367ca8e to 78e63bb Compare June 16, 2026 01:45
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 16, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jul 1, 2026
@obviyus obviyus force-pushed the feat/usage-default-telegram-friendly branch from 0746194 to 30d73af Compare July 1, 2026 16:44
The built-in default footer (added in openclaw#92657) only defined a `discord`
surface. Telegram and every other surface fall through to `output.default`,
which was authored for a wide terminal: space-separated badges, a leading
space-less join onto the message body, and ↕️ token + 🗄 cache% segments.

On a narrow Telegram screen this wrapped at arbitrary spaces (often mid-meter
or between 📚 and its bar) and welded onto the end of the message text.

Make `default` read well on a phone:
- Leading \n so the footer sits on its own line below the body.
- Tight badges (no separators between model/flags/reasoning/fast).
- NBSP before "|" and 💰; 📚 glued hard to the meter so it can't wrap there.
- Single regular space after "|" as the only sanctioned wrap point.
- Drop ↕️ tokens and 🗄 cache% from the default — noise for most users
  (still available to anyone via a custom messages.usageTemplate).

Discord surface trimmed to match for consistency (keeps its -# dim header).
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 1, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 1, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 1, 2026
@obviyus obviyus force-pushed the feat/usage-default-telegram-friendly branch from 30d73af to 817b06b Compare July 1, 2026 16:52
@obviyus obviyus merged commit 4895a00 into openclaw:main Jul 1, 2026
94 checks passed
@obviyus

obviyus commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Scoped tests: node scripts/run-vitest.mjs src/auto-reply/usage-bar/template.test.ts src/auto-reply/usage-bar/translator.test.ts src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts
  • Checks: required checks reported none before merge
  • Review: autoreview clean on the rebased branch
  • Changelog: not updated; release generation owns CHANGELOG.md
  • Land commit: 817b06b
  • Merge commit: 4895a00

Thanks @Marvinthebored!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants