Skip to content

fix(autofix): Propagate the referrer through the RCA feature path - #123574

Merged
chromy merged 1 commit into
masterfrom
chromy/2026-09-03-fix-rca-feature-referrer
Sep 4, 2026
Merged

fix(autofix): Propagate the referrer through the RCA feature path#123574
chromy merged 1 commit into
masterfrom
chromy/2026-09-03-fix-rca-feature-referrer

Conversation

@chromy

@chromy chromy commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 3, 2026
@chromy
chromy force-pushed the chromy/2026-09-03-fix-rca-feature-referrer branch from a4e5a9a to 77e4c3d Compare September 3, 2026 14:13
@chromy
chromy marked this pull request as ready for review September 3, 2026 14:23
@chromy
chromy requested a review from a team as a code owner September 3, 2026 14:23
@chromy
chromy force-pushed the chromy/2026-09-03-fix-rca-feature-referrer branch 2 times, most recently from a12e6b8 to f7c3aee Compare September 3, 2026 14:38
@chromy
chromy requested a review from a team as a code owner September 3, 2026 14:38
@chromy
chromy force-pushed the chromy/2026-09-03-fix-rca-feature-referrer branch 3 times, most recently from a08f72a to 097741c Compare September 3, 2026 17:28
Comment thread src/sentry/receivers/outbox/cell.py Outdated
)
case SeerRunType.FEATURE_RUN:
wire_body = {**body, "ref": str(run.uuid)}
wire_body = {**body, "ref": str(run.uuid), "referrer": run.referrer or "unknown"}

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.

Maybe it would be best for us to put the referrer in the body and that way we wouldn't need any special handling here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah sounds good, I've tweaked it a bit so we don't need a change here

@chromy
chromy force-pushed the chromy/2026-09-03-fix-rca-feature-referrer branch from 097741c to 066a73c Compare September 4, 2026 14:05
The autofix RCA feature run carried no referrer. Seer stamped only `step` on the query
metadata that `AutofixOnCompletionHook` reads the trigger source from, because nothing on the
feature-run wire carried one. With `group_id` present in the run metadata the hook also skipped
the run-mirror lookup that holds the referrer, and fell back to `ON_COMPLETION_HOOK` — for the
step webhook, the fixability introspection, and every pipeline step after root cause, which cost
night shift runs their `enable_bash_tools`.

Declare `referrer` on `SeerFeatureRunRequest` so it rides the feature-run wire, and have
`start_feature_run` put it there. Callers own the value: it is a required argument now, sent on
the body for Seer and passed to `enqueue_seer_run` for the `SeerRun` mirror as before, so
neither `enqueue_seer_run` nor the outbox handler changes. Smart assignment supplies its
feature id.

Feature-run outbox rows enqueued before this deploy carry no referrer and dispatch without
the field; nothing substitutes a fallback.

Resolve the run mirror unconditionally too, the way `stopping_point` already does, so
in-flight runs still recover the referrer.

Agent transcript: https://claudescope.sentry.dev/share/J-PVJPZQLvJ1unYmBQocDe0B7quXaRmGhtf_3qzswjg
@chromy
chromy force-pushed the chromy/2026-09-03-fix-rca-feature-referrer branch from 066a73c to d03bf65 Compare September 4, 2026 14:14
@chromy
chromy enabled auto-merge (squash) September 4, 2026 14:17
@chromy
chromy merged commit e1b450c into master Sep 4, 2026
74 checks passed
@chromy
chromy deleted the chromy/2026-09-03-fix-rca-feature-referrer branch September 4, 2026 14:28
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