feat(engine): add a connect plan sized for collaboration rooms

Merged
KH
2d ago
+58-6

Part of AgentWorkforce/cloud#5293.

Problem

Relay Connect rooms are separate Relaycast workspaces with a few seats that poll their inbox every few seconds. On free (100k api_calls/month) a two-seat room ran out in about 39 hours (cloud#5276). Cloud moved rooms to pro as a stopgap, which gives a room 100 agents and 10M calls it will never use.

Change

  • PLAN_LIMITS.connect: 10 agents, 3,000,000 api_calls, 100,000 messages, 1 GiB files, 1,200 requests/min. Every value sits between free and pro.
  • WorkspaceSchema.plan accepts connect.
  • Changelog entries (root, engine, types).
  • The release contract passes. packages/engine, packages/types and packages/sdk-typescript changelogs now open with [Unreleased - Minor]. The sdk-typescript one already blocked the next release on main, because the rotate-key entry sat under a bare [Unreleased].
  • openapi.yaml documents Workspace.plan (including connect), the README has a plan-limits table, and WorkspaceSchema.plan accepts selfhost.

Product decision, approved by Khaliq. A two-seat room polling every 3s plus a 30s heartbeat makes about 44 requests/min, about 1.9M calls in a 30-day month, so 3M leaves headroom for a third seat or bursts. 1,200/min allows about 20 polling seats in bursts.

Land order

  1. This PR, then an engine release.
  2. relaycast-cloud bumps @relaycast/engine and adds connect to PLAN_RANK (the internal /internal/workspaces/:id/api-key route already accepts any PLAN_LIMITS key, so it accepts connect once the engine bump lands).
  3. Only after relaycast-cloud is deployed does Cloud switch CONNECT_ROOM_PLAN to connect. Before that, the route answers 400 and Cloud fails the room create.

Verification

$ node --input-type=module -e "import {assertRepositoryChangelogSemver} from './scripts/release-contract.mjs'; assertRepositoryChangelogSemver('.', '10.6.0')"
PASS changelog semver for 10.6.0
  (on main: FAIL packages/sdk-typescript/CHANGELOG.md: Non-empty [Unreleased] must declare Patch, Minor, or Major)
$ node --test scripts/release-contract.test.mjs   → pass 25, fail 0
$ cd packages/engine && npx vitest run src/providers/__tests__/static-entitlements.test.ts
 Test Files  1 passed (1)
      Tests  3 passed (3)

$ npx tsc --noEmit -p packages/engine   → exit 0
$ npx turbo lint --filter=@relaycast/engine --filter=@relaycast/types
 Tasks:    4 successful, 4 total

Revert check: removing the connect: row from PLAN_LIMITS:

     × resolves the connect profile for room workspaces
     × sizes connect between free and pro on every metric
      Tests  2 failed | 1 passed (3)

Restored → Tests 3 passed (3).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


[!NOTE]
Medium Risk
Adds a new billing/entitlements tier and widens the workspace plan contract; behavior is additive but cloud must bump the engine before assigning connect to rooms.

Overview
Introduces a connect workspace plan for short-lived Relay Connect rooms, with limits between free and pro: 10 agents, 3M API calls/month, 100k messages, 1 GiB files, and 1,200 requests/min. The engine’s PLAN_LIMITS and StaticEntitlementsProvider resolve these when workspace.plan is connect.

API and types now expose and validate connect (and selfhost, which the schema previously rejected) on WorkspaceSchema.plan and in OpenAPI. The README documents how each plan drives rate limits and monthly quotas.

Vitest coverage asserts connect resolves correctly and sits strictly between free and pro on every entitlement metric.

Reviewed by Cursor Bugbot for commit 439628dda3faa528ff9cb1d72bcddfc1f3181bd1. Bugbot is set up for automated code reviews on this repo. Configure here.


Agent Relay sessions

  • claude session 76bc532b · opened via gh pr create · last active 2026-10-18
  • claude session 3e515a05 · contributor · ran gh pr commands · last active 2026-10-18