Skip to content

Show chat usage in assistant timestamp footer - #551

Merged
ranjeshj merged 4 commits into
openclaw:mainfrom
kenehong:kenehong/usage-ui-options
Jun 13, 2026
Merged

Show chat usage in assistant timestamp footer#551
ranjeshj merged 4 commits into
openclaw:mainfrom
kenehong:kenehong/usage-ui-options

Conversation

@kenehong

@kenehong kenehong commented May 27, 2026

Copy link
Copy Markdown
Contributor
image image

## Summary

  • Show context usage next to the latest assistant message timestamp
  • Keep usage snapshots monotonic so displayed usage does not decrease
  • Share usage formatting between chat and tray session cards
  • Round the tray usage progress fill to match the track
  • Hide the chat explorations launcher from Diagnostics

Validation

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed June 13, 2026, 1:30 AM ET / 05:30 UTC.

Summary
The PR adds chat/tray usage formatting and metadata propagation, displays latest assistant usage in the assistant timestamp footer, and removes the chat explorations diagnostics/preset surface.

Reproducibility: not applicable. this is a feature/UI PR rather than a current-main bug report. Source inspection and screenshots verify the proposed display behavior, and no failing current-main reproduction is required.

Review metrics: 3 noteworthy metrics.

  • Diff scope: 31 files, +1055/-2588. The PR spans chat models, gateway parsing, tray UI, diagnostics cleanup, resources, and tests, so the compatibility-sensitive removal should be reviewed deliberately.
  • Design surface deletion: 8 source files deleted. The deleted chat explorations files are the surface that previously loaded and applied persisted preview presets.
  • Visual proof: 2 screenshots inspected. The attached images directly show the user-visible assistant footer and tray session usage displays.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

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

Rank-up moves:

  • Get explicit maintainer acceptance for retiring chat explorations, or split that cleanup from the usage footer feature.
  • [P2] Wait for the required GitHub build/test rollup to finish for the current head.

Risk before merge

  • [P1] Existing users with a saved chat exploration default will stop seeing that preset applied, and Diagnostics can no longer open the exploration preview unless maintainers intentionally retire that surface.
  • [P1] At inspection time the GitHub check rollup still had test/e2e jobs in progress, and local AGENTS.md validation was not run because this review is read-only.

Maintainer options:

  1. Split the exploration removal (recommended)
    Keep the usage footer work here and move deletion of the diagnostics preview and saved preset path into a separate maintainer-reviewed PR.
  2. Accept the preview retirement
    Merge with an explicit maintainer decision that saved chat exploration defaults and the Diagnostics launcher may stop working after upgrade.
  3. Pause if the preview still matters
    Hold or close this branch if chat explorations remain needed for design iteration, debugging, or upgrade compatibility.

Next step before merge

  • [P2] The remaining blocker is maintainer judgment on whether removing chat explorations and persisted presets is acceptable, not a narrow automated repair.

Security
Cleared: The diff does not add dependencies, workflows, secret handling, downloaded code, or new code execution paths; no concrete security or supply-chain issue was found.

Review findings

  • [P1] Preserve or explicitly retire saved chat exploration presets — src/OpenClaw.Tray.WinUI/App.xaml.cs:516
Review details

Best possible solution:

Land the usage footer after required validation finishes, with either the chat explorations removal split out or an explicit maintainer decision that the persisted exploration preset surface is retired.

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

Not applicable: this is a feature/UI PR rather than a current-main bug report. Source inspection and screenshots verify the proposed display behavior, and no failing current-main reproduction is required.

Is this the best way to solve the issue?

Partly: the shared formatter and latest-assistant metadata path are a maintainable way to add the usage footer. Bundling the feature with removal of the persisted chat explorations surface is not the safest merge path without explicit maintainer acceptance.

Full review comments:

  • [P1] Preserve or explicitly retire saved chat exploration presets — src/OpenClaw.Tray.WinUI/App.xaml.cs:516
    At this hunk the startup call that applies a user's saved chat exploration default is removed, while the PR also deletes the preset store. Existing %APPDATA%\OpenClawTray\chat-exploration-presets.json defaults will be ignored after upgrade unless maintainers intentionally retire this preview surface, so please keep/split the compatibility path or document explicit acceptance before merging.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): Two inspected screenshots show the after-change assistant footer usage and tray session usage display.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P3: This is a low-blast-radius UI feature and engineering-preview cleanup, with a compatibility decision before merge but no core runtime breakage.
  • merge-risk: 🚨 compatibility: The PR removes the chat explorations Diagnostics surface and saved preset application path, changing upgrade behavior for users of that preview configuration.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): Two inspected screenshots show the after-change assistant footer usage and tray session usage display.
  • proof: sufficient: Contributor real behavior proof is sufficient. Two inspected screenshots show the after-change assistant footer usage and tray session usage display.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Two inspected screenshots show the after-change assistant footer usage and tray session usage display.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its validation policy matters here, but this review could not run build/test commands because the prompt requires a byte-for-byte read-only checkout. (AGENTS.md:1, d4284d43fb6a)
  • Current main lacks the requested usage footer implementation: No DefaultUsageSummary, ChatUsageFormatter, or usageSummary symbols exist on current main, so the central PR work is still unique and not implemented on the default branch. (d4284d43fb6a)
  • Usage footer implementation: The PR head computes a default usage summary from latest assistant metadata before falling back to thread totals and passes it into the timeline for latest-assistant footer rendering. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs:1286, 56dd05ed6c9b)
  • Usage snapshot behavior: The PR head snapshots assistant usage contributions and session totals onto assistant metadata while preserving monotonic response usage. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs:3317, 56dd05ed6c9b)
  • Compatibility-sensitive preset removal: Current main applies a saved default chat exploration preset at startup and stores presets under OpenClawTray/chat-exploration-presets.json; the PR removes that startup call and deletes the preset store. (src/OpenClaw.Tray.WinUI/App.xaml.cs:516, d4284d43fb6a)
  • Real behavior proof inspected: Both PR screenshots downloaded successfully and show the assistant footer usage plus tray session usage display after the change.

Likely related people:

  • RBrid: Blame shows RBrid introduced the startup default-preset application that this PR removes, and recent current-main commits changed the native chat provider/timeline area. (role: introduced behavior and recent adjacent contributor; confidence: high; commits: 16929b600710, 3fdfbfad837f, 5505a85da7df; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs)
  • ranjeshj: Recent current-main commits touched chat timeline accessibility and chat provider history metadata, and the latest PR head commit also removes the chat exploration dead code. (role: recent area contributor; confidence: high; commits: 58639f6df10d, 9a3a7a6131a8, 56dd05ed6c9b; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/Explorations)
  • Scott Hanselman: Recent current-main commits changed and hardened nearby chat provider/timeline paths, though less directly than the primary routing candidates. (role: recent adjacent contributor; confidence: medium; commits: d23f8ca50013, d1b136347e95; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs)
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.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown

ClawSweeper PR egg

🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress.

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.
What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@kenehong
kenehong marked this pull request as ready for review May 27, 2026 16:26
@kenehong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 28, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@kenehong
kenehong force-pushed the kenehong/usage-ui-options branch from 896b132 to 2c8997f Compare May 28, 2026 18:45
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels May 28, 2026
@ranjeshj
ranjeshj force-pushed the kenehong/usage-ui-options branch from ccd22e1 to febe165 Compare June 13, 2026 05:08
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Jun 13, 2026
kenehong and others added 4 commits June 12, 2026 22:16
Add usage placement controls for the native chat explorations UI and render context usage in the selected chat/composer locations.

Share usage formatting between chat and tray session cards, keep assistant usage monotonic, and round the tray usage bar fill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the usage display focused on the assistant timestamp footer and remove the exploration placement options from the PR surface.

Hide the chat explorations launcher from Diagnostics and update the page contract test accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prefer latest assistant entry metadata for timestamp footer usage and cover lower thread total regressions. Keep UseMemo dependencies nullable-safe after rebase.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ranjeshj
ranjeshj force-pushed the kenehong/usage-ui-options branch from febe165 to 56dd05e Compare June 13, 2026 05:24
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 13, 2026
@ranjeshj
ranjeshj merged commit ff38d84 into openclaw:main Jun 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants