Skip to content

Commit fddbf7a

Browse files
committed
improvement(config): simplify the registry and registration seams; retire the sandbox readiness marker
1 parent 126801d commit fddbf7a

31 files changed

Lines changed: 194 additions & 271 deletions

File tree

‎apps/docs/content/docs/platform/enterprise/self-hosted.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Each feature is one server variable. Permission groups also turn on organization
259259

260260
A Sandbox entitlement also requires a remote execution provider with credentials and an immutable Function base image. Until the server verifies readiness, the Function block offers no **Shell** language, and **Settings → Sandboxes** shows an upgrade notice instead of a sandbox list.
261261

262-
The Function block's **Sandbox** selector appears once the server confirms both the entitlement and a ready provider. `NEXT_PUBLIC_SANDBOXES_ENABLED` is only a readiness marker that `bunx sim-setup doctor` compares with the provider; the app does not read it.
262+
The Function block's **Sandbox** selector appears once the server confirms both the entitlement and a ready provider. There is no browser variable to set.
263263

264264
JavaScript without `import`, `require`, a selected sandbox, or a sandbox file-path reference runs in local Node child workers in the app container when Sandbox flags are off. Python, Shell, JavaScript with external imports, and selected custom Sandboxes require the remote Function base and fail with a configuration error until it is ready. See [Sandboxes](/platform/self-hosting/sandboxes).
265265

‎apps/docs/content/docs/platform/self-hosting/environment-variables.mdx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ Who may sign up and sign in — the allowlists, blocklists, `REGISTRATION_MODE`,
188188
| `DAYTONA_FUNCTION_SNAPSHOT_ID` | Immutable snapshot **ID** (not a name) for the Function base image. Required for Daytona |
189189
| `E2B_PI_TEMPLATE_ID` / `DAYTONA_PI_SNAPSHOT_ID` | The image Pi runs on. Separate from the Function base — configuring the provider and Function image alone leaves Pi failing closed |
190190
| `SANDBOXES_ENABLED` | Enable custom sandbox entitlement through deployment configuration where supported; see the [enterprise guide](/platform/enterprise/self-hosted) for billing-mode requirements. Not sufficient on its own — a provider key **and** an immutable Function base must also be configured. The Function block's Sandbox selector appears once the server confirms both |
191-
| `NEXT_PUBLIC_SANDBOXES_ENABLED` | Readiness marker only; the app does not read it. On a Compose install or source checkout `bunx sim-setup doctor` compares it with the selected provider's readiness |
192191
| `IVM_MAX_EXECUTIONS_PER_WORKER` | Executions before an isolated-vm worker is recycled |
193192
| `IVM_MAX_BROKERS_PER_EXECUTION` | Host-call brokers per execution |
194193
| `IVM_MAX_BROKER_ARGS_JSON_CHARS` | Max argument payload size |

‎apps/docs/content/docs/platform/self-hosting/sandboxes.mdx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,9 @@ DAYTONA_FUNCTION_SNAPSHOT_ID=<snapshot-uuid>
111111
| Variable | Effect |
112112
|---|---|
113113
| `SANDBOXES_ENABLED=true` | Grants the server-side sandbox entitlement on a billing-disabled self-hosted deployment |
114-
| `NEXT_PUBLIC_SANDBOXES_ENABLED=true` | Readiness marker for `bunx sim-setup doctor`; the app does not read it |
115114

116115
On a billing-disabled deployment, `ENTERPRISE_ENABLED=true` also grants the entitlement when `SANDBOXES_ENABLED` is unset. The server must verify provider credentials and the immutable Function base before offering Shell, the Function block's **Sandbox** selector, and the sandbox list. **Settings → Sandboxes** remains in the sidebar but shows an upgrade notice until access/readiness resolves. Python remains selectable; execution still requires the remote configuration.
117116

118-
On Compose or a source checkout, `bunx sim-setup doctor` compares the readiness marker with selected-provider readiness.
119-
120117
## Promote or roll back a build
121118

122119
Use the accepted E2B manifest as the release baseline. Verify the exact E2B build and any Daytona reconstruction before updating the deployment variables above.

‎apps/docs/content/docs/platform/self-hosting/security.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,13 @@ continues to run in the local isolate when no remote provider is configured.
197197
Without valid provider credentials and the required Function image, code that needs a remote sandbox fails with a configuration error. Verify readiness before enabling its browser controls.
198198
</Callout>
199199

200-
Two browser-side variables relate to sandbox readiness; neither is derived automatically:
200+
The Function block's Sandbox selector, Shell, and **Settings → Sandboxes** follow the server's own readiness check; no browser variable is involved. One browser-side variable relates to sandbox readiness and is not derived automatically:
201201

202202
| Variable | Effect when unset |
203203
|---|---|
204-
| `NEXT_PUBLIC_SANDBOXES_ENABLED` | Nothing in the app: the Function block's Sandbox selector, Shell, and **Settings → Sandboxes** all follow the server's own readiness check. `sim-setup doctor` reports it as a mismatch against provider readiness. Python stays selectable; whether it runs depends on the server-side provider and Function image |
205204
| `NEXT_PUBLIC_E2B_ENABLED` | The E2B-backed Pi block modes stay hidden; `sim-setup doctor` reports it as a mismatch against `E2B_ENABLED`. Revealing them is not enough to make them run — Pi executes on its own image, pinned with `E2B_PI_TEMPLATE_ID` or `DAYTONA_PI_SNAPSHOT_ID`, and fails closed without it |
206205

207-
Set the public values only **after** the server-side configuration above is complete — they are assertions about readiness, not switches, and the server-side check has its own conditions beyond them. See [Sandboxes](/platform/self-hosting/sandboxes) for the base-image build and promotion procedure. `bunx sim-setup doctor` reports a mismatch in either direction.
206+
Set it only **after** the server-side configuration above is complete — it is an assertion about readiness, not a switch, and the server-side check has its own conditions beyond it. See [Sandboxes](/platform/self-hosting/sandboxes) for the base-image build and promotion procedure. `bunx sim-setup doctor` reports a mismatch in either direction.
208207

209208
<Callout type="warn">
210209
With the default local sandbox, treat everyone who can author a workflow as someone running code in your app container's security context. If your Sim instance is open to a wide or partly-trusted audience, use a remote sandbox provider and enable the NetworkPolicy egress restrictions.

‎apps/docs/scripts/fixtures/content-baseline.json‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173236,21 +173236,21 @@
173236173236
"meta": null,
173237173237
"sha256": "8212e97007004681330f0d78618939abbc4d7a29283580552542a576245c0826",
173238173238
"bytes": 79,
173239-
"line": 296
173239+
"line": 295
173240173240
},
173241173241
{
173242173242
"lang": "bash",
173243173243
"meta": null,
173244173244
"sha256": "0e794f3491fc1402990b65869622ebe68febe19c0331544891e8eeb01e8249f3",
173245173245
"bytes": 129,
173246-
"line": 307
173246+
"line": 306
173247173247
},
173248173248
{
173249173249
"lang": "text",
173250173250
"meta": null,
173251173251
"sha256": "a45ddc97179f78324455bd2d0f25917282f721b3962c68e7455d9917e32379f5",
173252173252
"bytes": 852,
173253-
"line": 330
173253+
"line": 329
173254173254
}
173255173255
],
173256173256
"links": [
@@ -175407,7 +175407,7 @@
175407175407
"meta": null,
175408175408
"sha256": "0407e2ff602d613878e4df847ab42b4785deaf55451bcdb56ae672edfb44fb22",
175409175409
"bytes": 135,
175410-
"line": 132
175410+
"line": 129
175411175411
}
175412175412
],
175413175413
"links": [
@@ -175782,35 +175782,35 @@
175782175782
"meta": null,
175783175783
"sha256": "4fd1ce391cf85e5093c6348b4d57dac12c1302939037c308314bd8e12c260b38",
175784175784
"bytes": 117,
175785-
"line": 244
175785+
"line": 243
175786175786
},
175787175787
{
175788175788
"lang": "bash",
175789175789
"meta": null,
175790175790
"sha256": "68d150e3ac8a0f2ab0a0a8e7b7f000dd0b4eeb533f074057fc3f0272e314b060",
175791175791
"bytes": 41,
175792-
"line": 262
175792+
"line": 261
175793175793
},
175794175794
{
175795175795
"lang": "yaml",
175796175796
"meta": null,
175797175797
"sha256": "97a9e97bd237a84b46a8dd55ddde2685442b763d4b00279d9b4d6db05883cfae",
175798175798
"bytes": 110,
175799-
"line": 296
175799+
"line": 295
175800175800
},
175801175801
{
175802175802
"lang": "yaml",
175803175803
"meta": null,
175804175804
"sha256": "dd2274ef28334de3fd41b204f57e8af3c3fba12c3af4457c44234c72da35b56c",
175805175805
"bytes": 551,
175806-
"line": 309
175806+
"line": 308
175807175807
},
175808175808
{
175809175809
"lang": "yaml",
175810175810
"meta": null,
175811175811
"sha256": "a6efcc859a8531bfec1e7434aded7fbbacd567afe8875f4bdee025f428f267d2",
175812175812
"bytes": 137,
175813-
"line": 353
175813+
"line": 352
175814175814
}
175815175815
],
175816175816
"links": [

‎apps/sim/.env.example‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
4040
# Copilot/Mothership code tools use a separate shell image. It is selected only
4141
# for those code-tool calls and is never a fallback for Function blocks.
4242
# SANDBOXES_ENABLED=true # Enables custom sandboxes for self-hosted workspaces
43-
# NEXT_PUBLIC_SANDBOXES_ENABLED=true # Readiness marker `sim-setup doctor` checks; the app verifies the provider itself
4443
#
4544
# E2B (default provider)
4645
# After exporting E2B_API_KEY, build with: bun run apps/sim/scripts/build-function-e2b-template.ts

‎apps/sim/app/(auth)/login/login-form.tsx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,17 @@ export default function LoginPage({
348348
}
349349

350350
const ssoEnabled = isSsoEnabled
351-
const emailEnabled = emailPasswordEnabled
352351
const hasSocial = githubAvailable || googleAvailable || microsoftAvailable
353-
const hasOnlySSO = ssoEnabled && !emailEnabled && !hasSocial
352+
const hasOnlySSO = ssoEnabled && !emailPasswordEnabled && !hasSocial
354353
const showTopSSO = hasOnlySSO
355354
const showBottomSection = hasSocial || (ssoEnabled && !hasOnlySSO)
356-
const showDivider = (emailEnabled || showTopSSO) && showBottomSection
355+
const showDivider = (emailPasswordEnabled || showTopSSO) && showBottomSection
357356

358357
const emailFieldErrors = showEmailValidationError && emailErrors.length > 0 ? emailErrors : []
359358
const passwordFieldErrors = showValidationError && passwordErrors.length > 0 ? passwordErrors : []
360359
const canSubmit = email.trim().length > 0 && password.length > 0
361360

362-
if (!emailEnabled && !ssoEnabled && !hasSocial)
361+
if (!emailPasswordEnabled && !ssoEnabled && !hasSocial)
363362
return (
364363
<AuthHeader
365364
title='Sign-in is unavailable'
@@ -427,7 +426,7 @@ export default function LoginPage({
427426
<SSOLoginButton callbackURL={callbackUrl} variant='primary' disabled={isLoading} />
428427
)}
429428

430-
{emailEnabled && (
429+
{emailPasswordEnabled && (
431430
<form onSubmit={onSubmit} className='au:space-y-[var(--auth-group-gap)]'>
432431
<div className='au:space-y-5'>
433432
<AuthField htmlFor='email' label='Email' errors={emailFieldErrors}>

‎apps/sim/app/(auth)/signup/signup-form.tsx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,10 @@ function SignupFormContent({
388388
}
389389

390390
const ssoEnabled = isSsoEnabled
391-
const emailEnabled = emailSignupEnabled
392391
const hasSocial = githubAvailable || googleAvailable || microsoftAvailable
393-
const hasOnlySSO = ssoEnabled && !emailEnabled && !hasSocial
392+
const hasOnlySSO = ssoEnabled && !emailSignupEnabled && !hasSocial
394393
const showBottomSection = hasSocial || (ssoEnabled && !hasOnlySSO)
395-
const showDivider = (emailEnabled || hasOnlySSO) && showBottomSection
394+
const showDivider = (emailSignupEnabled || hasOnlySSO) && showBottomSection
396395

397396
const nameFieldErrors = showNameValidationError && nameErrors.length > 0 ? nameErrors : []
398397
const emailHasError = Boolean(emailError) || (showEmailValidationError && emailErrors.length > 0)
@@ -409,7 +408,7 @@ function SignupFormContent({
409408
<div className='au:space-y-[var(--auth-group-gap)]'>
410409
<AuthHeader title='Create an account' description='Get started with Sim.' />
411410

412-
{!emailEnabled && !hasSocial && !ssoEnabled && (
411+
{!emailSignupEnabled && !hasSocial && !ssoEnabled && (
413412
<AuthFormMessage type='error'>
414413
No sign-in methods are enabled. Contact your administrator for access.
415414
</AuthFormMessage>
@@ -419,7 +418,7 @@ function SignupFormContent({
419418
<SSOLoginButton callbackURL={redirectUrl || DEFAULT_POST_AUTH_ROUTE} variant='primary' />
420419
)}
421420

422-
{emailEnabled && (
421+
{emailSignupEnabled && (
423422
<form onSubmit={onSubmit} className='au:space-y-[var(--auth-group-gap)]'>
424423
<div className='au:space-y-5'>
425424
<AuthField htmlFor='name' label='Full name' errors={nameFieldErrors}>

‎apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { requestJson } from '@/lib/api/client/request'
2121
import { type AuthProviderStatusResponse, getAuthProvidersContract } from '@/lib/api/contracts/auth'
2222
import { type SocialSignInProvider, startSocialSignIn } from '@/lib/auth/social-sign-in'
2323
import { useDeploymentShape } from '@/lib/core/config/deployment-shape'
24-
import { isSsoEnabled } from '@/lib/core/config/env-flags'
2524
import { APP_ENTRY_PATH } from '@/lib/navigation/paths'
2625
import { captureClientEvent } from '@/lib/posthog/client'
2726
import type { PostHogEventMap } from '@/lib/posthog/events'
@@ -84,12 +83,13 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
8483
fetchProviderStatus().then(setProviderStatus)
8584
}, [])
8685

87-
const ssoEnabled = isSsoEnabled
86+
const shape = useDeploymentShape()
87+
const ssoEnabled = shape.features.sso
8888
const {
8989
selfServeRegistrationClosed: registrationDisabled,
9090
emailSignupAllowed,
9191
emailPasswordAuthEnabled,
92-
} = getRegistrationPolicy(useDeploymentShape().registrationMode ?? 'open')
92+
} = getRegistrationPolicy(shape.registrationMode ?? 'open')
9393

9494
/**
9595
* Signup is unavailable when registration is disabled, so the shown view is

‎apps/sim/app/api/providers/litellm/models/route.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ export const GET = withRouteHandler(async (_request: NextRequest) => {
3232
init: { next: { revalidate: 60 } },
3333
})
3434

35-
if (!allModels) {
36-
logger.warn('LiteLLM service is not available')
37-
return NextResponse.json({ models: [] })
38-
}
35+
if (!allModels) return NextResponse.json({ models: [] })
3936

4037
const models = filterBlacklistedModels(allModels)
4138

0 commit comments

Comments
 (0)