Skip to content

fix: hide unlimited daily quota setting - #340

Closed
neubig wants to merge 8 commits into
mainfrom
fix/hide-unlimited-daily-quota
Closed

neubig wants to merge 8 commits into
mainfrom
fix/hide-unlimited-daily-quota

Conversation

@neubig

@neubig neubig commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • hide the quota settings navigation item when the daily conversation limit is unlimited
  • keep the item visible for configured finite limits
  • add regression coverage for both cases

Tests

  • npx vitest run __tests__/hooks/use-settings-nav-items.test.tsx
  • npm run typecheck

This pull request was created by an AI agent (OpenHands) on behalf of the user.


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-7bb1a07

neubig and others added 5 commits August 20, 2026 16:01
Add GET /api/quota/status returning the authenticated user's effective
daily limit, used count, remaining, and next UTC-midnight reset_at.
Add a SaaS-only settings page at /settings/quota showing a progress bar
and a live HH:MM:SS countdown to the next reset. Includes focused tests
for the quota status service covering unlimited, partial, exhausted,
and no-usage-today cases.

Stacked on feat/daily-conversation-limit (PR #180).

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Return undefined explicitly from the countdown effect's no-op branch
(consistent-return alongside the interval cleanup return), apply
Prettier formatting to the SaaS-only message and countdown span, and
swap the unsupported pt-BR translations of the quota keys for the
required Catalan (ca) entries.
Sort the quota router imports, drop the unused AsyncSession and patch
imports. These were previously masked in CI because the enterprise lint
job failed to build its mypy environment before ruff could report.
Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: fix A bug fix label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

`UserActions` renders `UserContextMenu`, which calls
`useSettingsNavItems()`. This branch added a `useQuotaStatus` query there
with `refetchInterval: 60_000` and `enabled: isSaasMode`. The suite mocks
config as saas, so the interval was live and each test's
`await vi.runAllTimersAsync()` could never drain it - vitest aborted with
"Aborting after running 10000 timers, assuming an infinite loop!".

These tests never assert on quota, so stub the hook with a settled value.

Co-authored-by: openhands <openhands@all-hands.dev>
@neubig
neubig changed the base branch from feat/quota-usage-page to main September 28, 2026 16:36
Retargeted to main and merged it in: the previous base branch (PR #199) was
already squash-merged into main, and main has since flattened enterprise/ to the
repo root, so every conflict was stale base-PR content that main already
contains. Took main's side throughout; the only remaining delta is the
user-actions test mock.

Co-authored-by: openhands <openhands@all-hands.dev>
@neubig
neubig requested review from all-hands-bot and removed request for all-hands-bot September 29, 2026 19:28
@neubig neubig closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants