Skip to content

Self-host workspace creation persists free plan and eventually exhausts API quota #432

Description

@kevinoneill

Summary

The Node/SQLite self-host engine uses StaticEntitlementsProvider(kv) with a default plan of selfhost, but workspaces.plan is non-null and defaults to free. createWorkspace does not set a plan, so every workspace created through POST /v1/workspaces persists free; the provider never reaches its selfhost default. After 100,000 API calls, a self-host deployment starts returning 429 plan_limit_exceeded.

Current source

  • packages/engine/src/providers/static-entitlements.ts: default provider plan is selfhost, with unlimited API calls.
  • packages/engine/src/db/schema.ts: plan: text('plan').notNull().default('free').
  • packages/engine/src/engine/workspace.ts: createWorkspace omits plan.

The same behavior exists in installed @relaycast/engine 8.2.1 and current upstream 8.9.1.

Reproduction

  1. Start relaycast-engine with Node + SQLite.
  2. POST /v1/workspaces with a name.
  3. Query the resulting SQLite row: plan is free.
  4. Set usage:<workspace-id>:api_calls to 100000 or make that many calls.
  5. Authenticated API routes return 429 with plan_limit_exceeded, despite this being the self-host runtime.

Expected

A workspace created by the self-host adapter should use the selfhost entitlement unless the embedding deployment explicitly supplies a tiered plan. Existing self-host databases with an implicit/default free row may also need a migration or documented repair path.

Impact

The failure appears only after prolonged successful operation and disables channels, inbox, roster identity reads, and observer backfill. It looks like an external billing/quota problem even though the engine and database are local.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions