Skip to content

Daily/2026 04 14#367

Merged
rossmanko merged 6 commits intomainfrom
daily/2026-04-14
Apr 15, 2026
Merged

Daily/2026 04 14#367
rossmanko merged 6 commits intomainfrom
daily/2026-04-14

Conversation

@rossmanko
Copy link
Copy Markdown
Contributor

@rossmanko rossmanko commented Apr 14, 2026

Summary by CodeRabbit

  • New Features

    • Agent mode now requires authentication to switch.
    • Claude Sonnet 4.6 is available as an agent-mode model for eligible users.
    • Added a cancel-subscription confirmation dialog in account settings.
  • Reliability

    • File downloads now include automatic retries, backoff, and improved error handling.
  • Tests

    • Updated tests to reflect model selection changes and more flexible download command checks.

rossmanko and others added 2 commits April 14, 2026 09:08
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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 945578e3-ac4b-42f3-9ad8-ac1c2d9f42fa

📥 Commits

Reviewing files that changed from the base of the PR and between c5a07fc and 725891f.

📒 Files selected for processing (1)
  • app/components/CancelSubscriptionDialog.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/CancelSubscriptionDialog.tsx

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Auth Guard (Chat UI)
app/components/ChatInput/ChatModeSelector.tsx
Uses useAuth() and short-circuits handleAgentModeClick to navigateToAuth("/login") when unauthenticated, preventing further agent-mode checks/flows.
Model Options
app/components/ModelSelector/constants.ts
Added { id: "sonnet-4.6", label: "Claude Sonnet 4.6", censored: true } to AGENT_MODEL_OPTIONS.
Model Selection Logic
lib/chat/chat-processor.ts
Removed "sonnet-4.6" from BLOCKED_AGENT_MODELS (leaving only "opus-4.6" blocked), allowing Sonnet 4.6 in agent-mode selection results.
Model Selection Tests
lib/chat/__tests__/chat-processor.test.ts
Updated test expectation for ("agent","pro","sonnet-4.6") to return "model-sonnet-4.6"; adjusted surrounding description.
Centrifugo Sandbox Implementation
lib/ai/tools/utils/centrifugo-sandbox.ts
Expanded curl/wget flags based on detected capabilities and added a JS-level retry loop with transient-exit-code allowlist, console.warn/backoff, and up to 3 attempts.
Centrifugo Sandbox Tests (Windows git-bash)
lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.ts
Relaxed git-bash download assertions to check for separate curl flags/components and added sandbox.curlCaps in test setup to reflect retry-capable invocation.
Account UI: Cancel Subscription
app/components/AccountTab.tsx, app/components/CancelSubscriptionDialog.tsx
Added CancelSubscriptionDialog component and wiring: AccountTab opens a confirmation dialog; dialog computes plan/features, handles async redirectToBillingPortalAction, shows processing state and errors via toasts.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I nibbled code by lantern light,

Checked logins first before the flight.
Sonnet leapt the old locked gate,
Downloads try again — never late.
A rabbit hops, the changes right!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Daily/2026 04 14' is vague and generic, using a date-based naming convention without describing any meaningful changes in the changeset. Replace with a descriptive title summarizing the main change, such as 'Add Sonnet 4.6 model support for agents and improve download reliability' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch daily/2026-04-14

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hackerai Ready Ready Preview, Comment Apr 14, 2026 8:28pm

Request Review

…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>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between b7e7b91 and bd84399.

📒 Files selected for processing (2)
  • lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.ts
  • lib/ai/tools/utils/centrifugo-sandbox.ts

Comment thread lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.ts
Comment thread lib/ai/tools/utils/centrifugo-sandbox.ts Outdated
rossmanko and others added 2 commits April 14, 2026 16:06
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>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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:

  1. curl's internal retries: --retry 3 handles HTTP 5xx, 408, connection refused, etc.
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between bd84399 and c5a07fc.

📒 Files selected for processing (4)
  • app/components/AccountTab.tsx
  • app/components/CancelSubscriptionDialog.tsx
  • lib/ai/tools/utils/__tests__/centrifugo-sandbox.test.ts
  • lib/ai/tools/utils/centrifugo-sandbox.ts

Comment thread app/components/CancelSubscriptionDialog.tsx
Comment thread app/components/CancelSubscriptionDialog.tsx
…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>
@rossmanko rossmanko merged commit d6dba43 into main Apr 15, 2026
4 checks passed
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.

1 participant