Repository navigation
feat(seer): Show Ask Seer's changes and push them from the PR bar - #129323
joseph-sentry wants to merge 4 commits into
Conversation
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-gs1lb2sod.sentry.dev |
Sentry Snapshot Testing
|
📊 Type Coverage Diff
🔍 8 new type safety issues introduced
Non-null assertions (
Type assertions (
This is informational only and does not block the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6d67af6. Configure here.
When Seer edits code in an Ask Seer run, the PR bar above the chat input now lists each repo on its own row: the PR as a link (or the repo name before there is one), a +N -M button that opens the run's changes, and an Update PR or Create PR button while some changes aren't on the PR. The push button sends Seer a message asking it to push that repo's changes or open a PR with them, and is disabled while Seer is working. The rows share one grid, so the buttons line up in columns. The changes view replaces the chat until you go back, which keeps the chat's scroll position and draft. It shows either the PR's diff with Seer's unpushed changes on top, or only the unpushed changes, measured from the last push the way Seer's own get_diffs_since_last_push does. The PR's diff comes from the new repos/pull-request-files endpoint, and is fetched again after each push. Gated behind ask-seer-create-pr, like the PR bar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A push clears the unpushed changes at once, but invalidating the PR files query kept serving the cached diff until the refetch landed, so All changes briefly dropped the just-pushed edits. Reset the query instead, so the diff shows as loading until the new one arrives. Co-Authored-By: Joseph Sawaya <[email protected]>
The approval and question shortcuts listen on the document, so inert didn't stop them, and Enter or Escape in the changes view could approve or reject a prompt the user couldn't see. Turn them off while the view is open. Also make the view focusable, so clicking the diff keeps focus there and Escape still goes back to the chat. Co-Authored-By: Joseph Sawaya <[email protected]>
Resetting the query when commit_sha changed only worked while the hook stayed mounted. After a remount, the diff cached before the push was still fresh, so All changes dropped the pushed edits. Put commit_sha in the query instead, so each push gets its own cache entry and the reset effect goes away. Co-Authored-By: Joseph Sawaya <[email protected]>
…129322) Adds `GET /organizations/{org}/repos/pull-request-files/?repo=<owner/name>&number=<n>`, which returns a pull request's files from its provider, found by the repository's name and the PR's number. The existing `pull-requests/{id}/files/` endpoint needs our `PullRequest` row, and Seer runs open and push to PRs we may have no record of. Ask Seer's PR bar needs each of the run's PRs' diffs to show the run's changes on top of them, so it looks PRs up the way Seer knows them. - Each file also has its `status` and `previousPath`, so renames show correctly. - Only active repositories with an integration match, scoped to the organization. - Both endpoints share the provider fetch, with the same errors: 404 when the PR is gone, 429 when rate limited, and 502 when the provider fails. The frontend that uses it is #129323, which should merge after this deploys. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
1749ba4 to
88b840a
Compare
Reuse the Ask Seer run-changes logic from #129323, copied verbatim so that PR rebases cleanly, to show each PR's diff with Seer's unpushed edits on top. Co-Authored-By: Joseph Sawaya <[email protected]>
knip flags it as unused here; #129323's changes view is its only importer.
alexsohn1126
left a comment
There was a problem hiding this comment.
This works and I have minimal complaints, but perhaps worth considering moving some parts of the frontend to the backend, especially when it partially mirrors an existing backend function.
can be done as a follow-up though — or not since there are downsides to moving some of the parsing to the backend. the frontend would have to wait for the backend to respond before the diff can be shown 😕
| * The run's file changes per repo: the PR's diff with the unpushed changes on top of it, and the | ||
| * unpushed changes alone. | ||
| * | ||
| * The unpushed part mirrors Seer's `get_diffs_since_last_push`: a push marks `pr_commit_shas` on |
There was a problem hiding this comment.
Maybe we should consider moving this part to the backend?

When Seer edits code in an Ask Seer run, you can now see those changes and ask Seer to push them, from the PR bar above the chat input.
PR bar
+N −Mbutton on each row opens the run's changes for that repo.Changes view
get_diffs_since_last_pushdoes it, so it matches what Seer will commit.It's gated behind
ask-seer-create-pr, like the PR bar.Stacked on #129322 for the new endpoint and its generated URL type. Merge after that one deploys.
Screenshots
These are simulated runs with made-up repos.
🤖 Generated with Claude Code