From 23e10da457e4870a796ed6f28d110a711bb01fac Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 6 Feb 2026 15:05:38 -0800 Subject: [PATCH] [AI-FSSDK] [FSSDK-12262] Exclude CMAB from UserProfileService --- optimizely/decision_service.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/optimizely/decision_service.py b/optimizely/decision_service.py index 28275ef..1558132 100644 --- a/optimizely/decision_service.py +++ b/optimizely/decision_service.py @@ -457,7 +457,14 @@ def get_variation( } # Check to see if user has a decision available for the given experiment - if user_profile_tracker is not None and not ignore_user_profile: + # CMAB experiments are excluded from UPS (sticky bucketing) because CMAB decisions + # are dynamic and should not be persisted across the experiment lifetime. + is_cmab_experiment = bool(experiment.cmab) if hasattr(experiment, 'cmab') else False + if is_cmab_experiment: + message = f'Skipping UPS lookup and save for CMAB experiment "{experiment.key}".' + self.logger.info(message) + decide_reasons.append(message) + elif user_profile_tracker is not None and not ignore_user_profile: variation = self.get_stored_variation(project_config, experiment, user_profile_tracker.get_user_profile()) if variation: message = f'Returning previously activated variation ID "{variation}" of experiment ' \ @@ -529,7 +536,8 @@ def get_variation( self.logger.info(message) decide_reasons.append(message) # Store this new decision and return the variation for the user - if user_profile_tracker is not None and not ignore_user_profile: + # Skip UPS save for CMAB experiments since their decisions are dynamic + if user_profile_tracker is not None and not ignore_user_profile and not is_cmab_experiment: try: user_profile_tracker.update_user_profile(experiment, variation) except: