Skip to content

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

Closed
mikasa0818 wants to merge 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-93041
Closed

fix #93041: [Bug]: After 2026.6.6 no Codex usage\limit UI present in the Control UI Chat interface#95317
mikasa0818 wants to merge 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-93041

Conversation

@mikasa0818

Copy link
Copy Markdown
Contributor

Summary

Closes #93041.

  • Fix classification: Root-cause bug fix for the Control UI chat sidebar quota rendering regression.
  • Maintainer-ready confidence: High. The change is limited to one render gate plus sidebar grid areas, and the affected expanded/collapsed sidebar states are covered by focused unit tests and browser E2E proof.
  • Patch quality notes: Focused XS/S diff; production behavior changes in ui/src/ui/chat/session-controls.ts and ui/src/styles/chat/layout.css are paired with regression coverage in ui/src/ui/views/chat.test.ts and ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts. No fallback, catch-all, config, auth, provider routing, or quota data-path changes were added.
  • Risk labels considered: merge-risk: session-state, because session-controls.ts is a chat/session control surface. No actual session identity, persistence, or switching state is changed; this only changes whether an already-computed informational quota link renders in the sidebar.

What Problem This Solves

After the 2026.6.6 chat layout change, the expanded Control UI chat sidebar stopped showing the OpenAI/Codex provider usage pill. The sidebar still received provider usage data through models.authStatus, but the chat session selector was rendered in sessionSwitcherOnly mode and discarded the quota pill before rendering the sidebar markup.

Users who rely on the Control UI chat sidebar to monitor OpenAI/Codex 5h/weekly limits can see the Usage pill again without changing model selection, session switching, /usage, or provider auth behavior.

Related context: #94219 is an existing open PR for the same issue. This PR keeps the same narrow owner boundary: render gating + sidebar layout + regression proof only.

Root Cause

  • Root cause: The 2026.6.6 sidebar chat layout calls renderChatSessionSelect(...) with sessionSwitcherOnly: true so the sidebar shows only session switching UI. renderChatSessionSelect used that same flag to suppress both the model selector and renderChatQuotaPill(state), so valid OpenAI/Codex usage windows from models.authStatus were discarded before markup reached the expanded sidebar.
  • Why this is root-cause fix: The source invariant is that sessionSwitcherOnly should hide controls used to switch model/session settings, while the provider quota pill is informational navigation to Usage. Gating the quota pill on compact instead restores it anywhere there is enough sidebar space and still keeps the collapsed 44px rail clean. Adding explicit quota grid rows to the sidebar session-switcher layout gives the restored pill a deterministic slot instead of relying on implicit CSS placement.
  • Architecture / source-of-truth check: The source-of-truth render owner is renderChatSessionSelect plus its chat-controls__session-row CSS. The quota data source remains collectQuotaWindowsFromAuthStatus(...) / renderChatQuotaPill(...); no OpenAI/Codex OAuth status, provider routing, /usage, or Gateway protocol contract is changed.
  • What did NOT change: No quota collection behavior, model auth status loading, /status, /usage, provider credentials, model routing, session switching RPCs, or model selector behavior changed. sessionSwitcherOnly still hides the model selector, and compact/collapsed sidebar mode still hides the quota pill.

Why This Change Was Made

The quota pill is informational navigation to Usage, not a model/session control. This keeps sessionSwitcherOnly hiding the model selector, but allows the quota pill to render whenever the session switcher is not compact/collapsed. The compact 44px sidebar still omits the pill because there is no space for it.

The sidebar session-switcher CSS grid also now has explicit quota rows for both agent+session and single-session layouts. Without those grid areas, a restored quota pill would not have a deterministic slot in the sidebar stack.

User Impact

  • Why it matters / User impact: Users with monitored provider usage windows, including OpenAI/Codex OAuth usage, see the Usage quota pill again in the expanded Control UI chat sidebar and can click it to open Usage. Users with the collapsed sidebar or without provider usage windows see no new pill.

Evidence

See the real behavior proof and regression test plan below. All commands were run after the patch against the committed code path and exited 0.

Real behavior proof

  • Behavior or issue addressed: Restores the OpenAI/Codex provider usage quota pill in the expanded Control UI chat sidebar while preserving the compact/collapsed sidebar behavior.

  • Real environment tested: Windows/Git Bash task worktree, Node v22.17.0, pnpm 11.2.2. The repo emitted its existing engine warning (wanted: {"node": ">=22.19.0"}) during pnpm commands; the commands below still exited 0.

  • Exact steps or command run after this patch:

    node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
    node scripts/run-vitest.mjs ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts
    node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.tsbuildinfo
    pnpm ui:build
    pnpm format:check ui/src/ui/chat/session-controls.ts ui/src/ui/views/chat.test.ts ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts ui/src/styles/chat/layout.css
    
  • Evidence after fix: Focused chat test exited 0 and asserts the expanded sidebar sessionSwitcherOnly: true render includes [data-chat-provider-usage="true"], keeps [data-chat-model-select="true"] hidden, and compact sidebar mode omits the quota pill. Browser E2E exited 0; with mocked models.authStatus provider usage, it waits for both .sidebar-session-select [data-chat-provider-usage="true"] and .agent-chat__composer-controls [data-chat-provider-usage="true"] to be visible, then verifies the sidebar pill links to /usage and mentions Codex. UI test typecheck exited 0. pnpm ui:build exited 0 and Vite completed with ✓ built in 2.28s. Formatter check exited 0 with All matched files use the correct format.

  • Observed result after fix: The real browser Control UI render path now exposes the quota pill under .sidebar-session-select when mocked Gateway auth status reports Codex usage windows, while the existing composer pill remains visible. The focused render test also confirms compact sidebar mode produces no quota pill.

  • What was not tested: A live OAuth-connected OpenAI account showing real account percentages was not available in this environment. The production quota data path is unchanged; the regression proof uses the existing mocked Gateway models.authStatus E2E fixture to exercise the real browser Control UI render path.

SonarLint/Sonar scanner note: no sonarlint or sonar-scanner executable was available on PATH in this environment, so no local Sonar scan was run.

Regression Test Plan

  • Target test file: ui/src/ui/views/chat.test.ts and ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts.
  • Scenario locked in: Provider usage from mocked models.authStatus renders the quota pill in the expanded sidebar session switcher while sessionSwitcherOnly still hides the model selector; compact/collapsed sidebar mode does not render the pill.
  • Why this is the smallest reliable guardrail: The unit test locks the exact render gate that regressed and the compact exception. The browser E2E locks the user-visible Control UI sidebar path without requiring a real OAuth account, while the unchanged quota collection path keeps provider/auth behavior outside this PR.

Merge risk

  • Risk explanation: The only merge-risk signal is the session-state category from touching session-controls.ts; the patch does not mutate session keys, switch sessions, persist state, or change Gateway/session RPC payloads. Layout risk is limited to the sidebar session switcher when quota data exists.
  • Why acceptable: The restored quota pill uses the existing renderChatQuotaPill output and /usage link, and the CSS adds explicit quota grid rows for the expanded sidebar layouts. Focused tests cover expanded sidebar display, model-selector suppression, compact-sidebar hiding, and browser-visible sidebar rendering.

@clawsweeper

clawsweeper Bot commented Jun 20, 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 as superseded: the same production sidebar quota-pill fix landed in the merged canonical PR, current main has the render/layout behavior and unit regression coverage, and this branch now only carries incremental test changes rather than a distinct landing candidate.

Root-cause cluster
Relationship: superseded
Canonical: #94219
Summary: This PR and the merged canonical PR targeted the same Control UI sidebar quota-pill regression; the canonical PR is merged, while this branch now only has incremental test-only residue.

Members:

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

Canonical path: Keep the merged canonical implementation on main; if maintainers still want browser-level sidebar coverage, open a fresh narrow test-only PR rather than landing this superseded branch.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Keep the merged canonical implementation on main; if maintainers still want browser-level sidebar coverage, open a fresh narrow test-only PR rather than landing this superseded branch.

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

No for current main: the original sidebar quota-pill failure is no longer reproducible by source inspection because the quota pill is not gated by sessionSwitcherOnly anymore. The historical failure is still visible in v2026.6.10 source, which predates the current-main canonical fix.

Is this the best way to solve the issue?

No as a standalone PR: the proposed production fix shape is already on main through the canonical merged PR, and this branch's remaining test-only diff is optional follow-up coverage rather than the best landing path.

Security review:

Security review cleared: Cleared: the live net diff only modifies UI tests and introduces no dependency, workflow, credential, auth, package, or execution-path change.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Root AGENTS.md and UI-scoped AGENTS.md were read fully; their PR-depth, duplicate/superseded, UI, proof, and Codex-related review guidance informed this verdict. (AGENTS.md:1, d1b917120a47)
  • Current main source behavior: Current main renders the quota pill when the sidebar is not compact, so sessionSwitcherOnly no longer suppresses the provider usage link. (ui/src/ui/chat/session-controls.ts:101, d1b917120a47)
  • Current main layout support: Current main defines explicit quota grid rows for expanded sidebar session-switcher layouts with quota content. (ui/src/styles/chat/layout.css:1820, d1b917120a47)
  • Current main regression coverage: Current main already has unit coverage for expanded sidebar quota rendering and compact-sidebar hiding. (ui/src/ui/views/chat.test.ts:3785, d1b917120a47)
  • Live PR net diff: GitHub's live pull files show the branch now changes only two UI test files; the production source and CSS changes are no longer part of the net PR diff after main moved ahead. (ca689ef0ac7c)
  • Canonical merged fix: The merged canonical PR changed the same render gate, sidebar layout rows, and unit coverage for the same closed user report. (ui/src/ui/chat/session-controls.ts:101, cf31689a03a7)

Likely related people:

  • steipete: GitHub and git history show this handle authored the provider quota UI work and authored/merged the calm-composer/sidebar refactor that made the sidebar use sessionSwitcherOnly. (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)
  • Pick-cat: Authored the merged canonical PR that restored the sidebar quota render gate and layout rows for the same user report. (role: canonical fix author; confidence: high; commits: cf31689a03a7; files: ui/src/ui/chat/session-controls.ts, ui/src/styles/chat/layout.css, ui/src/ui/views/chat.test.ts)
  • harjothkhara: Authored the merged desktop composer quota repair and added the E2E file that this PR now extends. (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)
  • vincentkoc: Merged the desktop composer quota repair for the same regression family, which is useful routing context for Control UI quota-pill follow-up. (role: recent adjacent merger; confidence: medium; commits: 5a9396ef6dba; files: ui/src/ui/app-render.ts, ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts)

Codex review notes: model internal, reasoning high; reviewed against d1b917120a47; fix evidence: commit cf31689a03a7, main fix timestamp 2026-06-22T19:21:38Z.

@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 20, 2026
# Conflicts:
#	ui/src/styles/chat/layout.css
#	ui/src/ui/chat/session-controls.ts
#	ui/src/ui/e2e/chat-quota-pill-93041.e2e.test.ts
#	ui/src/ui/views/chat.test.ts
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 28, 2026
@clawsweeper clawsweeper Bot closed this Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper autoclose is complete.

Reason: structured ClawSweeper close marker: close-required (sha=ca689ef0ac7cf5a9bcd3c6735e19308e24debf64)

Closed:

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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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