Skip to content

feat(seer): Poll Seer Explorer by UUID#117780

Merged
trevor-e merged 8 commits into
masterfrom
telkins/feat-seer-explorer-poll-by-uuid
Jun 26, 2026
Merged

feat(seer): Poll Seer Explorer by UUID#117780
trevor-e merged 8 commits into
masterfrom
telkins/feat-seer-explorer-poll-by-uuid

Conversation

@trevor-e

@trevor-e trevor-e commented Jun 16, 2026

Copy link
Copy Markdown
Member

Adopts the run's UUID (sentry_run_id) for Seer Explorer polling instead of the numeric run id, mirroring the search agent (#115307). runId widens to number | string and new runs take sentry_run_id ?? run_id. Existing numeric-keyed runs keep working unchanged (the endpoint resolves both forms). Persisted run ids and explorerRunId deep/share links accept UUIDs.

Backwards compatible: falls back to the numeric run_id when sentry_run_id is absent.

I manually tested as many places/features as I could find: Ask Seer, refreshing the page w/ a session open, manual autofix, thumbs up/down, and assisted query.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 16, 2026
@trevor-e trevor-e force-pushed the telkins/feat-seer-explorer-poll-by-uuid branch 2 times, most recently from f068327 to 0084669 Compare June 16, 2026 03:46
Comment thread static/app/views/seerExplorer/seerExplorerChatStateContext.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 68127f8. Configure here.

Comment thread static/app/views/seerExplorer/hooks/useSeerExplorer.tsx
Base automatically changed from telkins/feat-seer-explorer-chat-get-return-uuid to master June 16, 2026 13:21
Adopt the run's UUID (sentry_run_id) for Seer Explorer polling instead of
the numeric run id, mirroring the search agent. The run id widens to
number | string and new runs take sentry_run_id ?? run_id. Existing
numeric-keyed runs keep working unchanged (the endpoint resolves both
forms). The persisted run id and explorerRunId deep links accept UUIDs too.
Remove the numeric run_id from SeerExplorerResponse's session to
discourage its use now that polling keys off sentry_run_id (the UUID).
The field was unread; the canonical id is the top-level sentry_run_id.
Comment thread static/app/views/seerExplorer/types.tsx
trevor-e added 2 commits June 17, 2026 11:26
…xplorer-poll-by-uuid

# Conflicts:
#	static/app/views/seerExplorer/useSeerExplorerContext.tsx
…rsal

A crafted `explorerRunId` deep link can set runId to an arbitrary string
(the param now accepts non-numeric values for UUID support). The three
explorer-update mutations interpolated it into a same-origin authenticated
POST without encoding, so `..`-style values could traverse to other
org-scoped paths. Route all three through a shared helper that
encodeURIComponents the run id, matching the polling path which already
encodes via getApiUrl. No-op for numeric/UUID/opaque-string ids.
…xplorer-poll-by-uuid

# Conflicts:
#	static/app/views/seerExplorer/hooks/useSeerExplorer.tsx
trevor-e and others added 2 commits June 25, 2026 17:03
…xplorer-poll-by-uuid

# Conflicts:
#	static/app/views/seerExplorer/useSeerExplorerContext.tsx
#	static/app/views/seerExplorer/utils.tsx
Constrain the attacker-controllable explorerRunId deep-link param to a
legacy numeric ID or a UUID (reusing isUUID) so a crafted link no longer
fires a request for arbitrary garbage, and key the session-history dropdown
off sentry_run_id when present so a run is tracked consistently whether it
is opened fresh or selected from history.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add useSeerExplorerDeepLink tests for the share-link consume path (UUID and
legacy numeric runs open and strip the param, malformed values are ignored,
the enabled gate is respected), and clarify the explorer-update URL-encoding
test name now that the deep-link param is validated separately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@trevor-e trevor-e marked this pull request as ready for review June 25, 2026 22:15
@trevor-e trevor-e requested review from a team as code owners June 25, 2026 22:15

@aliu39 aliu39 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will also manual test rq but all looks great!

@trevor-e trevor-e merged commit f82d0e9 into master Jun 26, 2026
89 of 91 checks passed
@trevor-e trevor-e deleted the telkins/feat-seer-explorer-poll-by-uuid branch June 26, 2026 20:32
trevor-e added a commit that referenced this pull request Jun 27, 2026
…#118616)

## What

After #117265 and #117780, the Seer Explorer frontend started sending
`sentry_run_id` (a UUID) instead of the numeric `seer_run_state_id` for
run identification. The chat endpoint's GET (poll) and POST (continue)
paths were updated to resolve either form via `resolve_seer_run()`. The
update endpoint (`/seer/explorer-update/{run_id}/`) was missed, so
Seer's Pydantic model rejects UUID run IDs with:

```
{"detail":[{"type":"int_parsing","loc":["body","run_id"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":"cac2b2c1-4fd7-4003-acc2-e0f1ca0a5640"}]}
```

## Fix

Apply `resolve_seer_run()` to
`OrganizationSeerAgentUpdateEndpoint.post()`, translating UUIDs (or
numeric IDs) to `seer_run_state_id` before forwarding to Seer's
`/v1/automation/explorer/update`. Mirrors the fix already applied to the
chat endpoint.

- `run_id` type hint widened to `str` (the URL pattern already captured
it as `[^/]+`)
- `resolved.seer_run_state_id` (int) used in the Seer request body
- Added `test_explorer_update_with_uuid_run_id` covering the UUID path
end-to-end
- Updated existing `run_id` assertion from `"123"` → `123` (now
correctly an int after resolution)

Reported by Sofia Rest. Refs #117265, #117780.

---
[View Session in
Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0B0PFS5069%3A1782524325.765739%22)

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants