Repository navigation
Conversation
- The composer context popover now ends with a Tokens per second section: current rate, mean (mu) and p95 over recent model calls in the session. - Live estimates are prefixed with ~ while a turn streams; unavailable values show a placeholder until the first sample. - The popover subscribes to the provider's throughput notifications through a new IChatThroughputSource, so an open popover refreshes without re-rendering the transcript. The pre-openclaw#2117 strip below the composer stays removed. - Restored ChatUsageFormatter.FormatThroughput and localized the new strings in all six resource languages.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesAdds current, mean, and p95 tokens-per-second values to the chat context popover. Example: Open the context ring after a response measured at 42.26 tokens per second.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it restores useful throughput visibility without undoing the compact composer, and no definite introduced code bug was found. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe existing chat provider tracks per-thread throughput from Gateway events; the composer passes that source to the context indicator, which formats statistics and refreshes its flyout. flowchart TD
A[Gateway chat events] --> B[Chat data provider]
B --> C[Existing throughput tracker]
C --> D[Throughput notifications]
D --> E[Context usage indicator]
C --> E
E --> F[Formatted popover values]
Technical reviewBest possible solution: Keep throughput in the existing context popover and retain the current tracker as its sole data owner. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that throughput remains tracked but is absent from the context popover; no runtime reproduction was performed. Is this the best way to solve the issue? The focused extension reuses existing measurement and presentation owners, preserves the intentionally removed strip, and adds distinct formatter and mounted-refresh coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8d31176d3ad4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 3:25 AM ET / 08:25 UTC. |

What Problem This Solves
Windows Companion's chat composer shows context-window fullness and the latest run's tokens, but nothing about how fast the model is replying. Before #2117 a tokens-per-second strip sat under the composer; that strip was removed when the composer was made compact, so model speed became invisible even though the client still tracks it.
User Impact
User impact: opening the context ring now shows this session's model throughput (current rate, mean and p95 tokens per second), including a live estimate while a reply streams, without bringing back the extra row under the composer.
Why This Change Was Made
The data never left the client:
ChatThroughputTrackerstill samples every run andOpenClawChatDataProviderstill exposesGetThroughputandThroughputChanged. This change reconnects that data inside the existing popover through a smallIChatThroughputSourceinterface, and the indicator subscribes so an open popover refreshes during streaming without re-rendering the transcript. Values are local estimates derived from streamed text andusageevents; no provider-reported rate is claimed.Evidence
42.3 tps · μ 38.5 · p95 51.0, with~marking the live estimate while a turn streams and—before the first sample.ContextRing_TracksUsageAndKeepsGeometryWhileTypingopens the popover, asserts the placeholder row, publishes throughput for the thread, and asserts the flyout stayed open and shows42.3 tps · μ 38.5 · p95 51.0.ChatUsageFormatterTestscovers live-vs-completed preference, placeholder text, and integer formatting at 100+.ChatThroughputStripabsence is still asserted), and the ring still hides when the context window size is unknown.Required proof pools
windows-winui-interactive: the composer context popover layout, localization, and the live refresh of the open flyout changed.Validation
Run against commit
85dfa0dd8don a native Windows 11 x64 host, Debug../build.ps1dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restoreOPENCLAW_REPO_ROOT=<repo> dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj --no-build -r win-x64 -p:Platform=x64 --filter "FullyQualifiedName~ContextRing_TracksUsageAndKeepsGeometryWhileTyping"dotnet test ./tests/OpenClaw.Tray.Tests/... --filter "FullyQualifiedName~TestDeterminismGuardTests"WaitForRenderedConditionAsync, not a settle delay)dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoreInstalledFileWorkerResolverTests(FileTransfer) andMxc*cases; they reproduce identically without this change, and noOpenClaw.Sharedfile is touched. Reported, not claimed clean../scripts/validate-docs.ps1Independent review: shared
autoreviewhelper, Codex engine (codex-cli 0.162.1),--mode commit --commit 85dfa0dd8d --max-priority P3. Statusscoped-clean, reportreview_status: scoped-clean,report_produced: true, process exit 0, overall correctness 0.86, no accepted or filtered findings. That run noted it could not verify Reactor hook semantics or runtime behavior from its sandbox; the focused UI test above covers those.Earlier failure retained
One earlier Tray run failed
NativeToolProjectorTests.ToolOutput_PreservesTheFormerPreviewTailAndRetainsTheEntrySafetyBudgetwith a regex timeout insideExecApprovalSecretRedactor. The isolated rerun passed and the final full run was clean; no tool-projector or redactor code is part of this change.Real behavior proof
85dfa0dd8d.ChatContextUsage, asserts the popover shows10.0K / 10.0K · 100%,Input 120,Output 0, and— tps · μ — · p95 —, then publishesChatThroughputStats(42.26, 61.04, 38.5, 51.0, 3)for the thread and waits for the rendered popover.42.3 tps · μ 38.5 · p95 51.0; ring geometry and popover identity were unchanged by a draft edit; noChatThroughputStripelement exists.windows-winui-interactiveremains scheduled, not executed), the live~estimate against a real streaming Gateway, ARM64, and Release. The mounted test publishes synthetic statistics through the same provider interface the app uses.Change Type
Scope
winnodeSecurity Impact
Compatibility and Migration
Backward compatible presentation change; no config, migration, or user action. The percentage-only numbers are local estimates and
—marks anything not yet measured.Review Conversations