Conversation
Unblock Sonnet 4.6 for paid users in agent mode so it can be selected alongside Kimi K2.5, Gemini 3 Flash, and Grok 4.1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an auth guard for switching to agent mode, permits Claude Sonnet 4.6 in agent selections and tests, introduces a cancel-subscription confirmation dialog, and adds retry-capable curl/wget invocations plus a JS-level retry/backoff loop for sandbox downloads. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…trifugoSandbox Add curl --retry-all-errors and a JS-level retry loop covering exit code 35 (TLS handshake/read errors like S3 "unexpected eof"), mirroring the E2B path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.ts`:
- Around line 409-411: The test currently asserts a generic "--retry" substring
on the generated command (variable cmd), which can yield false positives; update
the assertions to check for each explicit retry flag instead. Replace the loose
expect(cmd).toContain("--retry") with four explicit assertions that cmd contains
"--retry 3", "--retry-all-errors", "--retry-delay 1", and "--retry-connrefused"
(keep the existing expects for "curl -fsSL" and the output path), so the test
fails if any specific retry flag is missing or changed.
In `@lib/ai/tools/utils/centrifugo-sandbox.ts`:
- Around line 742-743: The curl command template unconditionally includes
--retry-all-errors and --retry-connrefused which can cause curl to exit with
code 48 on older builds and bypass the TRANSIENT_EXIT_CODES retry logic; update
the code that builds the curl command (the line that chooses between the curl
and wget templates using escapedPath/escapedUrl) to first detect curl
capabilities once at initialization (e.g., run `curl --version` or `curl --help`
in an init helper) and then conditionally append only supported flags, or
alternatively fall back to a safer minimal set when unsupported; ensure the
TRANSIENT_EXIT_CODES constant/array is unchanged but that the constructed curl
command only uses flags compatible with the detected curl version so failures
remain transient and retriable by the existing retry loop.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5e5f55fa-8b0b-4342-976f-3d689ad7f158
📒 Files selected for processing (2)
lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.tslib/ai/tools/utils/centrifugo-sandbox.ts
Replaces direct redirect to Stripe billing portal with a confirmation dialog that shows users what features they'll lose before cancelling, giving them a chance to reconsider. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…try-connrefused These flags require curl >=7.71 and >=7.52 respectively. Older curl builds fail with exit 48 on unknown options, which would not be retried. Detect support via `curl --help all` once per sandbox and only emit supported flags. Also tighten the windows-bash test to assert each retry flag explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
lib/ai/tools/utils/centrifugo-sandbox.ts (1)
786-816: Consider documenting the layered retry behavior.The JS-level retry loop is correctly implemented (initial call + up to 2 retries = 3 total attempts). However, note that this creates layered retries:
- curl's internal retries:
--retry 3handles HTTP 5xx, 408, connection refused, etc.- JS-level retries: Handles transient exit codes (7, 18, 23, 28, 35, 56, 92) after curl exhausts its retries
In worst-case scenarios (e.g., intermittent network issues), this could result in up to 9 curl requests (3 JS attempts × 3 curl retries each). This is likely acceptable for download reliability, but consider adding a brief comment noting this intentional layering for future maintainers.
Suggested documentation
const command = `${mkdirPart} ${downloadPart}`; // JS-level retry safety net on top of curl's --retry, for transient // network/TLS errors that can survive curl's own retry loop: + // Note: Combined with curl's --retry 3, worst case is 9 total requests. // 7 = couldn't connect🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/ai/tools/utils/centrifugo-sandbox.ts` around lines 786 - 816, Add a short clarifying comment above the retry logic explaining the intentional layered retry behavior: that curl is invoked with its own --retry (e.g., 3) and the JS-level loop using TRANSIENT_EXIT_CODES and MAX_ATTEMPTS performs an initial run plus retries via this.commands.run (potentially causing up to MAX_ATTEMPTS × curlRetries requests), and note that this is intentional for reliability; reference the TRANSIENT_EXIT_CODES set, MAX_ATTEMPTS constant, and the this.commands.run(command, ...) calls so maintainers understand why both retry layers exist and the worst-case request count.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/components/CancelSubscriptionDialog.tsx`:
- Around line 30-57: Both getFeaturesForTier and getPlanDisplayName currently
fall through to "pro" for unknown tiers, which incorrectly maps a "free"
SubscriptionTier to Pro; add an explicit case "free" in getFeaturesForTier to
return either an empty array or the existing freeFeatures constant (if present)
and add a case "free" in getPlanDisplayName to return "Free" so the UI shows the
correct name and features for free-tier users; update both switch statements
(functions getFeaturesForTier and getPlanDisplayName) to include the "free"
branch.
- Around line 67-82: The handleGoToBillingPortal function leaves isProcessing
true when redirectToBillingPortalAction resolves to a falsy URL; update
handleGoToBillingPortal (which calls redirectToBillingPortalAction and uses
setIsProcessing) so that setIsProcessing(false) is always called when no
redirect occurs (e.g., check if url is falsy and call setIsProcessing(false)
before returning, or move setIsProcessing(false) into a finally block) to ensure
UI actions are re-enabled.
---
Nitpick comments:
In `@lib/ai/tools/utils/centrifugo-sandbox.ts`:
- Around line 786-816: Add a short clarifying comment above the retry logic
explaining the intentional layered retry behavior: that curl is invoked with its
own --retry (e.g., 3) and the JS-level loop using TRANSIENT_EXIT_CODES and
MAX_ATTEMPTS performs an initial run plus retries via this.commands.run
(potentially causing up to MAX_ATTEMPTS × curlRetries requests), and note that
this is intentional for reliability; reference the TRANSIENT_EXIT_CODES set,
MAX_ATTEMPTS constant, and the this.commands.run(command, ...) calls so
maintainers understand why both retry layers exist and the worst-case request
count.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: a1cb8dc8-34d1-439c-b70c-dc0f5ac063c7
📒 Files selected for processing (4)
app/components/AccountTab.tsxapp/components/CancelSubscriptionDialog.tsxlib/ai/tools/utils/__tests__/centrifugo-sandbox.test.tslib/ai/tools/utils/centrifugo-sandbox.ts
…l URL Add explicit "free" cases to tier label/feature mappers so a free user isn't mislabeled as Pro. Move setIsProcessing(false) to a finally block and surface a toast when the action returns a falsy URL, so both buttons don't stay permanently disabled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary by CodeRabbit
New Features
Reliability
Tests