Skip to content

Commit 6ed04a9

Browse files
committed
Move cloud feature flags to MCP session
1 parent f5d1b53 commit 6ed04a9

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

apps/cloud/src/api/core-shared-services.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ import { Layer } from "effect";
1515

1616
import { WorkOSAuth } from "../auth/workos";
1717
import { AutumnService } from "../services/autumn";
18-
import { PostHogFeatureFlags } from "../services/feature-flags";
1918

2019
/**
2120
* Services that are independent of how the DB or tracer is provisioned —
2221
* both the stateless HTTP path (per-request DB via Hyperdrive) and the MCP
2322
* session DO (long-lived DB + isolate-local tracer SDK) merge this with
2423
* their own `DbLive` + `UserStoreLive` + telemetry layer.
2524
*/
26-
export const CoreSharedServices = Layer.mergeAll(
27-
WorkOSAuth.Default,
28-
AutumnService.Default,
29-
PostHogFeatureFlags,
30-
);
25+
export const CoreSharedServices = Layer.mergeAll(WorkOSAuth.Default, AutumnService.Default);

apps/cloud/src/mcp-session.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { UserStoreService } from "./auth/context";
3131
import { resolveOrganization } from "./auth/resolve-organization";
3232
import { DbService, combinedSchema, resolveConnectionString } from "./services/db";
3333
import { makeExecutionStack } from "./services/execution-stack";
34+
import { PostHogFeatureFlags } from "./services/feature-flags";
3435
import { makeMcpWorkerTransport, type McpWorkerTransport } from "./services/mcp-worker-transport";
3536
import { DoTelemetryLive } from "./services/telemetry";
3637
import { captureCause } from "./observability";
@@ -230,7 +231,8 @@ const makeResolveOrganizationServices = (dbHandle: DbHandle) => {
230231
// child span from the outer `McpSessionDO.init` / `McpSessionDO.handleRequest`
231232
// trace. Tracer comes from the outermost `Effect.provide(DoTelemetryLive)`
232233
// at the DO method boundary.
233-
const makeSessionServices = (dbHandle: DbHandle) => makeResolveOrganizationServices(dbHandle);
234+
const makeSessionServices = (dbHandle: DbHandle) =>
235+
Layer.mergeAll(makeResolveOrganizationServices(dbHandle), PostHogFeatureFlags);
234236

235237
const resolveSessionMeta = Effect.fn("McpSessionDO.resolveSessionMeta")(function* (
236238
organizationId: string,

0 commit comments

Comments
 (0)