Skip to content

fix(ui): restore provider usage pill in desktop chat composer [AI]#93055

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
harjothkhara:fix/desktop-chat-quota-pill
Jun 16, 2026
Merged

fix(ui): restore provider usage pill in desktop chat composer [AI]#93055
vincentkoc merged 3 commits into
openclaw:mainfrom
harjothkhara:fix/desktop-chat-quota-pill

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

After 2026.6.6 the provider usage/quota pill (5h + weekly limits) disappeared from the desktop Control UI chat. The composer refactors (feat: calm composer controls #88772, feat(webui): add session workspace rail #92856) moved the desktop chat controls into renderChatControls but dropped the quota pill; the only desktop caller that still rendered it (the renderChatSessionSelect wrapper) became orphaned, so the pill rendered nowhere on desktop. Mobile was unaffected.

This restores the existing pill (renderChatQuotaPill) into renderChatControls using the existing models.authStatus usage-window contract — provider-agnostic, no new config, no Codex/protocol change. It is intentionally scoped to re-attaching the existing pill, not the separately-tracked always-visible topbar. The pill now sits in the composer controls row (next to the model selector) rather than the pre-2026.6.6 upper-right header, since that desktop header no longer exists.

Surface: ui/ (Control UI desktop chat composer controls).

Root cause / fix details:

  • renderChatControls (the shipped desktop composer controls) rendered the model select + settings popover but no longer the quota pill.
  • renderGuardedChatControls wraps renderChatControls in guard([...]); the dep list omitted state.modelAuthStatusResult, so even once the pill is re-attached the guarded controls would not re-render when usage windows arrive async. Added that dependency.
  • Desktop .agent-chat__composer-controls is flex (pill fits); the @media (max-width: 768px) layout is a fixed 2-column grid (model | settings), so the pill is hidden on mobile to avoid pushing the settings chip onto a second row.

Linked context

Refs #93041

Real behavior proof

  • Behavior addressed: Desktop Control UI chat no longer shows the OpenAI/Codex (or any monitored provider) usage pill after 2026.6.6; this restores it and makes it update when models.authStatus usage windows arrive.

  • Real environment tested: The production Control UI, served by the mocked-gateway harness and rendered in real headless Chromium 148 (Playwright) at a 1280×900 desktop viewport — the full app on the real /chat route, not jsdom. models.authStatus returned an OAuth Codex provider with 5h + Week usage windows.

  • Exact steps or command run after this patch: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts

  • Evidence after fix: Headless Chromium screenshot of the production Control UI desktop chat — the composer controls row shows the restored provider pill reading "Usage 29%", linking to /usage, between the model selector and the Chat settings button.

openclaw-93041-composer-controls openclaw-93041-chat-with-pill
  • Observed result after fix: The pill renders "Usage 29%" in the desktop composer controls and links to /usage; it is absent when no provider usage windows are present. On origin/main, the identical harness rendered no pill even with usage windows present.
  • What was not tested: No live in-browser session against a real ChatGPT/Codex OAuth subscription (the gateway models.authStatus was mocked with representative OAuth usage windows). Mobile intentionally keeps no composer pill (hidden via CSS to preserve the 2-column mobile grid).

Tests and validation

  • ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.tsreal-browser (Playwright/Chromium) test: mocks models.authStatus usage windows, asserts the pill renders in .agent-chat__composer-controls on /chat, and that it is absent without usage windows. Skips gracefully when Chromium is unavailable. 2/2 pass.
  • ui/src/ui/app-render.helpers.browser.test.ts — added 2 jsdom tests asserting the pill renders in renderChatControls with usage data and is absent without it (guards the live surface the existing chat.test.ts test missed — it rendered the orphaned wrapper). 9/9 pass.
  • ui/src/ui/views/chat.test.ts — 104/104, unchanged.
  • oxfmt --check, oxlint, tsgo:core, tsgo:test:ui — all clean.

Risk

Low, UI-only. Reuses an existing render helper and the existing models.authStatus projection; no config/default/migration/auth-logic change.

AI assistance

AI-assisted (Claude). Investigation, fix, and proof were reviewed and are owned by me.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 3:33 PM ET / 19:33 UTC.

Summary
The PR restores the existing provider quota pill to the desktop Control UI Chat composer, adds the auth-status dependency needed for async updates, hides the pill in the mobile composer grid, and adds browser plus Playwright regression coverage.

PR surface: Source +11, Tests +138. Total +149 across 6 files.

Reproducibility: yes. at source level: current main routes Chat through renderGuardedChatControls/renderChatControls, which omits renderChatQuotaPill even though models.authStatus can provide usage windows. I did not rerun a live browser repro during this read-only review.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: ui/src/ui/chat/session-controls.ts. Confirm migration or upgrade compatibility proof before merge.

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:

  • none.

Next step before merge

  • [P2] No repair lane is needed because there are no actionable findings; the remaining blocker is maintainer handling of the current human-review/automerge pause.

Security
Cleared: The diff is limited to Control UI rendering, CSS, and tests; it does not change dependencies, workflows, secrets handling, package metadata, auth logic, or code-execution surfaces.

Review details

Best possible solution:

Land this PR after the maintainer clears the human-review pause and exact-head gates, then close #93041 as implemented; this PR is the stronger current landing path than #93285 because it includes the async re-render dependency, mobile layout guard, and browser proof.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main routes Chat through renderGuardedChatControls/renderChatControls, which omits renderChatQuotaPill even though models.authStatus can provide usage windows. I did not rerun a live browser repro during this read-only review.

Is this the best way to solve the issue?

Yes. Reusing renderChatQuotaPill and the existing models.authStatus usage-window contract in the active composer control surface is the narrow maintainable fix; a new Codex-only widget or broader topbar redesign would be too broad for this regression.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b3128ba93def.

Label changes

Label justifications:

  • P2: This fixes a released Control UI provider-usage visibility regression with a narrow web UI blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (screenshot): The PR body includes structured after-fix proof and inspected screenshots from a real headless Chromium /chat route with mocked models.authStatus visibly showing the restored Usage pill.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes structured after-fix proof and inspected screenshots from a real headless Chromium /chat route with mocked models.authStatus visibly showing the restored Usage pill.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes structured after-fix proof and inspected screenshots from a real headless Chromium /chat route with mocked models.authStatus visibly showing the restored Usage pill.
Evidence reviewed

PR surface:

Source +11, Tests +138. Total +149 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 12 1 +11
Tests 2 138 0 +138
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 150 1 +149

What I checked:

  • Repository policy read: Root AGENTS.md and ui/AGENTS.md were read fully; their read-only, deep-review, UI, proof, and no-changelog guidance shaped this review. (AGENTS.md:1, b3128ba93def)
  • Current main omits the quota pill from active composer controls: Current renderChatControls renders the model selector followed directly by settings, with no renderChatQuotaPill call in the actual composer control surface. (ui/src/ui/app-render.helpers.ts:393, b3128ba93def)
  • Current main does not re-render controls on auth-status updates: renderGuardedChatControls depends on model/catalog/session/settings state but not modelAuthStatusResult, so async usage-window arrival cannot refresh composer controls today. (ui/src/ui/app-render.ts:1003, b3128ba93def)
  • Existing provider-agnostic quota helper remains available: renderChatQuotaPill already consumes modelAuthStatusResult through collectQuotaWindowsFromAuthStatus and isMonitoredAuthProvider, so the PR reuses the existing provider usage contract. (ui/src/ui/chat/session-controls.ts:742, b3128ba93def)
  • Latest release has the same missing composer call: v2026.6.6 renderChatControls also renders the model selector then settings without the quota pill, matching the reported released regression. (ui/src/ui/app-render.helpers.ts:393, 8c802aa68351)
  • PR head restores the pill in the active surface: At PR head, renderChatControls inserts renderChatQuotaPill between the model selector and settings wrapper. (ui/src/ui/app-render.helpers.ts:396, 49a5b9ceb7da)

Likely related people:

  • steipete: PR metadata shows steipete authored and merged the provider quota UI work and the calm composer controls refactor adjacent to the missing Chat composer surface. (role: provider quota feature owner and earlier composer refactor author; confidence: high; commits: 8178a6c94946, 2b30951b8090; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/provider-quota-summary.ts, ui/src/ui/app-render.helpers.ts)
  • Solvely-Colin: Authored the merged session workspace rail PR that recently touched the Chat view/sidebar surface mentioned in the bug context. (role: recent adjacent UI contributor; confidence: medium; commits: fd855c831f77; files: ui/src/ui/app-render.ts, ui/src/ui/views/chat.ts, ui/src/ui/views/chat.test.ts)
  • vincentkoc: Merged the session workspace rail PR that changed nearby Chat view structure and is part of the reported regression context. (role: adjacent merger; confidence: medium; commits: fd855c831f77; files: ui/src/ui/app-render.ts, ui/src/ui/views/chat.ts)
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.

@harjothkhara harjothkhara changed the title [AI-assisted] fix(ui): restore provider usage pill in desktop chat composer (#93041) fix(ui): restore provider usage pill in desktop chat composer [AI] Jun 14, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jun 14, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper automerge is enabled.

  • Head: 49a5b9ceb7da
  • Label: clawsweeper:automerge
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head before merge.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-06-14 20:26:00 UTC review queued 49a5b9ceb7da (queued)

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [P2] No repair lane is needed because there are no actionable findings; the remaining blocker is maintainer handling of the current human-review/automerge pause.; Cleared: The diff is limited to Control UI rendering, CSS, and tests; it does not change dependencies, workflows, secrets handling, package metadata, auth logic, or code-execution surfaces. (sha=49a5b9ceb7da81ce5c78af557b08042b7fcbc55a)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

harjothkhara and others added 3 commits June 16, 2026 13:46
…aw#93041)

Composer refactors dropped the quota pill from renderChatControls and left the
desktop renderChatSessionSelect wrapper orphaned, so it rendered nowhere on
desktop. Re-attach the existing pill, add modelAuthStatusResult to the guarded
controls dep list so it updates when usage windows arrive async, and hide it on
the 2-col mobile composer grid.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
)

Playwright/Chromium test that mocks models.authStatus usage windows and asserts
the restored provider usage pill renders in the desktop chat composer (and is
absent without usage). Skips gracefully when Chromium is unavailable.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…openclaw#93041)

Match the control-ui-e2e convention (.artifacts/control-ui-e2e/...) so the proof
run does not leave untracked root-level files. Addresses ClawSweeper review.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@vincentkoc
vincentkoc force-pushed the fix/desktop-chat-quota-pill branch from 49a5b9c to f01823e Compare June 16, 2026 05:46
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete for f01823e97490adccf864d00fe2a60e20ee83b9fc.

  • Focused proof: node scripts/run-vitest.mjs ui/src/ui/app-render.helpers.browser.test.ts ui/src/ui/views/chat.test.ts (113 tests passed)
  • Browser proof: pnpm test:ui:e2e ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts (2 tests passed with system Chrome)
  • Responsive inspection: desktop pill rendered without overflow; mobile correctly hides it
  • Fresh branch review: no actionable findings
  • Exact-head CI: green

Land-ready. Screenshots remained under ignored .artifacts/control-ui-e2e/chat-quota-pill-93041/; no proof assets were committed.

@vincentkoc
vincentkoc merged commit 5a9396e into openclaw:main Jun 16, 2026
139 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
…penclaw#93055)

* fix(ui): restore provider usage pill in desktop chat composer (openclaw#93041)

Composer refactors dropped the quota pill from renderChatControls and left the
desktop renderChatSessionSelect wrapper orphaned, so it rendered nowhere on
desktop. Re-attach the existing pill, add modelAuthStatusResult to the guarded
controls dep list so it updates when usage windows arrive async, and hide it on
the 2-col mobile composer grid.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(ui): add real-browser e2e proof for chat quota pill (openclaw#93041)

Playwright/Chromium test that mocks models.authStatus usage windows and asserts
the restored provider usage pill renders in the desktop chat composer (and is
absent without usage). Skips gracefully when Chromium is unavailable.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(ui): write quota-pill e2e screenshots to ignored .artifacts path (openclaw#93041)

Match the control-ui-e2e convention (.artifacts/control-ui-e2e/...) so the proof
run does not leave untracked root-level files. Addresses ClawSweeper review.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
…penclaw#93055)

* fix(ui): restore provider usage pill in desktop chat composer (openclaw#93041)

Composer refactors dropped the quota pill from renderChatControls and left the
desktop renderChatSessionSelect wrapper orphaned, so it rendered nowhere on
desktop. Re-attach the existing pill, add modelAuthStatusResult to the guarded
controls dep list so it updates when usage windows arrive async, and hide it on
the 2-col mobile composer grid.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(ui): add real-browser e2e proof for chat quota pill (openclaw#93041)

Playwright/Chromium test that mocks models.authStatus usage windows and asserts
the restored provider usage pill renders in the desktop chat composer (and is
absent without usage). Skips gracefully when Chromium is unavailable.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(ui): write quota-pill e2e screenshots to ignored .artifacts path (openclaw#93041)

Match the control-ui-e2e convention (.artifacts/control-ui-e2e/...) so the proof
run does not leave untracked root-level files. Addresses ClawSweeper review.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
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 clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper:human-review Needs maintainer review before ClawSweeper can continue P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants