diff --git a/orchestrator/api/shopify.py b/orchestrator/api/shopify.py index 94cb4d30e..6a5525cbf 100644 --- a/orchestrator/api/shopify.py +++ b/orchestrator/api/shopify.py @@ -112,7 +112,10 @@ class SyncRequest(BaseModel): "triggers": [ {"type": "time_on_page", "seconds": 20}, ], - "frequency_cap": {"scope": "session", "max_pops": 1}, + # product_session keys the frequency-cap slot by product handle, so the + # opener fires once PER product per session rather than once for the whole + # session across every product page (the old "session" behaviour). + "frequency_cap": {"scope": "product_session", "max_pops": 1}, "greeting_source": "agent_with_canned_fallback", "canned_fallback": "Need a hand finding the right product?", "agent_timeout_ms": 1500, diff --git a/orchestrator/tests/test_widget_proactive_prd007.py b/orchestrator/tests/test_widget_proactive_prd007.py index 0ab6b076d..e92fdf441 100644 --- a/orchestrator/tests/test_widget_proactive_prd007.py +++ b/orchestrator/tests/test_widget_proactive_prd007.py @@ -40,7 +40,7 @@ def test_default_widget_proactive_shape(): assert cfg["enabled"] is False, "must default to OFF — opt-in" assert cfg["page_types"] == ["product"] assert cfg["triggers"] == [{"type": "time_on_page", "seconds": 20}] - assert cfg["frequency_cap"] == {"scope": "session", "max_pops": 1} + assert cfg["frequency_cap"] == {"scope": "product_session", "max_pops": 1} assert cfg["greeting_source"] == "agent_with_canned_fallback" assert cfg["canned_fallback"] == "Need a hand finding the right product?" assert cfg["agent_timeout_ms"] == 1500