Skip to content

AI: status, subscriber gating and daily-quota surfacing #10

Description

@Adron

AI controls must hide themselves rather than fail, matching the web app's documented behaviour.

Rules from the product docs

  • providers: [] → the site has no ANTHROPIC_API_KEY; hide all AI controls (calls would 409 no_provider_configured).
  • subscriber: false → free account; do not show AI controls at all.
  • Quota is 50 actions/day per account; a preview and its confirmed action each count.
  • 429 quota_exceeded → tell the user to retry tomorrow; 429 rate_limited → honor Retry-After.

Acceptance criteria

  • GET /api/ai/status is fetched once per session (and on demand) and cached on a shared service.
  • A single IsAiAvailable gate (subscriber AND providers non-empty) drives visibility of every AI affordance.
  • Remaining quota is visible wherever an AI action is offered (e.g. 42 of 50 left today).
  • quota_exceeded and rate_limited render as distinct, non-blocking in-place messages — not a generic error toast, and never a modal that blocks the dispatcher.
  • No AI control is ever shown to a free account.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must have for a credible parity claimarea:aiArea: aiparityWeb/API feature-parity work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions