fix(env): flag combinations for sandboxes - #6308
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Function block UI keeps the language field always visible and serialized; only Shell and the custom sandbox selector stay gated on sandbox readiness. Workflow serialization no longer drops subblocks that are hidden only by presentation env gates, so saved Docs clarify that import-free JavaScript still runs in the local isolated VM without a remote provider; Python/Shell and remote paths fail explicitly instead of being reinterpreted as JavaScript. Reviewed by Cursor Bugbot for commit 8ebf68f. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8ebf68f. Configure here.
Greptile SummaryThis PR separates custom-Sandbox entitlement from remote-provider readiness while preserving Function language values across environment changes.
Confidence Score: 5/5The PR appears safe to merge because the changed flag combinations preserve local JavaScript execution while consistently requiring both entitlement and provider readiness for custom Sandboxes. The access resolver, workspace gate, Function configuration, serializer behavior, and tests align around the documented distinction between stable saved language values and remote-runtime availability, with no concrete blocking failure remaining.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/core/config/env-flags.ts | Separates Sandbox deployment entitlement from provider readiness and combines them into a complete availability flag. |
| apps/sim/lib/core/config/enterprise-entitlements.ts | Changes the legacy Sandbox default to fail closed and adds a pure resolver for supported billing, entitlement, and provider combinations. |
| apps/sim/lib/billing/core/subscription.ts | Requires deployment availability before applying an explicit override or workspace subscription check. |
| apps/sim/blocks/blocks/function.ts | Keeps the language field visible, always offers JavaScript and Python, and limits Shell to deployments with a ready remote runtime. |
| apps/sim/serializer/index.ts | Treats environment gates as presentation controls so hidden execution parameters remain serialized. |
| apps/sim/serializer/tests/serializer.extended.test.ts | Verifies that environment visibility changes do not erase a saved Function language. |
| apps/sim/app/api/function/execute/route.test.ts | Verifies that import-free JavaScript still uses the local isolated VM without a remote provider. |
| packages/testing/src/mocks/env-flags.mock.ts | Adds the deployment-entitlement mock and updates defaults to reflect fail-closed Sandbox availability. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Billing[Billing enabled?]
Entitlement[Enterprise or Sandbox deployment entitlement]
Provider[Remote Function provider ready]
Available[Deployment Sandbox feature available]
Plan[Workspace has Max or Enterprise access]
Granted[Custom Sandbox access granted]
Denied[Access denied]
Billing --> Available
Entitlement --> Available
Provider --> Available
Available -->|No| Denied
Available -->|Yes| Billing
Billing -->|No, entitlement present| Granted
Billing -->|Yes, explicit override| Granted
Billing -->|Yes, no override| Plan
Plan -->|Yes| Granted
Plan -->|No| Denied
Reviews (1): Last reviewed commit: "more changes" | Re-trigger Greptile

Summary
Flag combinations for sandboxes to work in pattern with other enteprise features.
Type of Change
Testing
Tested manually
Checklist