-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(explorer): send interactivity flag in client #103934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing is_interactive flag in continue_run payload
The continue_run method doesn't include is_interactive in its payload, unlike start_run which sends it on line 166. When users continue a conversation from the UI chat endpoint, the continuation requests won't be marked as interactive, causing inconsistent behavior where only the first message in a conversation is flagged as interactive while follow-ups are not, despite all interactions occurring on the Sentry UI.
src/sentry/seer/explorer/client.py#L197-L230
sentry/src/sentry/seer/explorer/client.py
Lines 197 to 230 in 8e3930e
| def continue_run( | |
| self, | |
| run_id: int, | |
| prompt: str, | |
| insert_index: int | None = None, | |
| on_page_context: str | None = None, | |
| ) -> int: | |
| """ | |
| Continue an existing Seer Explorer session. This allows you to add follow-up queries to an ongoing conversation. | |
| Args: | |
| run_id: The run ID from start_run() | |
| prompt: The follow-up task/query for the agent | |
| insert_index: Optional index to insert the message at | |
| on_page_context: Optional context from the user's screen | |
| Returns: | |
| int: The run ID (same as input) | |
| Raises: | |
| requests.HTTPError: If the Seer API request fails | |
| """ | |
| path = "/v1/automation/explorer/chat" | |
| payload: dict[str, Any] = { | |
| "organization_id": self.organization.id, | |
| "query": prompt, | |
| "run_id": run_id, | |
| "insert_index": insert_index, | |
| "on_page_context": on_page_context, | |
| } | |
| body = orjson.dumps(payload, option=orjson.OPT_NON_STR_KEYS) |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: `is_interactive` flag missing from `continue_run` payload
The is_interactive flag is added to the start_run payload but is missing from the continue_run payload. When a conversation is continued through the UI chat endpoint (which sets is_interactive=True on the client), the continue_run method won't send this flag to the Seer API. The stored self.is_interactive value needs to be included in the continue_run payload for consistent behavior between new and continued conversations.
src/sentry/seer/explorer/client.py#L221-L228
sentry/src/sentry/seer/explorer/client.py
Lines 221 to 228 in 1cee59d
| payload: dict[str, Any] = { | |
| "organization_id": self.organization.id, | |
| "query": prompt, | |
| "run_id": run_id, | |
| "insert_index": insert_index, | |
| "on_page_context": on_page_context, | |
| } |
Co-authored-by: Andrew Liu <[email protected]>
| "on_page_context": on_page_context, | ||
| "user_org_context": collect_user_org_context(self.user, self.organization), | ||
| "intelligence_level": self.intelligence_level, | ||
| "is_interactive": self.is_interactive, | ||
| } | ||
|
|
||
| # Add artifact schema if provided |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing `is_interactive` flag in continue_run payload
The is_interactive flag is added to the start_run payload but not to the continue_run payload. When the UI chat endpoint continues an existing conversation via continue_run, the is_interactive=True setting stored in self.is_interactive is never sent to the Seer backend. This means follow-up messages in interactive conversations won't receive the full interactive treatment intended by this feature.
src/sentry/seer/explorer/client.py#L221-L228
sentry/src/sentry/seer/explorer/client.py
Lines 221 to 228 in 3d048f5
| payload: dict[str, Any] = { | |
| "organization_id": self.organization.id, | |
| "query": prompt, | |
| "run_id": run_id, | |
| "insert_index": insert_index, | |
| "on_page_context": on_page_context, | |
| } |
src/sentry/seer/explorer/client.py#L165-L166
sentry/src/sentry/seer/explorer/client.py
Lines 165 to 166 in 3d048f5
| "intelligence_level": self.intelligence_level, | |
| "is_interactive": self.is_interactive, |
Sends an
is_interactiveflag in the client. Defaults to False, but sets to True for the UI chat endpoint.Part of AIML-1689: indicator on state whether on Sentry UI or not