Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-posthog for openSUSE:Factory 
checked in at 2026-03-09 16:11:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-posthog (Old)
 and      /work/SRC/openSUSE:Factory/.python-posthog.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-posthog"

Mon Mar  9 16:11:30 2026 rev:6 rq:1337522 version:7.9.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-posthog/python-posthog.changes    
2026-03-04 21:05:35.093343830 +0100
+++ /work/SRC/openSUSE:Factory/.python-posthog.new.8177/python-posthog.changes  
2026-03-09 16:12:09.998972895 +0100
@@ -1,0 +2,7 @@
+Sun Mar  8 20:50:49 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 7.9.7:
+  * fix(llma): use distinct_id from outer context if not provided
+  * Add warning log for local flag evaluation cold start
+
+-------------------------------------------------------------------

Old:
----
  posthog-7.9.6.tar.gz

New:
----
  posthog-7.9.7.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-posthog.spec ++++++
--- /var/tmp/diff_new_pack.PXFzNw/_old  2026-03-09 16:12:10.594997532 +0100
+++ /var/tmp/diff_new_pack.PXFzNw/_new  2026-03-09 16:12:10.594997532 +0100
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-posthog
-Version:        7.9.6
+Version:        7.9.7
 Release:        0
 Summary:        PostHog is developer-friendly, self-hosted product analytics
 License:        MIT

++++++ posthog-7.9.6.tar.gz -> posthog-7.9.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/PKG-INFO new/posthog-7.9.7/PKG-INFO
--- old/posthog-7.9.6/PKG-INFO  2026-03-02 22:28:48.419109000 +0100
+++ new/posthog-7.9.7/PKG-INFO  2026-03-05 23:09:32.431455100 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: posthog
-Version: 7.9.6
+Version: 7.9.7
 Summary: Integrate PostHog into any python application.
 Home-page: https://github.com/posthog/posthog-python
 Author: Posthog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/posthog/ai/utils.py 
new/posthog-7.9.7/posthog/ai/utils.py
--- old/posthog-7.9.6/posthog/ai/utils.py       2026-03-02 22:28:23.000000000 
+0100
+++ new/posthog-7.9.7/posthog/ai/utils.py       2026-03-05 23:09:03.000000000 
+0100
@@ -2,7 +2,7 @@
 import uuid
 from typing import Any, Callable, Dict, List, Optional, cast
 
-from posthog import get_tags, identify_context, new_context, tag
+from posthog import get_tags, identify_context, new_context, tag, contexts
 from posthog.ai.sanitization import (
     sanitize_anthropic,
     sanitize_gemini,
@@ -366,6 +366,16 @@
             if posthog_trace_id is None:
                 posthog_trace_id = str(uuid.uuid4())
 
+            # Check if we have a real user distinct_id (from param or outer 
context)
+            has_person_distinct_id = (
+                posthog_distinct_id is not None
+                or contexts.get_context_distinct_id() is not None
+            )
+
+            if not has_person_distinct_id:
+                # Fall back to trace_id as distinct_id when no real user id is 
available.
+                identify_context(posthog_trace_id)
+
             if response and (
                 hasattr(response, "usage")
                 or (provider == "gemini" and hasattr(response, 
"usage_metadata"))
@@ -421,7 +431,7 @@
                 # Already serialized by converters
                 tag("$ai_usage", raw_usage)
 
-            if posthog_distinct_id is None:
+            if not has_person_distinct_id:
                 tag("$process_person_profile", False)
 
             # Process instructions for Responses API
@@ -445,7 +455,7 @@
                     sdk_tags, posthog_properties
                 )
                 ph_client.capture(
-                    distinct_id=posthog_distinct_id or posthog_trace_id,
+                    distinct_id=contexts.get_context_distinct_id(),
                     event="$ai_generation",
                     properties=merged_properties,
                     groups=posthog_groups,
@@ -501,6 +511,16 @@
             if posthog_trace_id is None:
                 posthog_trace_id = str(uuid.uuid4())
 
+            # Check if we have a real user distinct_id (from param or outer 
context)
+            has_person_distinct_id = (
+                posthog_distinct_id is not None
+                or contexts.get_context_distinct_id() is not None
+            )
+
+            if not has_person_distinct_id:
+                # Fall back to trace_id as distinct_id when no real user id is 
available.
+                identify_context(posthog_trace_id)
+
             if response and (
                 hasattr(response, "usage")
                 or (provider == "gemini" and hasattr(response, 
"usage_metadata"))
@@ -556,7 +576,7 @@
                 # Already serialized by converters
                 tag("$ai_usage", raw_usage)
 
-            if posthog_distinct_id is None:
+            if not has_person_distinct_id:
                 tag("$process_person_profile", False)
 
             # Process instructions for Responses API
@@ -580,7 +600,7 @@
                     sdk_tags, posthog_properties
                 )
                 ph_client.capture(
-                    distinct_id=posthog_distinct_id or posthog_trace_id,
+                    distinct_id=contexts.get_context_distinct_id(),
                     event="$ai_generation",
                     properties=merged_properties,
                     groups=posthog_groups,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/posthog/client.py 
new/posthog-7.9.7/posthog/client.py
--- old/posthog-7.9.6/posthog/client.py 2026-03-02 22:28:23.000000000 +0100
+++ new/posthog-7.9.7/posthog/client.py 2026-03-05 23:09:03.000000000 +0100
@@ -1620,7 +1620,13 @@
                 self.flag_cache.set_cached_flag(
                     distinct_id, key, flag_result, self.flag_definition_version
                 )
-        elif not only_evaluate_locally:
+        elif only_evaluate_locally:
+            if self.feature_flags is None:
+                self.log.warning(
+                    "[FEATURE FLAGS] Local evaluation called but feature flag 
definitions are not loaded yet. "
+                    "Returning None. You can call load_feature_flags() to load 
flags explicitly."
+                )
+        else:
             try:
                 flag_details, request_id, evaluated_at, errors_while_computing 
= (
                     self._get_feature_flag_details_from_server(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/posthog/version.py 
new/posthog-7.9.7/posthog/version.py
--- old/posthog-7.9.6/posthog/version.py        2026-03-02 22:28:45.000000000 
+0100
+++ new/posthog-7.9.7/posthog/version.py        2026-03-05 23:09:29.000000000 
+0100
@@ -1 +1 @@
-VERSION = "7.9.6"
+VERSION = "7.9.7"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/posthog.egg-info/PKG-INFO 
new/posthog-7.9.7/posthog.egg-info/PKG-INFO
--- old/posthog-7.9.6/posthog.egg-info/PKG-INFO 2026-03-02 22:28:48.000000000 
+0100
+++ new/posthog-7.9.7/posthog.egg-info/PKG-INFO 2026-03-05 23:09:32.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: posthog
-Version: 7.9.6
+Version: 7.9.7
 Summary: Integrate PostHog into any python application.
 Home-page: https://github.com/posthog/posthog-python
 Author: Posthog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/posthog-7.9.6/pyproject.toml 
new/posthog-7.9.7/pyproject.toml
--- old/posthog-7.9.6/pyproject.toml    2026-03-02 22:28:45.000000000 +0100
+++ new/posthog-7.9.7/pyproject.toml    2026-03-05 23:09:28.000000000 +0100
@@ -4,7 +4,7 @@
 
 [project]
 name = "posthog"
-version = "7.9.6"
+version = "7.9.7"
 description = "Integrate PostHog into any python application."
 authors = [{ name = "PostHog", email = "[email protected]" }]
 maintainers = [{ name = "PostHog", email = "[email protected]" }]

Reply via email to