Repository navigation
Adjust Finny plan limits - #9
Conversation
There was a problem hiding this comment.
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.
| 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) |
There was a problem hiding this comment.
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.
| - **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. |
There was a problem hiding this comment.
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.
| - **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. |
| 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) |
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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.
| <text fg={theme.textMuted}>• 5 terminal + 3 cloud live runs</text> | |
| <text fg={theme.textMuted}>• 5 terminal live runs</text> |
|
@copilot Review the pr again with the new commit |
The latest commit (
|
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]>
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:
CLI and UI updates:
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:
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.