Skip to content

Commit 609bbfc

Browse files
Revert "feat(runtime): gate features.aiStudio on the environment's plan (#1598)" (#1599)
This reverts commit 308c936. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
1 parent 308c936 commit 609bbfc

2 files changed

Lines changed: 6 additions & 122 deletions

File tree

packages/runtime/src/cloud/runtime-config-plugin.test.ts

Lines changed: 0 additions & 104 deletions
This file was deleted.

packages/runtime/src/cloud/runtime-config-plugin.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ export class RuntimeConfigPlugin implements Plugin {
120120
// payload when the host doesn't map to any env (e.g. a
121121
// marketing root, a CLI-served single-env runtime, or
122122
// cloud.objectos.ai which mounts its own static handler).
123+
const features = {
124+
installLocal: this.installLocal,
125+
marketplace: true,
126+
aiStudio: this.aiStudio,
127+
};
123128
let envRegistry: any = null;
124129
try { envRegistry = ctx.getService('env-registry'); } catch { /* not mounted (file/CLI mode) */ }
125130

@@ -129,13 +134,6 @@ export class RuntimeConfigPlugin implements Plugin {
129134
let defaultEnvironmentId: string | undefined;
130135
let defaultOrgId: string | undefined;
131136
let resolvedSingleEnv = this.singleEnvironment;
132-
// Capability flag: paid environments unlock the Studio/AI
133-
// online-development surface; free environments hide it. Starts
134-
// from the static default and is overridden per-request once we
135-
// know the resolved environment's billing plan. When the plan
136-
// can't be resolved (file/CLI mode, legacy control plane) we
137-
// keep the static default rather than locking anyone out.
138-
let aiStudio = this.aiStudio;
139137
// EnvironmentDriverRegistry exposes `resolveByHostname()`;
140138
// older code paths used `resolveHostname()` on the client.
141139
// Accept either so production runtimes (which register the
@@ -159,12 +157,6 @@ export class RuntimeConfigPlugin implements Plugin {
159157
// operator's POV: surface as single-environment
160158
// so the SPA hides multi-env affordances.
161159
resolvedSingleEnv = true;
162-
// Gate the Studio/AI surface on the environment's
163-
// plan: free → off, any paid tier → on. Only an
164-
// explicit non-empty plan overrides the default, so
165-
// an absent/blank value leaves the static flag intact.
166-
const plan = typeof resolved.plan === 'string' ? resolved.plan.trim().toLowerCase() : '';
167-
if (plan) aiStudio = plan !== 'free';
168160
}
169161
} catch {
170162
// Resolver failures are non-fatal — fall through
@@ -177,11 +169,7 @@ export class RuntimeConfigPlugin implements Plugin {
177169
singleEnvironment: resolvedSingleEnv,
178170
defaultOrgId,
179171
defaultEnvironmentId,
180-
features: {
181-
installLocal: this.installLocal,
182-
marketplace: true,
183-
aiStudio,
184-
},
172+
features,
185173
branding: {
186174
productName: this.productName,
187175
productShortName: this.productShortName,

0 commit comments

Comments
 (0)