Skip to content

fix(quota): honor trialing as Pro + surface desktop-limit errors to the user#2733

Merged
lukemarsden merged 1 commit into
mainfrom
fix/honor-trialing-and-surface-limit-errors
Jun 25, 2026
Merged

fix(quota): honor trialing as Pro + surface desktop-limit errors to the user#2733
lukemarsden merged 1 commit into
mainfrom
fix/honor-trialing-and-surface-limit-errors

Conversation

@lukemarsden

Copy link
Copy Markdown
Collaborator

Came out of a real prod incident: a find-ai spec task "failed" with the generic #2397 agent never connected, but the actual cause was the org hitting its concurrent-desktop limit (2) — and it was on the free limit despite having an active trial.

Three fixes:

1. Trialing subscriptions now get Pro quotas (the real bug)

The quota path decided Pro vs Free with SubscriptionStatus == active exactly, but IsSubscriptionActive() (used elsewhere) counts trialing as active. So every trial org was silently throttled to Free limits (2 desktops, etc.). Both org + user paths now use IsSubscriptionActive(). Regression test added (TestGetQuotas_UserTrialingGetsProQuotas).

2. Surface the desktop-limit to the user (stop hiding it as #2397)

When a session can’t start because the org is at its concurrent-desktop limit, the auto-wake cold-start path retried it as transient and finally stamped the generic “agent never connected (#2397)” banner. maybeKickColdStart now does a quota pre-check (gated on EnforceQuotas, mirroring checkLimits): at-limit → mark the interaction errored immediately with a clear, actionable message (Desktop limit reached (N). Stop a running desktop session, or raise your organizations concurrent-desktop limit, then retry.) — no wasted retries on a non-retryable limit.

3. Rename "Activate Trial" → "Activate"

Admin users panel: menu item, dialog title, submit button. It activates a plan, not just a trial.

Testing

  • go test ./pkg/quota/ green incl. the new trialing test; go build ./pkg/server/ + server test pkg compile; yarn build clean.
  • Not yet live-exercised end-to-end (ships via release); the trialing fix also makes the manual active bump I did on find-ai unnecessary going forward.

🤖 Generated with Claude Code

Three related fixes around plan limits:

1. quota: a *trialing* subscription now grants Pro quotas. The quota path
   checked `SubscriptionStatus == active` exactly, but IsSubscriptionActive()
   (used everywhere else) counts trialing as active — so every trial org was
   silently throttled to Free limits (e.g. 2 concurrent desktops). Switch both
   the org and user paths to IsSubscriptionActive(). Regression test added.

2. surface limits: when a spec-task/desktop session can't start because the org
   is at its concurrent-desktop limit, the auto-wake cold-start path retried it
   as if transient and finally stamped the generic "agent never connected
   (#2397)" error — hiding the real cause. maybeKickColdStart now does a
   quota pre-check (gated on EnforceQuotas, mirroring checkLimits): if the org
   is at the desktop limit it marks the interaction errored immediately with a
   clear, actionable message instead of burning retries on a non-retryable
   limit.

3. admin UI: rename the "Activate Trial" action to "Activate" (menu item,
   dialog title, submit button) — it activates a plan, not just a trial.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lukemarsden lukemarsden merged commit 9174a55 into main Jun 25, 2026
5 checks passed
@lukemarsden lukemarsden deleted the fix/honor-trialing-and-surface-limit-errors branch June 25, 2026 15:26
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