Move PostHog gating into buildFeatureChecks
Problem
PostHog gating is hand-wired into the featuresCheck getter in account-settings.js, separate from the config-driven feature system in FeatureChecks.ts. The pairing between a PostHog flag and its platform feature is implicit.
Goal
Let a feature config declare an optional posthogKey alongside platformKey/teamKey. PostHog is authoritative: when it's available, its flag value drives the check regardless of platform/team settings. Only when PostHog is unavailable does the check fall back to the existing platform/team logic.
Behavior
For a config with a posthogKey, buildFeatureChecks resolves {output} as:
window.posthog present |
Has platform/team key |
Result |
| yes |
— |
PostHog flag value |
| no |
yes |
existing platform/team check |
| no |
no |
false |
Configs with no posthogKey are unchanged.
Changes
This changes MCP: today it's platform AND team AND PostHog; under the new rule PostHog trumps everything when present, so its value drives the check regardless of platform/team.
Move PostHog gating into
buildFeatureChecksProblem
PostHog gating is hand-wired into the
featuresCheckgetter inaccount-settings.js, separate from the config-driven feature system inFeatureChecks.ts. The pairing between a PostHog flag and its platform feature is implicit.Goal
Let a feature config declare an optional
posthogKeyalongsideplatformKey/teamKey. PostHog is authoritative: when it's available, its flag value drives the check regardless of platform/team settings. Only when PostHog is unavailable does the check fall back to the existing platform/team logic.Behavior
For a config with a
posthogKey,buildFeatureChecksresolves{output}as:window.posthogpresentfalseConfigs with no
posthogKeyare unchanged.Changes
posthogKey?: stringtoFeatureConfig; apply the table above inbuildFeatureChecks. Availability is!!window.posthog; the value comes fromposthogFlags(passed in; still populated byloadPosthogFlags→onFeatureFlagsso the getter stays reactive).POSTHOG_FLAGSand the three PostHog lines out of thefeaturesCheckgetter inaccount-settings.js(keepposthogFlagsstate +loadPosthogFlags).ExpertButton.vuereadsisMcpThirdPartyEnabled, config output isisMcpThirdPartyFeatureEnabled.isPostHogFeatureFlagsEnabledentirely, plus the code it gates inGeneral.vue(thev-ifExpert-agent creds template block and the mounted-hook assignment). Drop theFF_FEATURE_FLAGSkey.This changes MCP: today it's platform AND team AND PostHog; under the new rule PostHog trumps everything when present, so its value drives the check regardless of platform/team.