Supercode cli - #296
Conversation
Authenticated Spark users were blocked with plan_limit_exceeded because signup never created free subscription rows. ensureSparkSubscription now runs on gate miss, fail-open stays Spark-tier, and desktop sidebar gains Clear session. Co-Authored-By: Warp <agent@warp.dev>
- Bumped version to 0.1.100 in package.json. - Removed deprecated GitHub, Linear, and Slack connection files. - Introduced a new script for granting Spark Premium subscriptions to users. - Refactored agent service and related files to streamline agent management and permissions. - Added new agent definitions and improved prompt handling for better integration.
|
Too many files changed for review (127 files, 100 file limit). Bypass the limit by tagging |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 127 files, which is 27 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (127)
You can disable this status message by setting the 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 |
| } | ||
| const reader = response.body?.getReader() | ||
| if (!reader) { res.status(500).json({ error: "No response body" }); return } | ||
| endChatStreamError(res, "No response body"); return |
| } | ||
| const reader = response.body?.getReader() | ||
| if (!reader) { res.status(500).json({ error: "No response body" }); return } | ||
| endChatStreamError(res, "No response body"); return |
There was a problem hiding this comment.
This lost the if (!reader) guard — the stream now unconditionally ends with "No response body" right after a successful upstream response, so streamOpenAICompatibleChat below is unreachable and every OpenRouter chat fails. Same issue in the nvidia, mergedev, and orcarouter branches.
| endChatStreamError(res, "No response body"); return | |
| if (!reader) { endChatStreamError(res, "No response body"); return } |
| } | ||
| const reader = response.body?.getReader() | ||
| if (!reader) { res.status(500).json({ error: "No response body" }); return } | ||
| endChatStreamError(res, "No response body"); return |
There was a problem hiding this comment.
Same as the OpenRouter branch — needs the if (!reader) guard back.
| endChatStreamError(res, "No response body"); return | |
| if (!reader) { endChatStreamError(res, "No response body"); return } |
| } | ||
| const reader = response.body?.getReader() | ||
| if (!reader) { res.status(500).json({ error: "No response body" }); return } | ||
| endChatStreamError(res, "No response body"); return |
There was a problem hiding this comment.
Same — needs the if (!reader) guard back.
| endChatStreamError(res, "No response body"); return | |
| if (!reader) { endChatStreamError(res, "No response body"); return } |
| } | ||
| const reader = response.body?.getReader() | ||
| if (!reader) { res.status(500).json({ error: "No response body" }); return } | ||
| endChatStreamError(res, "No response body"); return |
There was a problem hiding this comment.
Same — needs the if (!reader) guard back.
| endChatStreamError(res, "No response body"); return | |
| if (!reader) { endChatStreamError(res, "No response body"); return } |
| opts.onChunk?.(chunk.text) | ||
| } | ||
| }, | ||
| prepareStep: async () => { |
There was a problem hiding this comment.
Returning messages here replaces the prompt for the step, so a bare system notice throws away the entire conversation — the model is told to "analyze what you already know" with zero context. prepareStep receives the current step messages; append the notice to those instead (all three notice branches below need this).
| prepareStep: async () => { | |
| prepareStep: async ({ messages: stepMessages }) => { |
| if (isTransientInfraError(error)) { | ||
| return SPARK_GRANDFATHERED_FALLBACK | ||
| } | ||
| // Prefer access over hard lock for authenticated users. | ||
| return SPARK_GRANDFATHERED_FALLBACK |
There was a problem hiding this comment.
Both branches return the same fallback, so the isTransientInfraError check is dead code here.
| if (isTransientInfraError(error)) { | |
| return SPARK_GRANDFATHERED_FALLBACK | |
| } | |
| // Prefer access over hard lock for authenticated users. | |
| return SPARK_GRANDFATHERED_FALLBACK | |
| // Prefer access over hard lock for authenticated users. | |
| return SPARK_GRANDFATHERED_FALLBACK |
| setTimeout: timers.setTimeout, | ||
| clearTimeout: timers.clearTimeout, | ||
| setInterval: timers.setInterval, | ||
| clearInterval: timers.clearInterval, |
There was a problem hiding this comment.
Intervals registered here keep firing in the host process after runInContext returns (nothing outside can clear them), so a snippet can leak infinite timers long after the tool result is produced. Related: node:vm isn't a security boundary, so the "sandboxed environment" description oversells this a bit.
| setTimeout: timers.setTimeout, | |
| clearTimeout: timers.clearTimeout, | |
| setInterval: timers.setInterval, | |
| clearInterval: timers.clearInterval, | |
| setTimeout: timers.setTimeout, | |
| clearTimeout: timers.clearTimeout, |
| try { | ||
| const headers = await getAuthHeaders() | ||
| const res = await fetchWithTimeout(`${BASE_URL}/api/user/me`, { headers }) | ||
| const res = await fetchWithTimeout(`${baseUrl()}/api/user/me`, { headers }) |
There was a problem hiding this comment.
Indentation got flattened to column 0 here (a few other touched lines in this file and in server-proxy-service.ts, embedded-tool-calls.ts, openai-compatible-stream.ts, and chat.ts too). Worth a quick pass to restore the 2-space indent.
| const res = await fetchWithTimeout(`${baseUrl()}/api/user/me`, { headers }) | |
| const res = await fetchWithTimeout(`${baseUrl()}/api/user/me`, { headers }) |
|
|
||
| while (i < block.length) { | ||
| // Find the next opener (square, xml, bare invoke, bare JSON descriptor, or control token). | ||
| while (i < block.length) { |
There was a problem hiding this comment.
Same indentation flattening — this loop and a few of its inner statements lost their leading indent.
| while (i < block.length) { | |
| while (i < block.length) { |
| import "dotenv/config" | ||
| import { PrismaPg } from "@prisma/adapter-pg" |
There was a problem hiding this comment.
Bun auto-loads .env per the repo guidelines (see AGENTS.md), so the dotenv import is redundant here.
| import "dotenv/config" | |
| import { PrismaPg } from "@prisma/adapter-pg" | |
| import { PrismaPg } from "@prisma/adapter-pg" |
Description
Please include a summary of the change and which issue is fixed.
Fixes #(issue)
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: