ref(seer): Propagate viewer_context to background tasks and utilities#109724
Merged
ref(seer): Propagate viewer_context to background tasks and utilities#109724
Conversation
Contributor
Backend Test FailuresFailures on
|
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
gricha
approved these changes
Mar 3, 2026
62674ba to
1b90307
Compare
Pass SeerViewerContext to Seer API call sites in context engine index, explorer index, trace summary, and supergroups. Tasks use org only, trace summary uses org+optional user.
The test assertion for _call_seer now includes the viewer_context keyword argument that is passed through from get_trace_summary.
- Fix multi-org batch: only set viewer_context when all projects in a batch share the same org_id, otherwise skip it - Remove redundant `user is not None` check in trace_summary.py since user is guaranteed non-None after the AnonymousUser fallback
1b90307 to
0b18a1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass
SeerViewerContextto Seer API wrapper call sites in background tasks and utility modules.PR #109697 added an optional
viewer_contextparameter to all Seer API wrapper functions. This PR updates:context_engine_index.py: Passorganization_idfromorg_idparamseer_explorer_index.py: Passorganization_idfrom project tuplestrace_summary.py: Passorganization_id+ optionaluser_id(when user is not None/anonymous)supergroups.py: Passorganization_idfrom paramseer_models.py(no auth),uptime/seer_assertions.py(no context)No behavior change —
viewer_contextdefaults toNonewhich preserves existing behavior.Co-Authored-By: Claude noreply@anthropic.com