Skip to content

fix(control-ui): restore provider usage quota pill in sidebar session switcher (fixes #93041)#94219

Merged
openclaw-clownfish[bot] merged 2 commits into
openclaw:mainfrom
Pick-cat:fix/issue-93041
Jun 22, 2026
Merged

fix(control-ui): restore provider usage quota pill in sidebar session switcher (fixes #93041)#94219
openclaw-clownfish[bot] merged 2 commits into
openclaw:mainfrom
Pick-cat:fix/issue-93041

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: After 2026.6.6 the Codex/OpenAI usage quota pill disappeared from the Control UI chat. PR feat: calm composer controls #88772 ("calm composer controls") moved the chat header into a sidebar that renders renderChatSessionSelect(...) with sessionSwitcherOnly: true. That flag was meant to hide the model selector, but it also suppressed the quota pill.
  • What changed: The quota pill is informational, not a control, so it is now gated on compact (available space) instead of sessionSwitcherOnly. It renders in the expanded sidebar / desktop / mobile, and stays hidden only in the collapsed (44px) sidebar where there is no room.
  • CSS: The --session-switcher grid only defined agent/session areas, so a rendered quota pill (grid-area: quota) had no slot. Added explicit quota rows to the session-switcher grid templates so the pill stacks deterministically under the session picker.
  • Out of scope: No change to the quota data path (fetchCodexUsage, collectQuotaWindowsFromAuthStatus, renderChatQuotaPill) or to desktop/mobile behavior. The model-selector suppression in sessionSwitcherOnly mode is unchanged.

Linked context

Closes #93041

Related #93157 — an earlier attempt that removed the guard unconditionally but added no regression test and did not address the missing quota grid area in the session-switcher layout.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: Codex/OpenAI usage quota pill missing from the Control UI chat sidebar after 2026.6.6.
  • Real environment tested: Ubuntu/WSL2, Node.js v22.22.0, OpenClaw checked out at origin/main.
  • Exact steps or command run after this patch:
node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json
node node_modules/vite/bin/vite.js build   # via pnpm ui:build
  • Evidence after fix (copied live output): rendering the real renderChatSessionSelect(...) in sidebar session-switcher mode (sessionSwitcherOnly: true) now emits the quota pill. Copied live node output of the rendered DOM:
PROBE_ROW_CLASS=chat-controls__session-row chat-controls__session-row--session-switcher chat-controls__session-row--single-agent chat-controls__session-row--has-quota
PROBE_PILL_HTML=<a data-chat-provider-usage="true" class="chat-controls__quota chat-controls__quota--ok" href="/usage" title="Codex · Week · Codex 3h 82% left" aria-label="Provider usage: Codex · Week · Codex 3h 82% left"> <span class="chat-controls__quota-label">Usage</span> <span class="chat-controls__quota-value">28%</span> </a>

Before the patch the same render produced no data-chat-provider-usage node (the regression assertion read undefined):

FAIL ui/src/ui/views/chat.test.ts > shows provider quota in the sidebar session switcher (regression #93041)
AssertionError: expected undefined to be "Usage 28%"
- Expected: "Usage 28%"
+ Received: undefined
  • Observed result after fix: the sidebar render output contains the data-chat-provider-usage="true" anchor reading Usage 28%, and the row carries chat-controls__session-row--has-quota so the new quota grid area applies. node scripts/run-tsgo.mjs exits 0 and the vite build of the Control UI completes (✓ built).
  • What was not tested: a live in-browser screenshot against a real OAuth-connected OpenAI account showing live percentages — this environment has no OAuth session. The rendered markup and grid class above are copied from running the real render code under node; the displayed percentages depend only on the unchanged renderChatQuotaPill data path.
  • Proof limitations or environment constraints: Codex-based autoreview could not run here (no Codex auth, HTTP 401), so verification relied on the live node render output plus the production vite build.

Tests and validation

Which commands did you run?

  • node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts — 112 passed (2 new regression tests added).
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json — exit 0.
  • pnpm ui:build✓ built.

What regression coverage was added or updated?

  • shows provider quota in the sidebar session switcher (regression #93041) — fails before the patch, passes after.
  • hides provider quota when the sidebar session switcher is collapsed.

Risk checklist

Did user-visible behavior change? Yes — the usage quota pill is restored in the expanded sidebar chat; it stays hidden in the collapsed rail.

Did config, environment, or migration behavior change? No.

Did security, auth, secrets, network, or tool execution behavior change? No — the quota data path is untouched; only render gating and CSS grid areas changed.

What is the highest-risk area? Sidebar grid layout when the quota pill is present.

How is that risk mitigated? Explicit grid-template-areas were added for the --session-switcher + --has-quota combinations; covered by the render output above and a clean pnpm ui:build.

Current review state

What is the next action? Maintainer review.

What is still waiting on author, maintainer, CI, or external proof? CI on the pushed head.

Which bot or reviewer comments were addressed? None yet (new PR).

AI-assisted: implemented with Claude Code; verified via the live render output, tsgo, and ui:build above. Author understands the change.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 17, 2026
@clawsweeper

clawsweeper Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 2:33 AM ET / 06:33 UTC.

Summary
The PR changes Control UI sidebar session-switcher rendering and CSS so the provider usage quota pill renders when expanded, remains hidden when collapsed, and is covered by regression tests.

PR surface: Source +18, Tests +64. Total +82 across 3 files.

Reproducibility: yes. Source inspection shows current main and v2026.6.9 pass the sidebar selector through sessionSwitcherOnly: true while renderChatSessionSelect suppresses renderChatQuotaPill in that mode; the PR body also includes before/after live render output.

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.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #93041
Summary: This PR is a candidate fix for the canonical Control UI provider usage quota regression; merged composer work is only partial overlap, and another open PR is a duplicate candidate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
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:

  • [P2] Add a short browser or Mantis visual proof of expanded and collapsed sidebar placement if maintainers want final UI confirmation.

Mantis proof suggestion
A short browser visual proof would help maintainers confirm the expanded sidebar placement and collapsed-sidebar hiding behavior in the real UI. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify the Control UI chat sidebar shows the OpenAI/Codex usage quota pill when expanded and hides it when collapsed.

Risk before merge

  • [P1] The remaining uncertainty is visual placement in a full browser with live OAuth-backed usage data; the supplied proof is convincing live render output, but a short expanded/collapsed sidebar screenshot would further reduce layout risk.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow sidebar render/layout fix after maintainer review and current-head check gating, keeping the existing provider-agnostic quota data path unchanged.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed; the remaining action is maintainer review, optional visual proof, and normal merge/check gating for the exact PR head.

Security
Cleared: The diff is limited to UI render gating, CSS layout, and tests, with no dependency, workflow, credential, auth, package, or code-execution changes.

Review details

Best possible solution:

Land the narrow sidebar render/layout fix after maintainer review and current-head check gating, keeping the existing provider-agnostic quota data path unchanged.

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

Yes. Source inspection shows current main and v2026.6.9 pass the sidebar selector through sessionSwitcherOnly: true while renderChatSessionSelect suppresses renderChatQuotaPill in that mode; the PR body also includes before/after live render output.

Is this the best way to solve the issue?

Yes. Gating the informational quota pill on compact space preserves the intended model-selector suppression, reuses the existing quota data/render path, and adds sidebar quota grid rows for the newly rendered area.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority Control UI regression fix with a clear linked user report and limited UI-only blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied after-fix live output from running the real render function, showing the quota anchor and row class, plus the before-fix failing assertion and validation commands.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied after-fix live output from running the real render function, showing the quota anchor and row class, plus the before-fix failing assertion and validation commands.
Evidence reviewed

PR surface:

Source +18, Tests +64. Total +82 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 19 1 +18
Tests 1 64 0 +64
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 83 1 +82

What I checked:

  • Repository policy read: Root AGENTS.md and ui/AGENTS.md were read fully; the OpenClaw PR-depth, proof, UI, and Codex-source review guidance applied, while the scoped UI i18n rules were not implicated. (AGENTS.md:1, 604aa301899f)
  • Current main still suppresses the sidebar quota pill: renderChatSessionSelect still sets quotaPill to empty when sessionSwitcherOnly is true, which is the sidebar mode this PR targets. (ui/src/ui/chat/session-controls.ts:98, 604aa301899f)
  • Current sidebar caller uses the suppressing mode: The sidebar session selector passes compact from collapsed state and sessionSwitcherOnly: true, so expanded sidebar usage windows hit the quota-suppressed branch on current main. (ui/src/ui/app-render.ts:587, 604aa301899f)
  • Latest release remains affected: The v2026.6.9 release tag still has the sessionSwitcherOnly quota suppression and the same sidebar caller shape, so the central issue is not already shipped as fixed. (ui/src/ui/chat/session-controls.ts:97, c645ec4555c0)
  • PR changes the right render gate: The PR changes quotaPill from sessionSwitcherOnly-gated to compact-gated, preserving model-selector suppression while restoring the informational quota pill when there is room. (ui/src/ui/chat/session-controls.ts:98, c8cd26ab0171)
  • PR adds the needed sidebar layout slot: The PR adds quota grid-template rows for session-switcher rows with and without an agent selector, so the newly rendered quota area is placed deterministically. (ui/src/styles/chat/layout.css:1816, c8cd26ab0171)

Likely related people:

  • steipete: GitHub and git history show this handle authored and merged the provider quota UI feature and the calm-composer/sidebar refactor that introduced the sessionSwitcherOnly sidebar path. (role: provider quota feature owner and sidebar 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.ts)
  • harjothkhara: Authored the merged desktop composer quota repair for the same regression family, which restored the composer surface but not this sidebar path. (role: recent adjacent quota repair contributor; confidence: medium; commits: 5a9396ef6dba; files: ui/src/ui/app-render.helpers.ts, ui/src/ui/app-render.ts, ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts)
  • Solvely-Colin: Authored recent session workspace rail work that touched the same Control UI chat/sidebar rendering area referenced in the regression discussion. (role: recent adjacent sidebar 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)
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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jun 18, 2026
@openclaw-clownfish
openclaw-clownfish Bot merged commit cf31689 into openclaw:main Jun 22, 2026
141 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 23, 2026
… switcher (fixes openclaw#93041) (openclaw#94219)

* fix(control-ui): restore provider usage quota pill in sidebar session switcher

* ci: re-trigger flaky cron-service shard

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

---------

Co-authored-by: Pick-cat <[email protected]>
Co-authored-by: Pick-cat <[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 P2 Normal backlog priority with limited blast radius. 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: After 2026.6.6 no Codex usage\limit UI present in the Control UI Chat interface

1 participant