Skip to content

improvement(config): derive enterprise flags from one registry, add REGISTRATION_MODE, merge vLLM and LiteLLM - #10271

Merged
waleedlatif1 merged 8 commits into
stagingfrom
improvement/deployment-config-cleanup
Nov 21, 2026
Merged

waleedlatif1 merged 8 commits into
stagingfrom
improvement/deployment-config-cleanup

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Enterprise flags from one registry:
    • New @sim/deployment-config/enterprise-features holds every enterprise feature in one list. The server flags, the deployment shape sent to the browser, the API schema, the test mocks and the sim-setup unlocks all derive from it, so a feature can no longer drift between them.
    • Behavior parity with the old enterprise-entitlements.ts was checked across every flag combination.
    • The legacy-defaults table is gone. Inbox and session policies stay on by default for billing-free self-hosted deployments, now as documented product defaults.
  • Enterprise browser twins removed:
    • The 13 NEXT_PUBLIC_* enterprise twins are gone. The browser reads features from a server-rendered <html data-deployment-shape> attribute, so one server variable controls both the API and the UI.
    • The shape is public by design. A test asserts it only holds booleans and known enums.
  • Fixes along the way:
    • The function-block sandbox picker now follows deployment entitlement, matching the Shell language gate.
    • INBOX_ENABLED=false now actually turns the inbox off on billing-free deployments; before, it hid the UI while the API stayed open.
    • Setting only ENTERPRISE_ENABLED now shows SSO in the browser.
  • One signup setting, REGISTRATION_MODE:
    • It replaces DISABLE_REGISTRATION, DISABLE_EMAIL_SIGNUP, EMAIL_PASSWORD_SIGNUP_ENABLED and its NEXT_PUBLIC_ twin. Values: open (default), no-email-signup, closed, no-email, closed-no-email.
    • The old variables still work with a deprecation warning. When old and new are both set, the most restrictive wins on each axis.
    • An unknown value fails closed: registration closes, logins keep working.
    • The browser-only NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED=false now also turns off server-side email sign-in, as documented.
  • vLLM and LiteLLM on one implementation:
    • Both providers now run on a shared providers/openai-compat/self-hosted.ts core with per-provider config. Provider ids, model prefixes and env vars are unchanged.
    • LiteLLM picks up vLLM's base-URL normalization, which fixes .../v1 becoming /v1/v1.
    • LiteLLM also records conversation usage on capped turns and uses the client cache.

Type of Change

  • Improvement / refactor

Testing

  • Parity script, old vs new enterprise resolution: 14,112 combinations, 0 mismatches.
  • REGISTRATION_MODE resolver: failure-mode tests (unknown value, each legacy var, conflicts, case/whitespace). Each is revert-proven.
  • vLLM/LiteLLM characterization tests pass unchanged (36), plus 2 new LiteLLM tests that fail on the old behavior.
  • Targeted vitest across config, auth, billing, subblocks, providers and sim-setup. type-check is clean.
  • Audits: check:client-boundary, check:boundaries, check:api-validation:strict, check:deployment-config, check:docs-manifest, check:test-patterns, check:unused-exports, check-explicit-any, and docs --verify-compatibility.
  • Full gate runs in CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner November 21, 2026 02:09
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 21, 2026 3:30am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; the earlier concerns are addressed and no new issues were found.

Summary

Centralizes enterprise settings, adds REGISTRATION_MODE, and shares the vLLM and LiteLLM implementation.

  • Enterprise features now share one server-resolved registry and browser view.
  • Signup and email sign-in now follow one REGISTRATION_MODE setting.
  • vLLM and LiteLLM now share one OpenAI-compatible provider engine.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Env[Server environment] --> Registry[Enterprise feature registry]
  Env --> Registration[Registration resolver]
  Registry --> Flags[Server flags]
  Registration --> Flags
  Flags --> Auth[Server access checks]
  Flags --> Shape[Deployment shape]
  Shape --> HTML[HTML attribute]
  HTML --> Browser[Browser settings]
  VLLM[vLLM configuration] --> Shared[Shared provider implementation]
  LiteLLM[LiteLLM configuration] --> Shared
Loading

Reviews (3) · Last reviewed commit: "fix(providers): use static log messages ..." · Reviewed by Greptile

Comment thread packages/sim-setup/src/checks.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 97 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-setup/src/checks.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
waleedlatif1 merged commit e6f6a0f into staging Nov 21, 2026
99 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/deployment-config-cleanup branch November 21, 2026 03:40
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