feat: enhance user tier management and model access: - #257
Conversation
- Added functions to retrieve user plan tier and model access based on subscription status. - Updated model definitions to include new models and adjusted existing model properties for clarity. - Enhanced the CLI to display user plan tier in the status bar and ensure model gating aligns with user subscriptions.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe CLI now uses subscription tiers to select available models, enforce frontier-model access, normalize model lookup, seed new model entries, and display the active plan in the chat footer. ChangesTier-aware model access
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ModelPicker
participant SubscriptionLookup
participant Prisma
participant TierCatalog
User->>ModelPicker: Open model picker
ModelPicker->>SubscriptionLookup: Detect user tier
SubscriptionLookup->>Prisma: Query active or trialing subscription
Prisma-->>SubscriptionLookup: Return plan tier
SubscriptionLookup-->>ModelPicker: Return UserTier
ModelPicker->>TierCatalog: Load tier-specific models
TierCatalog-->>ModelPicker: Return selectable models
User->>ModelPicker: Select frontier model
ModelPicker-->>User: Show Pro Plan Required when tier is insufficient
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts (2)
660-670: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
PREMIUM_CLOUD_MODELSfor frontier access checks.The local
frontierModelsset duplicatesPREMIUM_CLOUD_MODELS. Use the exported set so one policy list controls model gating.Proposed fix
- const frontierModels = new Set([ - "anthropic/claude-sonnet-4.6", - "anthropic/claude-opus-4.7", - "anthropic/claude-opus-4-8", - "openai/gpt-5.5", - "grok/grok-4-fast-reasoning", - "gemini-2.5-pro", - "deepseek/deepseek-reasoner", - ]) - if (frontierModels.has(selected.value) && userTier !== "pro" && userTier !== "ultra") { + if (PREMIUM_CLOUD_MODELS.has(selected.value) && userTier !== "pro" && userTier !== "ultra") {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts` around lines 660 - 670, The frontier access check currently duplicates the premium model policy in the local frontierModels set. Replace that local set usage with the exported PREMIUM_CLOUD_MODELS set, and keep the existing Pro/Ultra tier condition unchanged so one shared policy list controls gating.
7-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the required
@/import aliases.These imports use
src/.... Replace them with@/...aliases.Proposed fix
-import { getStoredToken } from "src/lib/token" -import { getCurrentUser } from "src/lib/api-client" -import prisma from "src/lib/prisma" +import { getStoredToken } from "`@/lib/token`" +import { getCurrentUser } from "`@/lib/api-client`" +import prisma from "`@/lib/prisma`"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts` around lines 7 - 9, Update the imports for getStoredToken, getCurrentUser, and prisma in model.ts to use the required `@/` aliases instead of src/ paths, preserving the existing imported symbols and behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/supercode-cli/server/prisma/seed.ts`:
- Around line 165-172: The Prisma CLI and generated client versions must be
aligned at 7.8.0. Update the project’s Prisma CLI dependency and regenerate the
client so db:generate and the seed path use the same 7.8.0 runtime as
`@prisma/client`; leave the model seed entries unchanged.
In `@apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts`:
- Around line 249-281: Update the "none" entry in TIER_MODELS so it excludes
Spark-gated cloud models such as hy3 and minimax-m3 instead of spreading all
CLOUD_MODELS. Preserve accessible cloud models and BYOK entries, add the
existing upgrade-path presentation for unavailable cloud access, and retain
isModelAllowedForTier enforcement at execution time.
In `@apps/supercode-cli/server/src/lib/model-access.ts`:
- Around line 58-62: Update the Spark Premium message in the user-tier checks
around tierIndex so it no longer claims access to more open models; describe the
correct benefits as higher limits and credits while preserving the existing
upgrade instruction and Pro-tier message.
- Around line 38-47: Update the model lookup in isModelAllowedForTier to remove
broad substring matching via normalized.includes(slug) and
slug.includes(normalized). Permit only exact normalized slug matches or explicit
provider-qualified values ending with /${slug}; add registered aliases in the
Model table or alias configuration for any required alternative spellings.
---
Nitpick comments:
In `@apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts`:
- Around line 660-670: The frontier access check currently duplicates the
premium model policy in the local frontierModels set. Replace that local set
usage with the exported PREMIUM_CLOUD_MODELS set, and keep the existing
Pro/Ultra tier condition unchanged so one shared policy list controls gating.
- Around line 7-9: Update the imports for getStoredToken, getCurrentUser, and
prisma in model.ts to use the required `@/` aliases instead of src/ paths,
preserving the existing imported symbols and behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7482ade4-a5b6-402e-b0c3-266ab4293ed8
📒 Files selected for processing (6)
apps/supercode-cli/server/package.jsonapps/supercode-cli/server/prisma/seed.tsapps/supercode-cli/server/src/cli/ai/chat/chat.tsapps/supercode-cli/server/src/cli/commands/slashCommands/model.tsapps/supercode-cli/server/src/cli/utils/tui.tsapps/supercode-cli/server/src/lib/model-access.ts
| // ── Spark / Spark Premium (minTier: "spark") — all open / cloud free models ── | ||
| // Spark Premium uses the same open catalog (higher limits/credits); gating is by tier order. | ||
| { slug: "deepseek-v4-flash", displayName: "DeepSeek V4 Flash", provider: "deepseek", minTier: "spark", inputPrice: 0.15, outputPrice: 0.60, cachedPrice: 0 }, | ||
| { slug: "deepseek/deepseek-v4-flash", displayName: "DeepSeek V4 Flash (OR)", provider: "openrouter", minTier: "spark", inputPrice: 0.15, outputPrice: 0.60, cachedPrice: 0 }, | ||
| { slug: "hy3", displayName: "Hunyuan Hy3", provider: "supercode", minTier: "spark", inputPrice: 0.15, outputPrice: 0.60, cachedPrice: 0 }, | ||
| { slug: "MiniMax-M3", displayName: "MiniMax M3", provider: "minimax", minTier: "spark", inputPrice: 0.20, outputPrice: 0.80, cachedPrice: 0.04 }, | ||
| // CLI cloud picker uses this slug; keep both so plan-gate matches either form | ||
| { slug: "minimax-m3", displayName: "MiniMax M3 (cloud)", provider: "supercode", minTier: "spark", inputPrice: 0.20, outputPrice: 0.80, cachedPrice: 0.04 }, |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
jq '{
prisma: (.devDependencies.prisma // .dependencies.prisma),
prismaClient: .dependencies["`@prisma/client`"]
}' apps/supercode-cli/server/package.json
fd -HI '^(bun\.lock|bun\.lockb)$' . -x rg -n -C 2 '"(prisma|`@prisma/client`)"' {}Repository: yashdev9274/supercli
Length of output: 28499
🌐 Web query:
Prisma 7.8.0 @prisma/client 7.8.0 release notes compatibility prisma client runtime
💡 Result:
The Prisma 7.8.0 release, published on April 22, 2026, focuses on performance enhancements and bug fixes for the Prisma Client and migration tools [1][2]. A key addition in version 7.8.0 is the queryPlanCacheMaxSize option in the PrismaClient constructor [3][2][4]. This allows developers to control the query plan cache size: - Setting this to 0 disables the cache entirely [3][2][5]. - Omitting it uses the default cache size [3][2][5]. - Increasing the value can improve performance for applications executing many unique queries, while decreasing it can reduce memory usage [2][6][5]. Regarding Prisma Client runtime compatibility, Prisma maintains support for multiple environments. The internal runtime targets identified for the client include 'nodejs', 'workerd', 'vercel-edge', and 'deno' [7]. The public-facing runtime options supported by the client generator comprise 'nodejs', 'deno', 'bun', 'workerd', 'cloudflare', 'vercel-edge', and 'edge-light' [7][8]. The client handles environment detection to route requests to the appropriate runtime logic [7][9]. Bug fixes in this release include: - Resolved issues with equality filter panics and incorrect JSONB casts for PostgreSQL JSON list columns [1][2]. - Fixed case-insensitive JSON field filtering [1][2]. - Addressed incorrect parameterization of enums with @map and fixed a database parameter limit check (P2029) [1][6]. - Corrected a regression causing missing SQL Server VARCHAR casts [1][2]. - Fixed PostgreSQL introspection regarding sequence defaults [1][2]. - Included minor updates for the @prisma/adapter-d1 to handle savepoint operations as no-ops [1][2].
Citations:
- 1: https://github.com/prisma/prisma/releases/tag/7.8.0
- 2: https://newreleases.io/project/npm/prisma/release/7.8.0
- 3: https://npmx.dev/package-changelog/@prisma/client/v/7.8.0
- 4: https://www.change8.dev/package/prisma
- 5: https://cdn.jsdelivr.net/npm/@prisma/client@7.8.0/runtime/client.d.ts
- 6: https://www.gitclear.com/open_repos/prisma/prisma/release/7.8.0
- 7: https://github.com/prisma/prisma/blob/f36ad101/packages/client-generator-ts/src/runtime-targets.ts
- 8: https://cdn.jsdelivr.net/npm/@prisma/client@7.8.0/runtime/index-browser.d.ts
- 9: feat(client-generator-ts): set default "runtime" value based on std-env prisma/prisma#27960
🏁 Script executed:
#!/usr/bin/env sh
set -euo pipefail
echo "Server package declarations:"
jq '{
devDependencies: { prisma: (.devDependencies.prisma // null) },
dependencies: { prismaClient: (.dependencies["`@prisma/client`"] // null), adapterPg: (.dependencies["`@prisma/adapter-pg`"] // null) }
}' apps/supercode-cli/server/package.json
echo
echo "Generated Prisma client metadata, if present:"
if [ -f apps/supercode-cli/server/node_modules/.prisma/client/edge.js ]; then
echo "edge.js exists"
wc -l apps/supercode-cli/server/node_modules/.prisma/client/edge.js
elif [ -f apps/supercode-cli/server/node_modules/.prisma/client/index.js ]; then
echo "index.js exists"
wc -l apps/supercode-cli/server/node_modules/.prisma/client/index.js
else
echo "no .prisma/client binaries under server"
fi
if [ -d apps/supercode-cli/server/node_modules/prisma/client ]; then
echo
echo "Installed prisma package version:"
node -e 'const fs = require("fs"); const p=JSON.parse(fs.readFileSync("apps/supercode-cli/server/node_modules/prisma/package.json","utf8")); console.log(p.version)'
fi
if [ -d apps/supercode-cli/server/node_modules/@prisma/client ]; then
echo
echo "Installed `@prisma/client` version:"
node -e 'const fs = require("fs"); const p=JSON.parse(fs.readFileSync("apps/supercode-cli/server/node_modules/@prisma/client/package.json","utf8")); console.log(p.version)'
fiRepository: yashdev9274/supercli
Length of output: 409
🏁 Script executed:
#!/bin/sh
set -euo pipefail
echo "apps/supercode-cli/server/package.json:"
cat -n apps/supercode-cli/server/package.json
echo
echo "Package manager config files:"
for f in bun.lock bun.lockb pnpm-lock.yaml package-lock.json yarn.lock; do
if [ -f "$f" ]; then
echo "--- $f ---"
wc -l "$f"
rg -n -C 1 '"(prisma|`@prisma/client`)"|prisma@|`@prisma/client`@' "$f" | head -200
fi
done
echo
echo "Top-level generated client locations:"
fd -HI '^(edge\.js|index\.js)$' node_modules/.prisma/client 2>/dev/null || trueRepository: yashdev9274/supercli
Length of output: 15566
Align the Prisma CLI version with the Prisma Client.
@prisma/client resolves to 7.8.0, but prisma resolves to 7.5.0. A db:generate + seed run will use the lower Prisma CLI if generated types were last produced by it; regenerate Prisma to 7.8.0 so the CLI, generated client, and seed path use the same client runtime.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/supercode-cli/server/prisma/seed.ts` around lines 165 - 172, The Prisma
CLI and generated client versions must be aligned at 7.8.0. Update the project’s
Prisma CLI dependency and regenerate the client so db:generate and the seed path
use the same 7.8.0 runtime as `@prisma/client`; leave the model seed entries
unchanged.
| // Tier-organized model lists | ||
| export const TIER_MODELS: Record<UserTier, ModelEntry[]> = { | ||
| "spark": [ | ||
| { value: SECTION_CLOUD, label: "Supercode Cloud", provider: "supercode", cost: "", desc: "" }, | ||
| ...CLOUD_MODELS, | ||
| { value: SECTION_BYOK, label: "Bring Your Own Key", provider: "supercode", cost: "", desc: "" }, | ||
| ...BYOK_MODELS, | ||
| ], | ||
| "spark-premium": [ | ||
| { value: SECTION_CLOUD, label: "Supercode Cloud", provider: "supercode", cost: "", desc: "" }, | ||
| ...CLOUD_MODELS, | ||
| { value: SECTION_BYOK, label: "Bring Your Own Key", provider: "supercode", cost: "", desc: "" }, | ||
| ...BYOK_MODELS, | ||
| ], | ||
| "pro": [ | ||
| { value: SECTION_CLOUD, label: "Supercode Cloud", provider: "supercode", cost: "", desc: "" }, | ||
| ...CLOUD_MODELS, | ||
| { value: SECTION_BYOK, label: "Bring Your Own Key", provider: "supercode", cost: "", desc: "" }, | ||
| ...BYOK_MODELS, | ||
| ], | ||
| "ultra": [ | ||
| { value: SECTION_CLOUD, label: "Supercode Cloud", provider: "supercode", cost: "", desc: "" }, | ||
| ...CLOUD_MODELS, | ||
| { value: SECTION_BYOK, label: "Bring Your Own Key", provider: "supercode", cost: "", desc: "" }, | ||
| ...BYOK_MODELS, | ||
| ], | ||
| "none": [ | ||
| { value: SECTION_CLOUD, label: "Supercode Cloud", provider: "supercode", cost: "", desc: "" }, | ||
| ...CLOUD_MODELS, | ||
| { value: SECTION_BYOK, label: "Bring Your Own Key", provider: "supercode", cost: "", desc: "" }, | ||
| ...BYOK_MODELS, | ||
| ], | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
ast-grep outline apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts --items all
rg -nP --type ts -C 5 '\bpickModel\s*\(' apps/supercode-cli/server/src
rg -nP --type ts -C 5 '\bisModelAllowedForTier\s*\(' apps/supercode-cli/server/src
rg -nP --type ts -C 5 '\b(saveCliConfig|getCliConfig)\s*\(' apps/supercode-cli/server/srcRepository: yashdev9274/supercli
Length of output: 43057
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== model.ts outline =="
wc -l apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts
sed -n '1,140p' apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts
printf '\n== model.ts tier and TIER_MODELS ==\n'
sed -n '140,310p' apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts
printf '\n== model.ts ModelPicker and pickModel ==\n'
sed -n '540,755p' apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts
echo "== model access and plan gate =="
sed -n '1,180p' apps/supercode-cli/server/src/lib/model-access.ts
sed -n '1,120p' apps/supercode-cli/server/src/lib/plan-gate.ts
echo "== usages of model selector and pickModel =="
rg -n --type ts 'pickModel\(|providerMeta\[[0-9a-z"]+\]|MIN_TIER|minTier|spark|h3|minimax-m3|model-access|plan-gate|getCurrentUser|isModelAllowedForTier' apps/supercode-cli/server/srcRepository: yashdev9274/supercli
Length of output: 42298
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== migration / seed / model data files =="
git ls-files 'apps/supercode-cli/server/**' | rg '(migrations|seed|prisma|data|supercode|model|minimax|hy3|tier)' | head -200
echo "== target model names in data/migrations =="
rg -n --hidden --glob '!.git/**' 'minimax-m3|h3|hy3|minTier|spark|seed' apps/supercode-cli/server -g '*.ts' -g '*.json' -g '*.prisma' -g '*.sql' | head -300Repository: yashdev9274/supercli
Length of output: 26665
Do not expose Spark-gated cloud models to the none tier.
getUserTier() returns "none" when authentication or an active subscription is unavailable, but TIER_MODELS["none"] still includes every CLOUD_MODELS item. pickModel() then renders and can select from those entries without calling isModelAllowedForTier. Since hy3 and minimax-m3 are Spark tier-gated in the Model seed, omit gated cloud models from the "none" catalog, show an upgrade path, and keep entitlement enforcement at the execution boundary.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/supercode-cli/server/src/cli/commands/slashCommands/model.ts` around
lines 249 - 281, Update the "none" entry in TIER_MODELS so it excludes
Spark-gated cloud models such as hy3 and minimax-m3 instead of spreading all
CLOUD_MODELS. Preserve accessible cloud models and BYOK entries, add the
existing upgrade-path presentation for unavailable cloud access, and retain
isModelAllowedForTier enforcement at execution time.
| const normalized = modelSlug.trim().toLowerCase() | ||
| const model = models.find((m) => { | ||
| const slug = m.slug.toLowerCase() | ||
| return ( | ||
| slug === normalized || | ||
| normalized === slug || | ||
| normalized.endsWith(`/${slug}`) || | ||
| normalized.includes(slug) || | ||
| slug.includes(normalized) | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
ast-grep outline apps/supercode-cli/server/src/lib/model-access.ts --items all
rg -nP --type ts -C 4 '\bisModelAllowedForTier\s*\(' apps/supercode-cli/server/srcRepository: yashdev9274/supercli
Length of output: 2279
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- model-access.ts ---'
cat -n apps/supercode-cli/server/src/lib/model-access.ts | sed -n '1,90p'
printf '%s\n' '--- plan-gate.ts relevant section ---'
cat -n apps/supercode-cli/server/src/lib/plan-gate.ts | sed -n '1,90p'
printf '%s\n' '--- occurrences of isModelAllowedForTier results usages ---'
rg -nP --type ts -C 3 'isModelAllowedForTier|modelAllowed|allowed' apps/supercode-cli/server/src
printf '%s\n' '--- behavior probe for current matching rules ---'
python3 - <<'PY'
models = [
{"slug": "deepseek-v4-flash"},
{"slug": "openai-gpt-4"},
{"slug": "spark-premium"},
]
test_cases = [
"deepseek-v4-flash-preview",
"spark-premium-extra",
"gpt-4",
"openai",
" openai-gpt-4 ",
" openai-gpt-4 /spark-premium ",
]
for modelSlug in test_cases:
normalized = modelSlug.strip().lower()
found = []
for m in models:
slug = m["slug"].lower()
matches = (
slug == normalized or
normalized == slug or # same as first
normalized.endswith(f"/{slug}") or
normalized.find(slug) != -1 or
slug.find(normalized) != -1
)
if matches:
found.append(m["slug"])
print(f"{modelSlug!r} -> {found}")
PYRepository: yashdev9274/supercli
Length of output: 35872
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- index.ts model handling relevant section ---'
cat -n apps/supercode-cli/server/src/index.ts | sed -n '55,90p'
cat -n apps/supercode-cli/server/src/index.ts | sed -n '320,345p'
printf '%s\n' '--- chat gate handling relevant sections ---'
cat -n apps/supercode-cli/server/src/cli/ai/chat/chat.ts | sed -n '2168,2195p'
cat -n apps/supercode-cli/server/src/cli/ai/chat/chat.ts | sed -n '2272,2298p'
cat -n apps/supercode-cli/server/src/cli/ai/chat/chat.ts | sed -n '2354,2375p'
printf '%s\n' '--- AI provider/model name handling relevant sections ---'
fd -a 'provider.ts' apps/supercode-cli/server/src/cli/ai | while read -r f; do
printf '\n=== %s ===\n' "$f"
cat -n "$f" | sed -n '1,120p'
done
printf '%s\n' '--- request-counter and credit-meter model usage ---'
cat -n apps/supercode-cli/server/src/lib/request-counter.ts | sed -n '1,90p'
cat -n apps/supercode-cli/server/src/lib/credit-meter.ts | sed -n '1,120p'
printf '%s\n' '--- deterministic probe of current matcher against catalog-like slugs ---'
python3 - <<'PY'
catalog = ["deepseek-v4-flash", "openai-gpt-4", "spark-premium", "claude-sonnet-4"]
cases = [
("deepseek-v4-flash-preview", False),
("openai-gpt-5", False),
("gpt-4", True),
("claude-sonnet", True),
("my/deepseek-v4-flash-preview", False),
("/ deepseek-v4-flash-preview", False),
]
for input_name, expected_partial in cases:
normalized = input_name.strip().lower()
hits = [m for m in catalog if (normalized == m or normalized.endswith(f"/{m}") or normalized.find(m) != -1 or m.find(normalized) != -1)]
print(f"{input_name!r} -> hits={hits}, has_expected_partial={any(h in normalized or normalized.startswith(h) for h in hits)}")
PYRepository: yashdev9274/supercli
Length of output: 19507
Restrict isModelAllowedForTier to canonical model slugs.
Current substring matching lets names that do not appear in the Model table access downstream provider/credit paths as known models. For example, deepseek-v4-flash-preview can match the catalog slug deepseek-v4-flash.
Allow only exact normalized slugs and explicit provider-qualified suffixes such as concentrateai/deepseek-v4-flash; register aliases when alternative spellings are required.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/supercode-cli/server/src/lib/model-access.ts` around lines 38 - 47,
Update the model lookup in isModelAllowedForTier to remove broad substring
matching via normalized.includes(slug) and slug.includes(normalized). Permit
only exact normalized slug matches or explicit provider-qualified values ending
with /${slug}; add registered aliases in the Model table or alias configuration
for any required alternative spellings.
| if (tierIndex(userTier) < tierIndex("spark-premium")) { | ||
| return "To access more open models and higher limits, run /upgrade (Spark Premium)" | ||
| } | ||
| if (tierIndex(userTier) < tierIndex("pro")) { | ||
| return "To access premium models, run /upgrade" | ||
| return "To access premium models (Claude, GPT, etc.), run /upgrade" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the Spark Premium benefit text.
Spark Premium uses the same open-model catalog as Spark. The message at Line 59 incorrectly promises “more open models.” Describe higher limits and credits instead.
Proposed fix
- return "To access more open models and higher limits, run /upgrade (Spark Premium)"
+ return "To access the paid open-model tier with higher limits and credits, run /upgrade (Spark Premium)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (tierIndex(userTier) < tierIndex("spark-premium")) { | |
| return "To access more open models and higher limits, run /upgrade (Spark Premium)" | |
| } | |
| if (tierIndex(userTier) < tierIndex("pro")) { | |
| return "To access premium models, run /upgrade" | |
| return "To access premium models (Claude, GPT, etc.), run /upgrade" | |
| if (tierIndex(userTier) < tierIndex("spark-premium")) { | |
| return "To access the paid open-model tier with higher limits and credits, run /upgrade (Spark Premium)" | |
| } | |
| if (tierIndex(userTier) < tierIndex("pro")) { | |
| return "To access premium models (Claude, GPT, etc.), run /upgrade" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/supercode-cli/server/src/lib/model-access.ts` around lines 58 - 62,
Update the Spark Premium message in the user-tier checks around tierIndex so it
no longer claims access to more open models; describe the correct benefits as
higher limits and credits while preserving the existing upgrade instruction and
Pro-tier message.
Description
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
bun testpassesbun run typecheckpassesbun run lintpasses (if applicable)Checklist:
Summary by CodeRabbit
New Features
Bug Fixes