Skip to content

feat(investigations): Create agentic runs from both entry points - #124334

Merged
billyvg merged 2 commits into
masterfrom
billyvong/investigations-agentic-entry-points
Sep 16, 2026
Merged

billyvg merged 2 commits into
masterfrom
billyvong/investigations-agentic-entry-points

Conversation

@billyvg

@billyvg billyvg commented Sep 14, 2026

Copy link
Copy Markdown
Member

This changes the metric issue and the new investigation entry points so that they create the new agentic style investigation (e.g. the one w/ the hypothesis).

Slop

Neither entry point produced an investigation with hypotheses. The server decides from the request body — a source with no templateKey builds an agentic run, anything else builds a plain notebook — and both buttons sent a shape that landed elsewhere.

"Investigate" on a metric issue now sends the metric snapshot alone, dropping the template key. The candidates endpoint already matches agentic and template lineage keys alike, so a breach that was investigated before still resolves to "View" rather than offering a duplicate.

"New investigation" sends a manual source. That run opens awaiting_input and stays there until someone supplies a prompt, which nothing in the UI does yet, so the investigation behaves as before — an empty notebook — with an idle run attached.

That idle run is why polling changed. The predicate asked whether a run had reached a terminal status, and awaiting_input has not; left alone, every newly created investigation would have polled the detail and orchestration endpoints every two seconds forever. It now asks whether the agent is advancing, which awaiting_input is not: it is blocked on a person, and supplying input writes the new projection into the cache and starts it again.

Note that this does not gate the behaviour behind anything beyond the existing organizations:investigations flag — every investigation created in a flagged org becomes agentic.

Base branch

This targets billyvong/investigations-hypothesis-ui (#124086) rather than master: it edits static/app/views/investigations/hypotheses/investigationHypotheses.tsx, which only exists on that branch. It was originally committed there and reverted so that PR could stay focused; this is that commit, cherry-picked.

Visual verification

Blocked, and not skipped silently: this change lives in the request body sent when an investigation is created, so exercising it needs a local backend to create against. devservices is not running (Docker daemon is down), and the only other reachable API is production, which is not a valid QA target. Screenshots from the Storybook fixture API would not be evidence of this change, since the fixtures do not exercise the creation path.

Happy to capture the real states if devservices gets brought up.

Checks

  • pnpm run typecheck clean
  • pnpm run lint:js clean
  • 621 tests pass across static/app/views/investigations/ and static/app/views/detectors/

https://claude.ai/code/session_014zh69vex76pjNTnarqVcXL

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-ly1xh2lud.sentry.dev

@billyvg

billyvg commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

bugbot review

@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 reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 881b0dd. Configure here.

Comment thread static/app/views/investigations/hypotheses/investigationHypotheses.tsx Outdated
@billyvg
billyvg force-pushed the billyvong/investigations-agentic-entry-points branch from c4cb10e to 5a2c9ef Compare September 15, 2026 17:54
@billyvg
billyvg marked this pull request as ready for review September 15, 2026 18:08
@billyvg
billyvg requested a review from a team as a code owner September 15, 2026 18:08
@billyvg
billyvg requested a review from arslnb September 15, 2026 18:24
Base automatically changed from billyvong/investigations-hypothesis-ui to master September 16, 2026 17:26
Neither entry point produced an investigation with hypotheses. The server
decides from the request body -- a `source` with no `templateKey` builds an
agentic run, anything else builds a plain notebook -- and both buttons sent
a shape that landed elsewhere.

"Investigate" on a metric issue now sends the metric snapshot alone,
dropping the template key. The candidates endpoint already matches agentic
and template lineage keys alike, so a breach that was investigated before
still resolves to "View" rather than offering a duplicate.

"New investigation" sends a manual source. That run opens `awaiting_input`
and stays there until someone supplies a prompt, which nothing in the UI
does yet, so the investigation behaves as before -- an empty notebook --
with an idle run attached.

That idle run is why polling changed. The predicate asked whether a run had
reached a terminal status, and `awaiting_input` has not; left alone, every
newly created investigation would have polled the detail and orchestration
endpoints every two seconds forever. It now asks whether the agent is
advancing, which `awaiting_input` is not: it is blocked on a person, and
supplying input writes the new projection into the cache and starts it
again.

Note that this does not gate the behaviour behind anything beyond the
existing organizations:investigations flag -- every investigation created
in a flagged org becomes agentic.

Claude-Session: https://claude.ai/code/session_012CtaiBZtJdz8uMRtUgvbmv
A review-bot finding on the polling predicate this commit introduced.

Sentry parks a brand-new run at awaiting_input before it has finished creating it in Seer: the create is dispatched after the transaction commits, and until it lands the run carries no Seer id. Treating that status as stopped meant the queries went quiet during exactly the window where the create can still fail the run or rewrite the projection, leaving the UI on awaiting input until a reload.

The predicate now takes whether the Seer run exists, so a placeholder awaiting_input keeps being read while a genuine one -- blocked on a person -- still does not. A create that fails leaves no Seer id behind but flips the run to failed, which is terminal, so the missing id cannot restart polling on a stopped run. The detail view reads a summary that carries no run id, so it keeps the blocked-on-a-person reading.

Claude-Session: https://claude.ai/code/session_014zh69vex76pjNTnarqVcXL
@billyvg
billyvg force-pushed the billyvong/investigations-agentic-entry-points branch from 5a2c9ef to 248163c Compare September 16, 2026 18:52
@billyvg
billyvg merged commit c800f3d into master Sep 16, 2026
75 checks passed
@billyvg
billyvg deleted the billyvong/investigations-agentic-entry-points branch September 16, 2026 19:33
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