Skip to content

Add ISOTOMA_EMAIL fallback for Langfuse trace user id - #23

Closed
winjer wants to merge 1 commit into
mainfrom
feat/langfuse-userid-isotoma-email-fallback
Closed

winjer wants to merge 1 commit into
mainfrom
feat/langfuse-userid-isotoma-email-fallback

Conversation

@winjer

@winjer winjer commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Traces from sessions whose config lacks LANGFUSE_USER_ID carry no userId, so Langfuse user-scoped views don't group them.

user_id_from_env now falls back to ISOTOMA_EMAIL when neither CC_LANGFUSE_USER_ID nor LANGFUSE_USER_ID is set (trimmed; empty/whitespace still yields no user id, preserving the existing "omit entirely" contract). The Langfuse vars always win over the fallback.

Added tests: precedence, fallback, none case, whitespace-only values.

Sessions whose config lacks LANGFUSE_USER_ID emitted traces with no
userId. When neither CC_LANGFUSE_USER_ID nor LANGFUSE_USER_ID is set,
fall back to ISOTOMA_EMAIL so org-standard environments get
user-attributed traces without a separate config line.
@winjer winjer closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant