feat(runtime): gate features.aiStudio on the environment's plan#1598
Merged
Conversation
The tenant runtime serves GET /api/v1/runtime/config per request, resolving the environment by hostname. It now reads the resolved environment's billing `plan` and sets features.aiStudio accordingly: free → off, any paid tier → on. The SPA already hides the Studio/AI online-development surface when features.aiStudio is false (objectui ConsoleLayout), so this is a pure UI distinction — the AIStudioPlugin stays mounted on every shared-container tenant environment. Plan is supplied by the control plane's /api/v1/cloud/resolve-hostname (objectstack-ai/cloud). When the plan can't be resolved (file/CLI mode, legacy control plane), the static default flag is preserved so nobody is locked out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 5, 2026
…cts (#1600) BREAKING CHANGE: the multi-tenant ObjectOS runtime moves out of the open-source framework to the cloud distribution (@objectstack/objectos-runtime). The framework now supports only the SINGLE-environment local runtime. Removed from @objectstack/runtime: createObjectOSStack, KernelManager (impl), ArtifactApiClient, FileArtifactApiClient, ArtifactEnvironmentRegistry, ArtifactKernelFactory, AuthProxyPlugin, the capability loader, the per-environment owner/org seeds, and platform-SSO. Kept (the local `os serve` console needs them): RuntimeConfigPlugin (now plan-agnostic again), MarketplaceProxyPlugin, MarketplaceInstallLocalPlugin, resolveCloudUrl/DEFAULT_CLOUD_URL. Also kept as pure interface contracts so a host runtime can accept an externally-supplied multi-tenant kernel router: EnvironmentDriverRegistry and a minimal KernelManager (getOrCreate) — the http-dispatcher's optional `kernelManager` seam now types against these. Why: cloud business / multi-tenant routing must not live in the open-source framework, and evolving cloud policy must never require a framework change (see the reverted #1598). The cloud side already consumes the relocated code from @objectstack/objectos-runtime; apps/objectos + apps/cloud no longer import any multi-tenant symbol from @objectstack/runtime. runtime build (ESM+CJS+DTS) green; 138 runtime tests pass. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
ObjectStack Cloud 能力付费墙 MVP:Free 跑 app,付费档解锁在线 Studio + AI 开发。门控按用户决策是纯 UI 区分(共享容器里
AIStudioPlugin对所有租户环境照常挂载,不做按环境动态挂载)。改动
租户运行时的
RuntimeConfigPlugin(GET /api/v1/runtime/config)本就按 hostname per-request 解析环境。本 PR 让它读取解析出的环境plan,据此设features.aiStudio:free → off,任何付费档→ on。SPA(objectui
ConsoleLayout)已经在features.aiStudio === false时隐藏 Studio/AI 开发入口,所以这是纯 UI flag。plan由控制面GET /api/v1/cloud/resolve-hostname提供(见 objectstack-ai/cloud PR #117)。解析不到 plan 时(file/CLI 模式、旧控制面)保留静态默认 flag,绝不误锁。测试
新增
runtime-config-plugin.test.ts(5 例):free→off、paid→on、plan 缺失保留默认、显式aiStudio:false默认、free 覆盖aiStudio:true默认。配套
plan)已合/在合。bump-framework钉到本 SHA。