Skip to content

test: cover LLM quota guard - #80

Open
beanscg wants to merge 1 commit into
albegosu:mainfrom
beanscg:bean-labs-llm-quota-guard-tests
Open

test: cover LLM quota guard#80
beanscg wants to merge 1 commit into
albegosu:mainfrom
beanscg:bean-labs-llm-quota-guard-tests

Conversation

@beanscg

@beanscg beanscg commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Adds focused Vitest coverage for server/utils/llm-quota-guard.ts, one of the smaller uncovered server/utils helpers called out by the coverage work in #68.

The new tests cover:

  • suppression after provider quota errors
  • app rate-limit errors not being treated as provider quota suppression
  • explicit/manual quota-hit marking with no error argument
  • cooldown expiry after five minutes

This keeps the first slice narrow and does not raise coverage thresholds.

Validation

The local shell does not have a global pnpm shim, so I ran the same project commands through npx --package pnpm@10.12.4 pnpm ... using Node 24.14.0.

  • pnpm install --frozen-lockfile
  • pnpm test -- tests/llm-quota-guard.spec.ts
  • pnpm lint
  • pnpm typecheck
  • pnpm test:coverage
  • SKIP_ENV_VALIDATION=true pnpm build
  • pnpm ci:check
  • git diff --check HEAD~1 HEAD

Coverage report showed server/utils/llm-quota-guard.ts at 100% statements/branches/functions/lines, and the full project thresholds stayed green.

Submitted by Bean Labs as a public free-service contribution; acceptance is still pending maintainer review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant