You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add backend-first PostHog feature flag evaluation for remote-controlled
experiments, starting with Post-Compaction Context.
Backend (ExperimentsService):
- Evaluate PostHog feature flags via posthog-node
- Disk cache (~/.mux/feature_flags.json) with TTL-based refresh
- Fail-closed behavior (unknown = disabled)
- Disable calls when telemetry is off
Telemetry enrichment (TelemetryService):
- setFeatureFlagVariant() adds $feature/<flagKey> to all events
- Enables variant breakdown in PostHog analytics
oRPC layer:
- experiments.getAll: Get all experiment values
- experiments.reload: Force refresh from PostHog
Frontend (ExperimentsContext):
- Fetch remote experiments on mount
- Priority: remote PostHog > local toggle > default
- Read-only UI when experiment is remote-controlled
Backend authoritative gating (WorkspaceService):
- sendMessage() resolves experiment from PostHog when enabled
- list() decides includePostCompaction based on experiment
Type consolidation:
- ExperimentValueSchema (Zod) is single source of truth
- ExperimentValue type derived via z.infer in types.ts
Bug fixes (unrelated):
- Fixed backgroundProcessManager exit race condition
- Fixed telemetry client Node.js compatibility
- Relaxed timing test threshold in authMiddleware
Change-Id: I346c924324a5f59cb3349614382dc8a5276e5e1e
Signed-off-by: Thomas Kosiewski <[email protected]>
0 commit comments