Skip to content

Give a card-backed Cloud trial the full Team code mode - #1490

Merged
helpcodeai merged 1 commit into
mainfrom
helpcodeai/code-mode-card-trial
Nov 3, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
helpcodeai/code-mode-card-trial

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Closes #1489. Follow-up to the per-plan code-mode gating (PR #1447 / #1446).

What

A Cloud trial that has added a card (licence plan='trial' with billing.status='trialing') is treated as Team for code mode for the length of the trial:

  • inline code (code_execute / code_propose_tool) unlocked, and
  • the Team saved-tool cap of 20 instead of the free-trial cap of 3.

A free, card-less trial is unchanged (tools-only, cap 3, no inline). This lets a high-intent user try the whole product during the trial, a conversion lever, while a card is on file to limit abuse.

Behaviour (Cloud + self-hosted)

  • Cloud: card trial -> Team experience; free trial -> tools-only cap 3.
  • Self-hosted: a trial carries no Stripe billing, so it is never promoted — unchanged.

How

  • license/code-mode-quotas.ts: new pure effectiveCodeModePlan(plan, cardTrial) ('trial' + card -> 'team', everything else unchanged).
  • license/license-guard.service.ts: a private codeModePlan(license) reads billing.status === 'trialing' and feeds the effective plan to checkCanCreateCodeTool and canUseInlineCode.
  • Docs (docs/code-mode.md 'Per plan' note) + regenerated llms-full.txt.

No Prisma/schema change. Still off unless an operator runs the runner and a workspace turns codeMode on per server.

Tests / checks (packages/backend)

  • npx tsc --noEmit — clean.
  • npx eslint on the three touched files — clean.
  • npx jest --maxWorkers=4 src/license — 245 pass (adds card-trial cases to code-mode-gating.spec.ts).
  • npx jest --maxWorkers=4 dynamic-mcp-tools code-tool mcp-endpoint — 209 pass.
  • node scripts/generate-llms-txt.mjs --check — clean.

A Cloud trial with a card on file (licence plan='trial', billing.status=
'trialing') is high-intent and low-abuse, so it is treated as Team for code
mode for the length of the trial: inline code (code_execute / code_propose_tool)
and the Team saved-tool cap of 20, instead of tools-only with a cap of 3. A
free, card-less trial is unchanged, and a self-hosted trial carries no billing
so it is never promoted.

effectiveCodeModePlan() resolves a card trial to 'team'; LicenseGuardService
reads billing.status in checkCanCreateCodeTool and canUseInlineCode. No schema
change.
@helpcodeai
helpcodeai merged commit 0358974 into main Nov 3, 2026
15 checks passed
@helpcodeai
helpcodeai deleted the helpcodeai/code-mode-card-trial branch November 3, 2026 15:34
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code mode: card-backed Cloud trial gets the full Team experience (inline + cap 20)

1 participant