feat(uptime): Add AI assertion suggestions frontend#108378
Merged
Conversation
4 tasks
2fbd02d to
5fdd512
Compare
a6fde50 to
9602bce
Compare
efa338a to
90615f9
Compare
90615f9 to
e3c808e
Compare
e3c808e to
c32c3b5
Compare
c32c3b5 to
4ef3f15
Compare
Contributor
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.
1eb026d to
dba600c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0972db8 to
cf366a0
Compare
Add UI for AI-powered assertion suggestions in the uptime monitor form. A "Suggest Assertions" button opens a GlobalDrawer that fetches suggestions from the backend and displays them as cards users can apply individually to the assertion builder. - AssertionSuggestionsButton triggers preview + Seer analysis - AssertionSuggestionsDrawerContent with useApiQuery caching - AssertionSuggestionCard with apply action per suggestion - ConnectedAssertionSuggestionsButton for detector form integration - Gated behind gen-ai-features flag on the frontend - Includes tests for all new components
Fixes eslint @typescript-eslint/require-await errors.
The mock used a flat shape that didn't match the actual API response structure from the uptime checker.
… drawer The ApiUrl type is now a branded type requiring getApiUrl() instead of raw string interpolation.
cf366a0 to
26952c2
Compare
Abdkhan14
reviewed
Feb 18, 2026
| export function EditExistingUptimeDetectorForm({detector}: {detector: UptimeDetector}) { | ||
| const organization = useOrganization(); | ||
| const showTestButton = organization.features.includes('uptime-runtime-assertions'); | ||
| const hasRuntimeAssertions = organization.features.includes( |
Contributor
There was a problem hiding this comment.
@jaydgoss lets push the flag checks for the feature to a hook for consistency across both places
Abdkhan14
reviewed
Feb 18, 2026
| export interface AssertionSuggestion { | ||
| assertion_json: Op; | ||
| assertion_type: 'status_code' | 'json_path' | 'header'; | ||
| comparison: 'equals' | 'not_equal' | 'less_than' | 'greater_than' | 'always'; |
Contributor
There was a problem hiding this comment.
Maybe we add some enums around assertion_type and comparisons, since there are hardcoded strs all over this types file
Can be done in a following PR
Member
Author
There was a problem hiding this comment.
Abdkhan14
reviewed
Feb 18, 2026
Contributor
Abdkhan14
left a comment
There was a problem hiding this comment.
Lgtm, just a couple comments to consider
…tionFeatures hook
Abdkhan14
approved these changes
Feb 18, 2026
JonasBa
pushed a commit
that referenced
this pull request
Feb 19, 2026
## Summary - Adds an "AI Suggestions" button to the uptime alert form and detector forms that opens a drawer with AI-generated assertion suggestions - Each suggestion is rendered as a card showing the assertion type, comparison, expected value, confidence score, and explanation - Users can apply individual suggestions or all at once; applying sets the form's assertion field - Gated behind `uptime-ai-assertion-suggestions` + `gen-ai-features` + `uptime-runtime-assertions` flags and `!hideAiFeatures` ### New files - `assertionSuggestionsButton.tsx` — button component that collects form data and triggers the API call - `assertionSuggestionsDrawerContent.tsx` — drawer content with suggestion cards and apply actions - `assertionSuggestionCard.tsx` — individual suggestion card component - `connectedAssertionSuggestionsButton.tsx` — form-connected wrapper for detector forms - `types.tsx` — shared TypeScript types for suggestions ### Modified files - `uptimeAlertForm.tsx` — conditionally renders the suggestions button - `detectors/components/forms/uptime/index.tsx` — adds button to new/edit detector forms ## Test plan - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsButton.spec.tsx` - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsDrawerContent.spec.tsx` - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionCard.spec.tsx` - [ ] Verify button hidden when any feature flag is missing - [ ] Verify `hideAiFeatures` org option hides the button Depends on: #108382
1 task
mchen-sentry
pushed a commit
that referenced
this pull request
Feb 24, 2026
## Summary - Adds an "AI Suggestions" button to the uptime alert form and detector forms that opens a drawer with AI-generated assertion suggestions - Each suggestion is rendered as a card showing the assertion type, comparison, expected value, confidence score, and explanation - Users can apply individual suggestions or all at once; applying sets the form's assertion field - Gated behind `uptime-ai-assertion-suggestions` + `gen-ai-features` + `uptime-runtime-assertions` flags and `!hideAiFeatures` ### New files - `assertionSuggestionsButton.tsx` — button component that collects form data and triggers the API call - `assertionSuggestionsDrawerContent.tsx` — drawer content with suggestion cards and apply actions - `assertionSuggestionCard.tsx` — individual suggestion card component - `connectedAssertionSuggestionsButton.tsx` — form-connected wrapper for detector forms - `types.tsx` — shared TypeScript types for suggestions ### Modified files - `uptimeAlertForm.tsx` — conditionally renders the suggestions button - `detectors/components/forms/uptime/index.tsx` — adds button to new/edit detector forms ## Test plan - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsButton.spec.tsx` - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsDrawerContent.spec.tsx` - [ ] `CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionCard.spec.tsx` - [ ] Verify button hidden when any feature flag is missing - [ ] Verify `hideAiFeatures` org option hides the button Depends on: #108382
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uptime-ai-assertion-suggestions+gen-ai-features+uptime-runtime-assertionsflags and!hideAiFeaturesNew files
assertionSuggestionsButton.tsx— button component that collects form data and triggers the API callassertionSuggestionsDrawerContent.tsx— drawer content with suggestion cards and apply actionsassertionSuggestionCard.tsx— individual suggestion card componentconnectedAssertionSuggestionsButton.tsx— form-connected wrapper for detector formstypes.tsx— shared TypeScript types for suggestionsModified files
uptimeAlertForm.tsx— conditionally renders the suggestions buttondetectors/components/forms/uptime/index.tsx— adds button to new/edit detector formsTest plan
CI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsButton.spec.tsxCI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionsDrawerContent.spec.tsxCI=true pnpm test static/app/views/alerts/rules/uptime/assertionSuggestionCard.spec.tsxhideAiFeaturesorg option hides the buttonDepends on: #108382