Skip to content

feat(seer): Put the repos an issue's stack trace points at first for Autofix - #130856

Merged
wedamija merged 7 commits into
masterfrom
danf/seer-tb-repo-event-order
Nov 13, 2026
Merged

wedamija merged 7 commits into
masterfrom
danf/seer-tb-repo-event-order

Conversation

@wedamija

Copy link
Copy Markdown
Member

Part of the Seer token-based billing work. Token-billed orgs don't pick repos in Seer settings, Seer just uses whatever repos are linked to the project.

When a project has more linked repos than the limit, the limit kept the first 8 auto-linked ones with no idea which the issue needs. For Autofix runs on an issue, use the project's code mappings to find the repos the event's in-app frames belong to, put those first and never cut them.

Refs CW-2261

wedamija and others added 3 commits November 11, 2026 15:15
Part of the Seer token-based billing work. Token-billed orgs don't pick repos in Seer settings, Seer just uses whatever repos are linked to the project.

Some projects have dozens of linked repos, almost all of them auto-linked from events, and Seer got every one in no particular order. Sort them so repos a person linked come first, and when the list goes to Seer keep all of those but only fill up to 8 with auto-linked ones. Settings still show every repo.

Refs CW-2261
…Autofix

Part of the Seer token-based billing work. Token-billed orgs don't pick repos in Seer settings, Seer just uses whatever repos are linked to the project.

When a project has more linked repos than the limit, the limit kept the first 8 auto-linked ones with no idea which the issue needs. For Autofix runs on an issue, use the project's code mappings to find the repos the event's in-app frames belong to, put those first and never cut them.

Refs CW-2261
@wedamija
wedamija requested a review from a team as a code owner November 11, 2026 23:54
@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

CW-2261

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2026
@wedamija
wedamija requested a review from srest2021 November 11, 2026 23:55
@sentry

sentry Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
- - - - - - ⏳ Processing

⚙️ sentry-frontend Snapshot Settings

Base automatically changed from danf/seer-tb-repo-cap to master November 12, 2026 19:08
…vent-order

# Conflicts:
#	src/sentry/seer/agent/client_utils.py
#	src/sentry/seer/autofix/autofix_agent.py
#	src/sentry/seer/autofix/utils.py
#	tests/sentry/seer/autofix/test_autofix_utils.py
Comment thread src/sentry/seer/autofix/utils.py Resolved
Match frames with get_sorted_code_mapping_configs, the same order stack trace links use, so there's one rule for which code mapping wins.
@wedamija
wedamija enabled auto-merge (squash) November 13, 2026 18:32

@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.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5a94b69. Configure here.

is not None
):
matched_ids.add(code_mapping.project_repository_id)
break

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.

Catch-all mapping hides the specific repo

Medium Severity

get_sorted_code_mapping_configs puts user-generated mappings first, including catch-alls with an empty stack_root. The new loop then takes the first successful path conversion and breaks, so a user catch-all matches every in-app frame and the more specific auto-generated mapping is never considered. Autofix then prioritizes the catch-all repo (often already protected from the limit) and can still drop the repo the stack trace actually points at.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a94b69. Configure here.

@wedamija
wedamija merged commit 5eee810 into master Nov 13, 2026
84 checks passed
@wedamija
wedamija deleted the danf/seer-tb-repo-event-order branch November 13, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants