fix(webchat): keep context indicator visible with stale token data#89772
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 1:30 AM ET / 05:30 UTC. Summary PR surface: Source +4, Tests +60, Docs +1. Total +65 across 4 files. Reproducibility: yes. Source inspection shows current main hides the notice when Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsDo we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main hides the notice when Is this the best way to solve the issue? Yes for the runtime shape. Displaying stale finite totals as approximate while suppressing warning and Compact is the narrow fix, and current session reconciliation preserves omitted stale totals; the remaining gaps are proof and release-owned changelog cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 06fbd84d2b1a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +4, Tests +60, Docs +1. Total +65 across 4 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
Review history (2 earlier review cycles)
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
4388ea0 to
f67e1cc
Compare
The context usage indicator was disappearing after sending a message because totalTokensFresh was set to false during the run, even though we had valid token count data from before the message was sent. Changes: - Modified getContextNoticeViewModel to show the indicator even when totalTokensFresh is false, as long as totalTokens is non-zero - Added isStale flag to indicate when token data is not fresh - Applied subtle visual styling for stale data (lighter colors, 5% opacity) - Added "(updating)" suffix to the percentage text and title when stale - Updated tests to verify the new behavior Fixes openclaw#89662
f67e1cc to
59a4d35
Compare
|
Maintainer refactor and land-ready verification complete.
Thank you @bladin for the original report and implementation direction. |
|
Merged via squash.
|
…penclaw#89772) * fix(webchat): keep context indicator visible with stale token data The context usage indicator was disappearing after sending a message because totalTokensFresh was set to false during the run, even though we had valid token count data from before the message was sent. Changes: - Modified getContextNoticeViewModel to show the indicator even when totalTokensFresh is false, as long as totalTokens is non-zero - Added isStale flag to indicate when token data is not fresh - Applied subtle visual styling for stale data (lighter colors, 5% opacity) - Added "(updating)" suffix to the percentage text and title when stale - Updated tests to verify the new behavior Fixes openclaw#89662 * test(ui): cover stale context indicator behavior * docs(changelog): note Control UI fix --------- Co-authored-by: 黑承亮0668000844 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…penclaw#89772) * fix(webchat): keep context indicator visible with stale token data The context usage indicator was disappearing after sending a message because totalTokensFresh was set to false during the run, even though we had valid token count data from before the message was sent. Changes: - Modified getContextNoticeViewModel to show the indicator even when totalTokensFresh is false, as long as totalTokens is non-zero - Added isStale flag to indicate when token data is not fresh - Applied subtle visual styling for stale data (lighter colors, 5% opacity) - Added "(updating)" suffix to the percentage text and title when stale - Updated tests to verify the new behavior Fixes openclaw#89662 * test(ui): cover stale context indicator behavior * docs(changelog): note Control UI fix --------- Co-authored-by: 黑承亮0668000844 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Fixes #89662.
What Problem This Solves
The Control UI hid the context-usage indicator as soon as a run made the cached total stale. That removed useful orientation during a response, but treating stale totals as current would also risk false warning styling and an inappropriate Compact action after the session had already compacted.
Why This Change Was Made
The view model now separates whether a finite cached total can be displayed from whether that total is fresh enough to drive actions. A stale finite total remains visible as approximate, while warning state and Compact remain gated on fresh usage. Missing or invalid totals stay hidden.
User Impact
During an active response, users keep an approximate context indicator instead of seeing it disappear. Stale data cannot trigger warning colors or offer Compact; fresh totals preserve the existing threshold and action behavior.
Evidence
run_9f30d3d15aa1passed all 8 focused view-model tests.run_b5f0e5398ceapassed all 23chat-flow.e2e.test.tsbrowser scenarios, including the new stale-context case.run_f637a2d3b9b3passed all 8 focused view-model tests and all 23chat-flow.e2e.test.tsbrowser scenarios on59a4d3549d9fd9979d51edf78856611e28a2bad9.