Skip to content

Adjust Finny plan limits - #9

Merged
Jaiminp007 merged 2 commits into
devfrom
lighten-the-restriction
Apr 30, 2026
Merged

Jaiminp007 merged 2 commits into
devfrom
lighten-the-restriction

Conversation

@Jaiminp007

Copy link
Copy Markdown
Collaborator

This pull request increases the resource limits for both Free and Lite plans across the platform, affecting saved strategies, daily backtests, and simultaneous live runs. These changes are reflected in the backend logic, CLI interface, documentation, and tests to ensure consistency and clarity for users.

Plan limit increases:

  • Increased the Lite plan limits to 15 saved strategies, 20 backtests per day, and 5 terminal + 3 cloud live runs; Free plan now allows 5 saved strategies, 10 backtests per day, and 2 terminal runs. [1] [2] [3] [4] [5]

CLI and UI updates:

  • Updated CLI UI (settings-panel-pro.tsx) and algorithm routes to display the new plan limits and enforce them in user-facing dialogs and messages. [1] [2] [3]

Test and documentation updates:

  • Adjusted tests and plan documentation to match the new limits, ensuring that automated checks and developer docs are up to date.

These changes ensure that users on Free and Lite plans have access to more resources and that all parts of the system reflect the updated limits.

Copilot AI review requested due to automatic review settings April 30, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Finny plan-limit values across the codebase so Free and Lite tiers reflect increased caps for saved strategies/algorithms, daily backtests, and simultaneous live runs, with corresponding UI copy, documentation, and test updates.

Changes:

  • Increased per-tier caps in enforcement points (save cap, daily backtest cap, terminal live-run cap).
  • Updated TUI copy to reflect the new limits for Lite/backtests/live runs.
  • Updated internal docs and tests to match the new plan-limit numbers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/opencode/test/plan/plan.test.ts Updates plan-limit value assertions in tests.
packages/opencode/src/tool/algorithm-save.ts Raises saved-algorithm cap and updates upgrade messaging.
packages/opencode/src/live/runner.ts Raises simultaneous terminal live-run caps for Free/Lite tiers.
packages/opencode/src/cli/cmd/tui/routes/algorithms.tsx Updates backtest cap values/messages and updates live-run comment.
packages/opencode/src/cli/cmd/tui/component/settings-panel-pro.tsx Updates displayed Lite plan limits in the plan panel copy.
.agents/PLAN_LITE_HANDOFF.md Updates Lite plan description and server-side cloud-run cap notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 151 to 180
describe("per-feature gating shape", () => {
test("backtest cap: free=5, lite=10, pro=Infinity (per-day)", () => {
test("backtest cap: free=10, lite=20, pro=Infinity (per-day)", () => {
const DAILY_BACKTEST_LIMIT: Record<Plan.Tier, number> = {
free: 5,
lite: 10,
free: 10,
lite: 20,
pro: Number.POSITIVE_INFINITY,
}
expect(DAILY_BACKTEST_LIMIT.free).toBe(5)
expect(DAILY_BACKTEST_LIMIT.lite).toBe(10)
expect(DAILY_BACKTEST_LIMIT.free).toBe(10)
expect(DAILY_BACKTEST_LIMIT.lite).toBe(20)
expect(Number.isFinite(DAILY_BACKTEST_LIMIT.pro)).toBe(false)
})
test("save cap: free=3, lite=10, pro=Infinity", () => {
test("save cap: free=5, lite=15, pro=Infinity", () => {
const SAVE_CAP: Record<Plan.Tier, number> = {
free: 3,
lite: 10,
free: 5,
lite: 15,
pro: Number.POSITIVE_INFINITY,
}
expect(SAVE_CAP.free).toBe(3)
expect(SAVE_CAP.lite).toBe(10)
expect(SAVE_CAP.free).toBe(5)
expect(SAVE_CAP.lite).toBe(15)
expect(Number.isFinite(SAVE_CAP.pro)).toBe(false)
})
test("terminal-run cap: free=1, lite=3, pro=Infinity", () => {
test("terminal-run cap: free=2, lite=5, pro=Infinity", () => {
const TERMINAL_RUN_CAP: Record<Plan.Tier, number> = {
free: 1,
lite: 3,
free: 2,
lite: 5,
pro: Number.POSITIVE_INFINITY,
}
expect(TERMINAL_RUN_CAP.free).toBe(1)
expect(TERMINAL_RUN_CAP.lite).toBe(3)
expect(TERMINAL_RUN_CAP.free).toBe(2)
expect(TERMINAL_RUN_CAP.lite).toBe(5)
expect(Number.isFinite(TERMINAL_RUN_CAP.pro)).toBe(false)

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are currently tautological: they create local cap maps and then assert the literal values they just defined, so they won’t fail if the real enforcement values change elsewhere (e.g., in AlgorithmSaveTool, the runner, or the TUI). Consider asserting behavior (e.g., that saving/backtesting/live-start is blocked at the configured cap) or importing a single shared source-of-truth for these caps and testing that instead.

Copilot uses AI. Check for mistakes.
Comment thread .agents/PLAN_LITE_HANDOFF.md Outdated
Comment on lines 62 to 63
- **Cloud live runs**: 3 (Lite) / 5 (Pro). The CLI gates the request form
but the actual deploy queue lives server-side; enforce the cap there.

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This handoff doc now states Lite includes 3 cloud live runs and that “the CLI gates the request form”, but in the CLI codebase the managed-hosting request UI is currently Pro-only (e.g., SettingsPanelPro shows it only when tier() === "pro"). Either update this note to match the actual CLI behavior, or ensure Lite users can access the same request flow with the intended cap.

Suggested change
- **Cloud live runs**: 3 (Lite) / 5 (Pro). The CLI gates the request form
but the actual deploy queue lives server-side; enforce the cap there.
- **Cloud live runs**: 3 (Lite) / 5 (Pro). The actual deploy queue lives
server-side, so enforce the cap there. Note: the current CLI managed-hosting
request UI is Pro-only, so do **not** assume Lite users can access the same
request flow until the CLI is updated to expose it.

Copilot uses AI. Check for mistakes.
Comment on lines 62 to 79
const runLive = async (algo: Algorithm.Info) => {
const tier = await Plan.getTier()
// Free: live trading is paid — upsell to Lite (cheapest tier that unlocks it).
if (tier === "free") {
await DialogProUpsell.show(
dialog,
"Live trading is a paid feature. Upgrade to Lite to start live runs.",
"lite",
)
return
}
// Pro: cloud / managed hosting request form (server enforces 5-run cap).
if (tier === "pro") {
await DialogManagedHosting.show(dialog)
return
}
// Lite: local terminal live run (runner enforces 3 simultaneous + broker tier).
// Lite: local terminal live run (runner enforces 5 simultaneous + broker tier).
const liveCfg = parseConfig(algo.config)

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated plan copy/limits in this PR (Free allows terminal runs; Lite includes cloud runs) aren’t reflected here: Free users are still blocked from starting any live run, and only Pro can access the managed-hosting (cloud) request flow. Either adjust this gating to allow Free terminal runs and Lite cloud requests per the new limits, or update the plan messaging/docs so it doesn’t advertise unavailable capabilities.

Copilot uses AI. Check for mistakes.
<text fg={theme.textMuted}>• 15 saved strategies, 20 backtests/day</text>
<text fg={theme.textMuted}>• Live trading on Alpaca, Polymarket, Binance</text>
<text fg={theme.textMuted}>• 3 terminal + 1 cloud live run</text>
<text fg={theme.textMuted}>• 5 terminal + 3 cloud live runs</text>

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Lite feature list now claims "5 terminal + 3 cloud live runs", but the CLI currently only exposes Managed Hosting (cloud runs) when tier() === "pro" (and the Algorithms route also routes cloud requests to Pro only). This is misleading for Lite users unless Lite cloud runs are actually supported; either change the copy to match current behavior or add the Lite cloud-run request path with a 3-run cap.

Suggested change
<text fg={theme.textMuted}>• 5 terminal + 3 cloud live runs</text>
<text fg={theme.textMuted}>• 5 terminal live runs</text>

Copilot uses AI. Check for mistakes.
@Jaiminp007

Copy link
Copy Markdown
Collaborator Author

@copilot Review the pr again with the new commit

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown

@copilot Review the pr again with the new commit

The latest commit (99df312) addresses all four review items:

  1. Tautological tests — Tests in plan.test.ts now reference Plan.DAILY_BACKTEST_LIMIT, Plan.SAVE_CAP, Plan.TERMINAL_RUN_CAP, and Plan.CLOUD_RUN_CAP directly (the single source-of-truth constants). They'll fail if those values change elsewhere.

  2. Handoff doc — Updated to "The CLI exposes the request form for paid tiers", which is accurate now that both Lite and Pro can access the cloud run request form.

  3. algorithms.tsx gating — Free users can now attempt terminal live runs (the runner enforces the 2-run TERMINAL_RUN_CAP). The ☁ Request Cloud button is gated on Plan.hasAtLeast(tier(), "lite"), so it appears for Lite and Pro only.

  4. settings-panel-pro.tsx copy — The Managed Hosting section is shown when tier() !== "free" (Lite + Pro), and cloudRunCopy() dynamically renders "3 cloud live runs" for Lite and "5 cloud live runs" for Pro — matching the advertised capabilities.

@Jaiminp007
Jaiminp007 merged commit 3caacdb into dev Apr 30, 2026
1 check passed
Jaiminp007 pushed a commit that referenced this pull request May 2, 2026
Fixes all 17 Copilot comments:

Telemetry opt-out (#1, #2, #3, #9, #16):
- tracker.ts now reads FINNY_TELEMETRY=0 / OPENCODE_TELEMETRY=0 at module
  load, so the opt-out applies in every entrypoint (TUI worker, server,
  CLI), not just the bootstrap path.
- Email dialog auto-prompt and /subscribe slash command also gated on
  Analytics.isEnabled() — email POST goes to the same Convex deployment.

Tracker correctness (#5, #14, #17):
- drain() now also waits for the DeviceProfile.userId() resolution promise,
  not just the post-send promise.
- worker rpc.shutdown() and main-thread thread.ts both call
  Analytics.drain() before tearing down — neither beforeExit nor SIGTERM
  fire on worker.terminate() / process.exit(0).
- beforeExit handler runs at most once per process, preventing an infinite
  drain loop when a hung telemetry request later resolves and re-empties
  the loop.

Privacy (#10, #11, #12):
- Drop process.argv from tui.worker.booted (could include --prompt text
  and project paths).
- error.surfaced now sends only error.name; error messages frequently
  embed user prompt content and local file paths.
- Don't persist the submitted email address to local KV (no reader, just
  unnecessary PII retention).

Email dialog state machine (#4, #6, #8):
- Wait for kv.ready before evaluating the prompt gate so we don't re-show
  the dialog to users who already submitted/skipped.
- Conditional dismiss handler — only marks "skipped" when no terminal
  status has been set, so a successful submit isn't overwritten by the
  dismiss callback that fires on dialog.clear() and isn't suppressed by
  another dialog replacing this one.

Server-side validation (#15):
- subscribe mutation now rejects empty / oversized / regex-failing emails
  with a ConvexError, so the public Convex client can't bypass the TUI
  regex.

Command coverage (#13):
- Hook Analytics.track() in DialogCommand.trigger() instead of the bus
  event handler. trigger() is the central activation point for palette,
  slash, keybind, plugin, and bus paths — single hook, full coverage,
  no double-counting.

Comment wording (#7):
- bootstrap.ts: "opt-in by default" → "enabled by default" (correct
  description of opt-out semantics).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.

3 participants