fix(usage): make built-in footer easier to wrap on Telegram#92877
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:50 PM ET / 16:50 UTC. Summary 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.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -12, Tests +3, Docs -9. Total -18 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
78e63bb to
367ca8e
Compare
367ca8e to
78e63bb
Compare
0746194 to
30d73af
Compare
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).
30d73af to
817b06b
Compare
|
Landed via rebase onto main.
Thanks @Marvinthebored! |
Summary
/usage fulldefault footer so Telegram has a cleaner wrap point.Real behavior proof
Behavior addressed: the built-in
/usage fulldefault 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 samesrc/auto-reply/usage-bar/default-template.tschange onto this clean PR branch.Evidence after fix: Copied live Telegram-observed footer shape from the verified turn:
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. Custommessages.usageTemplateoverrides are unaffected by this source-only default-template change.Verification
node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts -- src/auto-reply/usage-barnode scripts/run-vitest.mjs src/auto-reply/reply/agent-runner.misc.runreplyagent.test.tspnpm oxfmt src/auto-reply/usage-bar/default-template.tsreported the file clean.pnpm tsgowas 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 custommessages.usageTemplate.