Repository navigation
feat(usage): rebuild the Usage page with the web page's sessions, charts and filters - #1895
Conversation
…rts and filters Replace the classic XAML Usage page with a Reactor page that gives Windows users the same usage information as the web Control UI: reporting range with presets, time zone and scope, totals, daily token and cost charts, started-by attribution, overview stats and top lists, cost windows, heatmap, activity by time, a sessions list with per-session details, provider plans, and CSV/JSON export. Gateway JSON is parsed in OpenClaw.Shared (sessions.usage, .timeseries, .logs, usage.status, usage.cost) and projected by WinUI-free presentation code with unit tests. Released Gateways that reject the newer sessions.usage overview parameters get a basic view; Gateways without sessions.usage fall back to usage.cost totals. Depends on Reactor analyzer fixes microsoft/microsoft-ui-reactor#1427 and microsoft/microsoft-ui-reactor#1428; with stock 0.1.0-preview.12 the build reports 7 REACTOR_DSL_001/REACTOR_A11Y_001 false positives. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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: needs changes before merge. What this changesThis PR replaces the Usage page with native session analytics, charts, custom ranges, provider allowances and CSV exports. Example: Inspect usage for October 21–27, 2026.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep open: this collaborator-authored feature adds useful analysis absent from main, but three correctness defects need repair before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Usage controller sends authenticated operator reads to the Gateway, projects reported metadata into Reactor views, and delegates chat navigation, browser launch and CSV saving to existing Windows owners. flowchart LR
A[Usage controls] --> B[Usage controller]
B --> C[Operator Gateway client]
C --> D[Gateway usage methods]
D --> E[Typed usage projections]
E --> F[Native charts and sessions]
B --> G[CSV save and navigation]
Technical reviewBest possible solution: Keep the controller/projection split, fence exports immediately before file writing, and reuse the existing completeness and allowance-validity policies. Do we have a high-confidence way to reproduce the issue? The three failing paths follow directly from current source and existing input models; no target code, build or tests were executed during this read-only review. Is this the best way to solve the issue? The native analysis feature has clear value, and its existing owners can handle the remaining fixes without additional services or configuration. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1c223f14f6b6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What 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. Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed November 9, 2026, 6:10 PM ET / 23:10 UTC (Revision 2). |
Resolve additive resource conflicts without dropping either set of translations. Co-authored-by: Copilot App <[email protected]>
Current-head validation and UI proofCandidate: Still blocked, not CI-green. Build and Test, attempt 1 ran after the conflict resolution. Core/CLI, fast validation, proof-pool contracts and release metadata passed. The stock Reactor package still reports the seven analyzer errors. The two analyzer fixes, microsoft/microsoft-ui-reactor#1427 and microsoft/microsoft-ui-reactor#1428, are now merged, but a compatible published package containing them has not been verified. Native proof below uses a temporary, local-only
The full-run failures are retained, not replaced by the focused passes. Shared's three failures were command-runner deadlines/output under load. Tray had the four previously observed ARM64 build-prerequisite failures and three chat/concurrency/HTTP-timeout failures. No Usage test failed. The PR body lists the exact commands and limitations. An independent rubber-duck review checked the final fix round at New blocking native failureSwitching the fixture through populated, empty, partial and legacy states, with Settings Connection -> Usage navigation between modes, produced: The stack enters Reactor's Current-source capturesThese are real native app-window captures of synthetic fixture data, not a real Gateway/provider account. The profile, Gateway and MCP endpoint were isolated. Executable and managed-assembly hashes, source identity, fixture receipts and TRX files were retained locally. High contrast was enabled with approval and restored to the original None setting with approval. The disconnected banner's own Open Connection button was invoked and the native Remaining gaps: failing legacy transition; current-source real-Gateway execution; full native proof-pool completion; populated Usage Axe scan; full session-summary/timeline/context, export-picker and keyboard coverage. These captures do not complete the entire |
Corrected Reactor runtime: consumer retestWindows source remains
Original cast failure no longer occurs in the replayWith the exact neutral DLL payloads deployed, computer-use observed:
Before-correction failure: original native failure capture. Visual acceptance is still incomplete. High contrast was already active on the shared desktop during this round, with client-area animations enabled. This round did not change desktop settings. In the released/basic view, native data is present but the plotted daily bars are not visible in the capture below. The cause is not yet attributed. A same-consumer local.2 runtime comparison failed during startup, so it is not valid A/B evidence. A bounded native probe is investigating geometry, brush and animation state. Dependency proof and boundaries
CI remains blocked on the committed stock package. A compatible published Reactor release and a reviewed consumer dependency update are still needed. This is not complete |
Use the existing Usage data palette for marks and selection indicators instead of the native button fill, which can equal the plot background in high contrast. Cover clickable and nonclickable native charts with contrasting theme inputs. Co-authored-by: Copilot App <[email protected]>
|
Current Windows candidate: The local package contains the two analyzer fixes plus the keyed-exit correction now proposed in microsoft/microsoft-ui-reactor#1429. No temporary package feed/pins or Windows-side animation workaround is published. The replay survived populated -> empty -> partial -> legacy -> released, including Connection -> Usage remounts. The former Border-to-InfoBar crash did not recur. Populated totals were 1.3M tokens, $4.51 and 11 sessions; the expanded seven-day text table agreed with chart accessibility names. Partial mode showed lower-bound totals and partial/cache banners. Released-schema mode hid unsupported query controls and rendered nonzero bars. The legacy fixture returned no daily rows, so that capture proves transition/fallback rendering, not populated legacy-cost accuracy. After shutting down only the owned fixture transport, Usage disabled Refresh/Export and its Open Connection action opened Connection settings.
Earlier proof comments describe older source/runtime combinations and retain their original failures. The failed local.3 x64-only package build and failed local.2 comparison startup are not successful consumer A/B evidence. Current stock CI remains blocked by seven upstream analyzer false positives; the local-package results do not make CI green. Complete interactive/real-Gateway proof pools, populated Usage Axe coverage, complete session-detail/export-picker/keyboard acceptance and production-packaged acceptance remain unverified. Seven captures follow in replay order: released/basic with visible bars; populated with expanded text table; empty with independent provider usage; partial; legacy without the former render error; disconnected; Open Connection destination. |
Keep filtered details scoped to matching usage, preserve model lower bounds, clear unsupported legacy selection and show legacy refresh failures. Pair high-contrast weekday text and fill, and strengthen callback and production-theme regression coverage. Co-authored-by: Copilot App <[email protected]>
Merge pinned main 4aee38a while preserving the Reactor Usage owner. Co-authored-by: Copilot App <[email protected]>
Replace the classic XAML Usage page with a compact Reactor page backed by read-only Gateway reads. - Cost, token and session totals; Today, 7-day, 30-day and custom ranges with a visible reporting zone; a daily trend with an accessible table; agent, model and provider contributors; capability-gated session browsing; lightweight detail; native conversation access; a web Usage handoff and a secondary CSV export. - Provider allowance stays distinct from session-derived estimates. Partial, stale, failed, unsupported, forbidden and disconnected states are explicit. - Released Gateways that reject the server overview parameters get a bounded basic view (at most 1000 rows). Older Gateways report Unsupported. - Compact header: short custom-range label and inline date pickers on wide hosts, using the shared PageResponsiveLayout helper. - Adopt official Reactor 0.1.0-preview.17 with a hash-verified, repository-local package bootstrap wired into build, CI, CodeQL and Store packaging. - Update the six locales, DESIGN.md palette resources, the architecture ledger and the fixture documentation. Known open items: the mounted UsagePageRenderingTests 937.14 DIP compact transition case still fails, and cached Usage state is not yet reset when the operator Gateway client changes. Co-authored-by: Copilot App <[email protected]>
- Drop reports, plans, details and export state from the previous Gateway when the operator client is replaced; keep range, zone, scope, search, sort and metric. In-flight reads are cancelled and generation-fenced. - Read the operator client once per operation so a replacement between reads cannot split one load across two Gateways or send the previous Gateway's session key to the new one. - UI tests: wait on physical-pixel width for the 937.14 DIP transition and on model/topology convergence for the Custom range reflow. Co-authored-by: Copilot App <[email protected]>
Keep reported-day charts, native expanders and shared provider reads. Integrate the authorized adaptive Settings and embedded inset/toggle ownership ports, and add pinned Usage hit, keyboard and feedback proof coverage. Current source-only shell/test additions remain unvalidated pending the exclusive native lane. Historical proof does not establish acceptance of this candidate. Co-authored-by: Copilot App <[email protected]>
Keep compact usage facts responsive, localize the allowance warning, and add owned-window paired capture diagnostics. Native pixel proof remains pending. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Integrate pinned main 045d13a, including the shared page foundation and Windows App SDK 2.6.5. Retain the published Reactor preview.17 pair and Usage behavior; adopt main shell navigation and inset ownership. Validated tree 6d874a2: full build; 315 focused checks; Shared 4909 passed with 25 permitted skips; unfiltered Tray 5529 passed; ARM64 UI build; docs, CI and package checks. Native groups passed: shared UI 15, Usage 98, animations enabled 6 and disabled 1. Independent merge review found one stale toggle-label assumption, corrected. Corrected the inherited tile-fit boundary assertion without changing production layout. Interactive keyboard, full-app Back/Enter/Escape and visible-pixel proof remain unverified. Earlier failed harness/selection runs are retained in local evidence; they are not reported as passing. This is branch integration, not PR landing. Co-authored-by: Copilot App <[email protected]>
Preserve query provenance, disclose bounded selected-session details, keep pricing completeness separate from token counts, and coordinate provider refresh after authenticated binding. Bootstrap published Reactor packages before local builds while preserving NoBuild; adopt shared capped-field alignment and focused regressions. Validated source content in an isolated headless snapshot: full build passed; Shared 4909 passed with 25 permitted skips; unfiltered Tray 5557 passed; Debug ARM64 UI tests compiled with no warnings or errors; documentation and 20 offline bootstrap controls passed. Native/UI and Debug/non-Dev Release real-app proof remain blocked. The earlier failed run and retained safety lease are unchanged. No native readiness claim is made. Co-authored-by: Copilot App <[email protected]>
Preserve the Usage and Inbox app-owned sources, keep main's shared Inbox page, combine locale additions and fixture scenarios, and update the obsolete notification layout guard for the replacement owner. Validation: staged/working diff checks, 36 XAML XML parses, and six resource inventories (3490 unique keys per locale) passed. Independent integration/proof-plan review found no confirmed P0-P3 defect. Windows build, .NET tests and native proof remain blocked by unavailable runtimes on this Linux host. Co-authored-by: bkudiess <[email protected]>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Check Gateway and page ownership after native file selection, withhold exact session shares for incomplete reports, and share expiry-aware provider attention. Preserve later reset notifications and retained-snapshot render invalidation. Add deferred-file, completeness, provider lifetime and rendered regressions. Repair deterministic Usage fixture coverage and native geometry proof boundaries without removing keyboard, hit-testing, inset or ink assertions. Retain the unassigned mounted testhost crash as a validation blocker. Validation: diff checks and static fixture reproduction passed. Independent source/proof-plan review completed; both follow-up test findings were corrected and independently checked. Windows build, .NET tests, negative controls and native proof remain unrun here because pwsh, dotnet and winapp are unavailable. Co-authored-by: bkudiess <[email protected]>
Rename only the private LINQ tuple member so the unchanged pure-presentation architecture guard does not mistake it for a WinUI Window. Filtering and ordering are byte-identical after normalizing that identifier. Validation: baseline/candidate token check and git diff --check passed. Full build, Shared/Tray and focused xUnit execution remain blocked locally by missing PowerShell and dotnet; fresh CI and native validation are required. Co-authored-by: bkudiess <[email protected]>
Keep the failure-detail assertion behind actual native warning layout rather than unchanged fallback text. Prepare each responsive capture through the known host-warning presentation control, retain its Inbox fact, and reject late or unknown notification obstruction without weakening ink or hit-test guards. Validation: diff checks and independent source/rubber-duck review completed, including corrections for capture-window ownership and asynchronous warning admission. Windows build and Shared/Tray tests remain unrun locally because pwsh and dotnet are unavailable. Preserve the original failed UI run, shared pane-toggle failure and whole-fixture timeout as outstanding validation work. Co-authored-by: bkudiess <[email protected]>
Treat temporarily missing UI Automation measurements as not ready while retaining consecutive stable widths, exact geometry, all five captures and foreground ink checks. Keep this repair based on the published head, separate from private native height diagnostics. Co-authored-by: bkudiess <[email protected]>
Observe the root visibility commit as well as the independently rendered question controls. Preserve native control identity, view-model draft and visibility assertions, and verify native draft text while hidden. Co-authored-by: bkudiess <[email protected]>
Respect content-sized native controls while checking row containment, desired-height allocation, wide center alignment and wrapped query separation. Preserve the six theme/width cases and native session action guards. Co-authored-by: bkudiess <[email protected]>
Record content-free monotonic phases and responder outcomes without changing the production request, security assertions or timeout budgets. Preserve primary failures and observe responder faults across cleanup races. This collects evidence, not a fix for the retained timeout. Co-authored-by: bkudiess <[email protected]>
Preserve Usage and Systems ownership, combine fixture scenarios and locale resources, and add a real-client composition regression. Independent source and proof-plan review found no actionable P0-P3 findings. Static checks passed. Build, .NET tests, report tests, and native proof remain blocked by missing tooling or dependencies; pinned exact-hit ownership remains unresolved. Co-authored-by: bkudiess <[email protected]>
Keep overview-capable search mounted while a new query loads or fails, without restoring stale figures. Cover retained native focus and recovery through a bounded committed-state wait. Replace the PR-added UIA point-leaf assumption with exact-center native mouse input and required pane transitions. Record the original UIA bridge result, require exact root HWND and foreground ownership, and reject a real test-owned opaque occluder. Preserve geometry and Tab assertions with no Invoke fallback. Full isolated build, Shared (5347 passed, 28 permitted skips), Tray (5797 passed), native compilation and docs/bootstrap checks passed on the repair candidate. Final Release query regression passed. Debug and Release pinned fixtures proved physical transitions and occluder rejection, then failed the retained Tab-to-content assertion; attribution remains inconclusive and that gate is not waived. Earlier failed attempts remain recorded. Co-authored-by: Copilot App <[email protected]>
Merge upstream main 6842791, preserving its newer Workspace account-menu and chat-navigation owners. Combined Usage validation will follow the local simplification pass; no native-readiness claim. Co-authored-by: Copilot App <[email protected]>
Preserve the approved daily analysis, connection and generation fencing, capability fallback, query recovery, export safeguards and distinct native regressions. Remove unrelated chat/Inbox changes, unused count state and forwarding, web-only fixture analytics, orphan resources and duplicate cases. Validated exact tree aa2374d: full build; Shared 5347 passed with 28 permitted skips; unfiltered Tray 5828 passed; focused suites 175 and 246 passed; ARM64 UI compilation and docs/skills/bootstrap checks passed. Native runtime proof remains separate. Co-authored-by: Copilot App <[email protected]>
Merge upstream main 243f9cf normally. The automatic merge preserves the validated Usage reduction and adopts upstream chat, fixture and CI bootstrap owners without manual conflict resolution. Combined-source validation follows before push. Co-authored-by: Copilot App <[email protected]>
Preserve physical hit and occlusion checks, then assert exact native title-bar stops before visible page focus. Verify Shift+Tab leaves content and Tab returns to the same control. The prior direct history-to-content assertion contradicted unchanged main XAML order. Validated final source with full build, Shared 5445 passed/28 permitted skips, unfiltered Tray 5993 passed, focused 177/246, UI/integration compilation and workflow/docs checks. The exact pinned fixture passed 1/1 across Light and Dark with 20 physical transitions, two occluder negatives and explicit forward/reverse focus receipts; owned kernel job drained before release. Co-authored-by: Copilot App <[email protected]>


















What Problem This Solves
The existing Windows Usage page lacks the date ranges, contributor breakdowns and session detail needed to understand everyday usage and estimated cost.
User Impact
Users can inspect Gateway-reported usage natively, open a reported session in chat, export a complete report, or continue deeper analysis in the Gateway's web Usage page.
Compatibility: Gateways without a compatible
sessions.usageAPI show an update/access notice instead of Usage totals. Older supported schemas use a bounded Basic view, not an exhaustive server search. No data migration is required.Why This Change Was Made
Keep common daily analysis native without chasing full web parity. Heatmaps, per-turn/prompt-context analytics, transcript exploration and advanced exports remain in the web experience. The web handoff opens
/usage; it does not transfer the current date range, filters or selected session.The Gateway remains the data authority. Parsing, presentation and export ownership are separated from the native host, with cancellation and connection/query-origin guards preventing stale results or misleading exports. Original feature implementation: @bkudiess.
Evidence
All required CI passed for head
2953108c4a316ed275dc3b97912230ee828339b5: Build and Test and CI Gate.The run's
test-results-gateway-fixtureartifact contains 48/48 profile cases, 102/102 application cases and 1/1 released-profile compatibility case, with no selected skips. The full fixture suite completed in 768.26 seconds; Usage's pinned-page case passed in 40.20 seconds.Independent paired reviews covered the feature-repair scope; the final Tab-contract correction received a further scoped independent review. This is not a claim of a fresh whole-head dual-model verdict.
Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: native Usage rendering, accessibility, keyboard navigation and pinned-page interaction. The selected ARM64 and hosted x64 evidence is described below, not a claim that every optional pool scenario ran.Validation
Local validation used the frozen source tree that became
2953108c.$Rbelow denotes the recorded task-owned results directory; private output paths are omitted..\build.ps1 -NoTrustRepositorydotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore -p:UseSharedCompilation=false --logger "trx;LogFileName=Shared.trx" --results-directory $Rdotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore -p:UseSharedCompilation=false --logger "trx;LogFileName=Tray.trx" --results-directory $Rdotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-arm64 -p:Platform=ARM64 -p:DevBuild=false -p:RequireSignedCleanupHost=false -nr:false --disable-build-servers -v:minimalFocused Shared and Tray selections passed 177/177 and 246/246, respectively. Workflow, documentation, skill and Reactor-bootstrap checks also passed. Hosted CI additionally passed the full Core/CLI, Tray/setup/integration, UI/functional/accessibility, WSL setup/recovery and packaging lanes; optional skipped jobs are not represented as executed proof.
Exact final local pinned-page command
Executed once against the frozen Debug non-Dev ARM64 payload, with an isolated synthetic Gateway/profile and owned-process cleanup. Result: 1/1 passed, 0 skipped, covering Light and Dark.
<owned-results>replaces only the private artifact directory.The runner supplied the fixture app path and isolated data roots, enabled the fixture gate, and preserved the machine's animation preference. It verified process drainage before releasing its reservation.
Real Behavior Proof
2953108c4a316ed275dc3b97912230ee828339b5. GitHub tested merge refb647c7749e6546bfd19c4d6df978c391299ab6a2with then-main55ceb602; the repaired test blob is identical in the head and tested merge.UsagePinnedalso passed.Yes/No/N/A): Yes. The linked successful CI run and itstest-results-gateway-fixtureartifact are available. Obsolete screenshots and private session links are intentionally omitted.Security Impact
Yes/No): No.Yes/No): No.Yes/No): Yes.Yes/No): No.Yes/No): Yes.Yes, explain the risk and mitigation: authenticated read-onlysessions.usageandusage.statususe the existing operator connection and access checks. The page reads usage/session metadata, not transcript logs or per-turn content. CSV is explicit local output, not telemetry; cells are quoted and formula prefixes neutralized, incomplete exports are refused, and connection/query origin is rechecked across the picker.Compatibility and Migration
Yes/No): No for Gateways without compatiblesessions.usage. Supported older schemas use the Basic contract; unsupported controls remain hidden and loaded-only drilldowns are not presented as exhaustive.Yes/No): Yes. OptionalOPENCLAW_USAGE_RECHECK_INTERVAL_MSandOPENCLAW_USAGE_NOTIFICATION_MS; normal defaults require no user configuration.Yes/No): No data migration.Review Conversations
No GitHub review threads are currently open. This description update does not merge the PR or claim approval on behalf of reviewers.