Skip to content

improve(ui): organize provider access and local usage - #174904

Merged
vyctorbrzezowski merged 8 commits into
mainfrom
ui-model-providers-rebuild
Oct 22, 2026
Merged

vyctorbrzezowski merged 8 commits into
mainfrom
ui-model-providers-rebuild

Conversation

@obviyus

@obviyus obviyus commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Models mixes provider access and plan limits with local session spending, while the Usage calendar does not show each provider's daily contribution.

User Impact

Local consumption lives on Usage. Models becomes a compact provider list with expandable accounts, limits, and actions. The daily chart supports provider composition, keeps the full period visible when selecting days, and fits annual ranges without dropping days.

Removing a provider asks for confirmation that explains shared accounts, saved API keys and configured aliases. Provider settings and external secrets stay in place. Interrupted or unloaded usage retains its uncertainty in totals, legends, and tooltips.

Why This Change Was Made

One shared limits panel serves provider rows, accounts, and Usage. Models no longer requests local session history, and provider-limit refresh remains separate from local consumption loading. On Models, a failed provider-plan refresh keeps the last accepted provider summary; a successful empty summary clears it.

Removal rechecks current authority before each command and reports confirmed progress if a later command or refresh fails. Results from a retired agent or connection remain retired, following the existing scope owner.

Usage uses the same Cost/descending default for route preloading and later requests, so opening it from a connected page shows the ordering selected by the control without a corrective request.

Original contribution by @obviyus.

Evidence

Inspected before/after screenshots and incomplete-data states, comparing main 48b7b4e with a95ba50 (tree adc5474). The follow-up commit d127f3b55c7c37d5406e0fae0d7d1f2dea08e717 moves a type contract and updates tests; it does not change the rendered production code shown in these images.

The same synthetic accounts and 1,095 annual session records were exercised in the real production UI bundle on main 48b7b4e and the candidate, in dark/light themes and desktop/mobile layouts. Entering Models made one local-history request on main and zero on the candidate. Rendered annual bars were measured at desktop and mobile widths; a separate browser regression covers 366 days and By Type.

Focused coverage includes calendar composition and selection, incomplete-data readouts, empty and failed limit responses, reconnects, authority changes during removal, partial removal outcomes, filters, paging, and retained focus. Initial Usage ordering is checked through the first request and rendered rows, with one history request. The confirmed regressions failed before their fixes. Typechecks, scoped lint, styles, i18n, and changed-file line limits passed.

Measured test command wall time on Tempbook (scripts/run-vitest.mjs, equivalent to pnpm test, with --maxWorkers=1): aggregation 1.20 s; removal 2.32 s; annual browser geometry 1.85 s; the final four-file presentation/removal run 3.82 s; extracted existing defaults cases 1.78 s; final route/query ownership run (17 tests) 2.93 s; Usage overview E2E (2 tests) 11.83 s including bundle setup. The temporary capture scenario is not committed.

The first published-head CI run found a type import cycle and six outdated test assumptions. The shared view props now live in an independent type contract. Existing tests retain error uniqueness, retry/focus behavior, catalog recovery, credential scope, and partial heatmap data while following the current UI. The repair passed Madge (zero cycles), typechecks, lint, and the affected test files (35 + 8 + 41 tests).

CI file execution times on run 39819125201: removal 2.66 s; calendar selection 3.63 s; extracted defaults 1.14 s; annual geometry 1.37 s; Usage route 0.18 s. These are Vitest file durations, not whole-job wall times.

Risk and coverage: Gateway responses and credentials are synthetic. Live provider APIs and deletion of real credentials were not exercised. The repository-wide max-lines suppression check reports the same unrelated stale-path failures on main; this is tracked in #179181. No baseline exception or environment override was added. Final CI run 39822318084 passed on d127f3b55c7c37d5406e0fae0d7d1f2dea08e717; the native workflow verified completed hosted evidence for this head.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 4190a3052fbc400d7ffab27c2604777a11b5a892, but the PR head is now f6ba3cfe868a15de6b5266733d79d0f013295d82. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-10-17T01:18:11.410Z sha 4190a30 :: needs changes before merge. :: [P2] Preserve incomplete status when rendering token totals | [P2] Reject core usage snapshots for an obsolete selected range | [P2] Distinguish failed usage reads from an empty usage range | [P2] Allow billing attribution values to shrink within the panel

@obviyus obviyus changed the title Control UI: rebuild the Models page around usage and one provider list Control UI: consolidate local usage onto Usage and rebuild Models provider access Oct 17, 2026
@obviyus
obviyus marked this pull request as ready for review October 17, 2026 04:13
@obviyus
obviyus marked this pull request as draft October 17, 2026 04:21
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 17, 2026
@obviyus
obviyus force-pushed the ui-model-providers-rebuild branch from 28f50c2 to 0572db0 Compare October 18, 2026 23:38
Models lists providers as collapsible rows with account plan limits,
reset countdowns, connection tests and Remove provider. Local usage
moves to /usage, which gains a per-provider daily chart, lower-bound
totals, a Carapace summary strip, cost windows and activity charts, and
loads session usage without waiting on provider plans or shifting the
layout.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
* feat(ui): rebuild the Models page and consolidate usage on /usage

Models lists providers as collapsible rows with account plan limits,
reset countdowns, connection tests and Remove provider. Local usage
moves to /usage, which gains a per-provider daily chart, lower-bound
totals, a Carapace summary strip, cost windows and activity charts, and
loads session usage without waiting on provider plans or shifting the
layout.

* chore: prepare reviewed contributor base integration

* fix(ui): preserve provider controls across main integration

* chore: prepare reviewed provider and usage integration

* improve(ui): organize provider access and local usage

* fix(ui): align provider view contracts and regression tests

---------

Co-authored-by: Vyctor H. Brzezowski <[email protected]>
Grynn added a commit to Grynn/openclaw that referenced this pull request Nov 13, 2026
Retain the native-route readiness behavior from grynn-fixes on the current Solid model-providers page. Derive readiness only from Gateway-confirmed available selected runtimes; config presence, unknown availability and alternate runtime choices cannot mark a provider ready.

Keep pending, provider rejection and unavailable outcomes authoritative. Preserve direct credential profiles, expired-profile warnings and connection probes; a native route alone does not expose an API credential probe. Reuse the existing billing-aware runtime labels instead of implying a free subscription route.

Proof: rendered owner tests and compiled Chromium route fail on the base with Expired/Not signed in, pass with Ready, then fall back when the route becomes unavailable. 68 focused tests and 13 browser cases pass; UI/pages/E2E types, scoped typed lint, i18n verification, format and line-cap pass. Fresh independent subscription review is scoped-clean. Synthetic mock-Gateway proof, not a live provider or latency measurement.

Upstream: openclaw#129766 remains a product decision; retain locally without treating the shared worst-auth reducer as erroneous or opening a competing policy PR.

Port to 0220489 (partial): dropped the hasDirectProviderCredentials rename and the no-credentials fallback hunk, which upstream isProviderUsable() (openclaw#174904) already covers. The runtime label (runtimeManagedCredentialParts, absorbing c6e5722) and the probe gate (canProbeProvider) now feed provider-row.tsx, including the collapsed credential line. Test connection stays hidden only when a confirmed native route is the sole usable path, a deliberate divergence from openclaw#174904's isProviderUsable gate. The e2e fallback now expects "Credentials rejected", since upstream checks auth-rejected before auth attention (openclaw#185263). Tests not re-run on this base.

Local-Feature: native-provider-ui-readiness
Semantic-Source: 49f56ee
Upstream-Tracking: openclaw#129766
Drop-When: Upstream renders Gateway-confirmed selected native routes ready without claiming API credentials exist.
Rebase-Base: 0220489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants