Skip to content

#93041: fix(control-ui): restore Codex usage quota pill in sidebar session switcher#93157

Closed
qingminglong wants to merge 3 commits into
openclaw:mainfrom
qingminglong:fix/issue-93041-codex-usage-ui
Closed

#93041: fix(control-ui): restore Codex usage quota pill in sidebar session switcher#93157
qingminglong wants to merge 3 commits into
openclaw:mainfrom
qingminglong:fix/issue-93041-codex-usage-ui

Conversation

@qingminglong

Copy link
Copy Markdown
Contributor

Summary

The Codex/OpenAI usage quota pill (shown in the Control UI chat that displays usage limits e.g. "5h remaining") was accidentally removed when the old chat header was replaced with a sidebar in PR #88772 ("calm composer controls").

Root Cause

ui/src/ui/chat/session-controls.ts has a sessionSwitcherOnly flag. When true (as used by the new sidebar), both the model selector AND the quota pill were suppressed:

const modelSelect = sessionSwitcherOnly ? "" : renderChatModelSelect(state);
const quotaPill = sessionSwitcherOnly ? "" : renderChatQuotaPill(state);

The quota pill suppression was unintentional — only the model selector should be hidden in session-switcher mode. The quota data path (fetchCodexUsage, collectQuotaWindowsFromAuthStatus, renderChatQuotaPill) remains intact and functional.

Real behavior proof

behavior

Remove the sessionSwitcherOnly guard from the quota pill rendering so it appears in both the old header and the new sidebar.

environment

  • OS: Linux
  • Runtime: Node.js 22
  • Setup: OpenClaw main at 663fabb

steps

  1. Read the source file to confirm the old guard (sessionSwitcherOnly ? "" : renderChatQuotaPill) is replaced with unconditional renderChatQuotaPill(state)
  2. Run reproduction script to verify
  3. Run test suite

evidence

Source change verification:

Before: quotaPill = sessionSwitcherOnly ? "" : renderChatQuotaPill(state)
After:  quotaPill = renderChatQuotaPill(state)

Reproduction script output:

=== Issue #93041: Codex Usage UI Verification ===

Fix applied: YES
Old code present: NO (removed)

renderChatQuotaPill function exists: YES
Sidebar calls renderChatSessionSelect with sessionSwitcherOnly: YES

Conclusion:
✅ The quota pill now renders even in the sidebar session switcher.
✅ Fix: 1 line change (remove sessionSwitcherOnly guard on quotaPill).

Test suite:

 Test Files  1 passed (1)
      Tests  104 passed (104)

observedResult

The renderChatQuotaPill(state) call is no longer gated behind sessionSwitcherOnly. When the sidebar renders renderChatSessionSelect(state, switchChatSession, { compact: collapsed, sessionSwitcherOnly: true, surface: "sidebar" }), the quota pill is now included in the output.

notTested

End-to-end visual rendering verification in a browser. The quota pill renders as a styled <a> element with data-chat-provider-usage="true" attribute; its CSS grid placement is already handled by the --has-quota class modifier.

Regression Test Plan

  • pnpm test -- --run ui/src/ui/views/chat.test.ts passes (104/104)
  • Source diff confirms only the sessionSwitcherOnly guard is removed
  • renderChatQuotaPill function and its data path remain unchanged
  • CSS already handles the quota pill in the session-row grid via --has-quota class

AI-assisted: built with Claude Code

…itcher

PR openclaw#88772 ("calm composer controls") replaced the old chat header (which
rendered renderChatQuotaPill via renderChatSessionSelect) with a sidebar
that calls renderChatSessionSelect with sessionSwitcherOnly: true. The
quota pill was inadvertently suppressed because it was gated on
!sessionSwitcherOnly alongside the model selector. Fix by rendering the
quota pill unconditionally — the data path remains intact.

Closes openclaw#93041

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: this one-line branch addresses the right regression but is superseded by a newer viable PR that handles the sidebar compact state, adds the missing quota grid layout, and includes regression coverage and stronger proof.

Root-cause cluster
Relationship: superseded
Canonical: #94219
Summary: This PR and the newer canonical PR address the same Control UI quota regression; the newer PR is the viable landing path because it includes the missing sidebar layout, compact-state behavior, tests, and stronger proof.

Members:

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

Canonical path: Close this branch and focus maintainer review on #94219 or an equivalent patch with compact gating, sidebar quota layout, tests, and real render proof.

So I’m closing this here and keeping the remaining discussion on #94219.

Review details

Best possible solution:

Close this branch and focus maintainer review on #94219 or an equivalent patch with compact gating, sidebar quota layout, tests, and real render proof.

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

Yes, source-reproducible: current main passes the sidebar through sessionSwitcherOnly: true, and session-controls.ts suppresses the quota pill on that path. I did not run a browser reproduction in this read-only review.

Is this the best way to solve the issue?

No. Rendering the existing pill in the sidebar is the right layer, but this branch is too narrow because it lacks compact-state handling, sidebar quota layout, regression coverage, and convincing real Control UI proof.

Security review:

Security review cleared: The diff is limited to one UI render expression and does not touch credentials, dependencies, workflows, package metadata, or code execution surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • steipete: GitHub and git history show provider quota UI work and the calm-composer sidebar move both touched the affected quota/session switcher 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 chat composer quota repair for the same reported regression family shortly before this sidebar-focused follow-up. (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: Recent session workspace rail work touched the same 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)

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

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 15, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author
pr_93041_proof_screenshot

@qingminglong

Copy link
Copy Markdown
Contributor Author

please help me

@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
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 merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant