Skip to content

Show chat usage in assistant timestamp footer#551

Open
kenehong wants to merge 4 commits into
openclaw:mainfrom
kenehong:kenehong/usage-ui-options
Open

Show chat usage in assistant timestamp footer#551
kenehong wants to merge 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: needs maintainer review before merge. Reviewed June 8, 2026, 1:23 PM ET / 17:23 UTC.

Summary
The branch adds chat/session usage token fields, parses gateway usage metadata, renders latest assistant usage in the timestamp footer, shares usage formatting with tray session cards, removes the Diagnostics chat explorations launcher, and adds tray tests.

Reproducibility: not applicable. this is a feature/UI PR rather than a current-main bug report. The changed behavior is demonstrated by screenshots plus source and test inspection.

Review metrics: 3 noteworthy metrics.

  • Diff scope: 16 files, +913/-70. The change spans shared parsing, chat state, tray UI, Diagnostics UI, and tests, so maintainers should review the cross-surface behavior together.
  • Visual proof: 2 screenshots inspected. The attached proof directly shows the assistant footer usage and tray session usage surfaces changed by the PR.
  • Latest checks: 2 success, 2 skipped, 2 in progress. Source review is clean, but merge readiness still depends on the running test and e2e check-runs finishing.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
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:

  • Wait for the latest test and e2e GitHub Actions check-runs on head ccd22e1 to finish.

Risk before merge

  • [P1] Two latest GitHub Actions check-runs for head ccd22e1 were still in progress at review time, so merge should wait for required checks to finish.
  • [P1] This read-only review did not run the AGENTS.md build/test validation locally because those commands would create artifacts; the PR body reports the required validation commands.

Maintainer options:

  1. Decide the mitigation before merge
    Land the PR after the latest CI and maintainer review remain clean, keeping latest assistant metadata as the footer source with thread totals only as fallback.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair candidate remains; the next action is CI completion and ordinary maintainer merge review.

Security
Cleared: The diff is limited to UI display, JSON usage parsing, metadata state, and tests; I found no concrete security or supply-chain concern.

Review details

Best possible solution:

Land the PR after the latest CI and maintainer review remain clean, keeping latest assistant metadata as the footer source with thread totals only as fallback.

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. The changed behavior is demonstrated by screenshots plus source and test inspection.

Is this the best way to solve the issue?

Yes: the PR keeps the visible footer behavior narrow, uses latest assistant metadata before thread totals, and adds regression coverage for monotonic usage snapshots.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 37b0ea672037.

Label changes

Label justifications:

  • P3: This is a low-blast-radius UI usage-display improvement with focused tests and no blocking correctness finding.
  • 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 (screenshot): Two inspected screenshots directly show after-change assistant footer usage and tray session-card usage.
  • proof: sufficient: Contributor real behavior proof is sufficient. Two inspected screenshots directly show after-change assistant footer usage and tray session-card usage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Two inspected screenshots directly show after-change assistant footer usage and tray session-card usage.
Evidence reviewed

Acceptance criteria:

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

What I checked:

Likely related people:

  • Christine Yan: Blame on the current main chat receive path, assistant footer baseline, tray session card builder, and shared gateway parsing points to the localization/current-main pass touching the central files. (role: recent area contributor; confidence: high; commits: 85445c78066b; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs, src/OpenClaw.Tray.WinUI/Services/TrayMenuStateBuilder.cs)
  • Scott Hanselman: Recent current-main commits touched the chat provider and timeline paths that this PR extends. (role: recent area contributor; confidence: medium; commits: d23f8ca50013, d1b136347e95; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs)
  • Ranjesh: Recent current-main work changed chat provider/timeline metadata and history behavior adjacent to the usage snapshot path. (role: recent adjacent contributor; confidence: medium; commits: 9a3a7a6131a8, 3d26594b4448; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs)
  • Régis Brid: Recent chat bubble and tool-card rendering fixes touched the same assistant timeline surface where this PR adds footer usage. (role: recent adjacent contributor; confidence: medium; commits: 16929b600710; files: 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 and others added 3 commits May 28, 2026 11:02
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>
@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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: 🐚 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants