Skip to content

feat(uptime): Add AI assertion suggestions frontend#108378

Merged
jaydgoss merged 5 commits intomasterfrom
jaygoss/uptime-assertions-ai-fe
Feb 18, 2026
Merged

feat(uptime): Add AI assertion suggestions frontend#108378
jaydgoss merged 5 commits intomasterfrom
jaygoss/uptime-assertions-ai-fe

Conversation

@jaydgoss
Copy link
Copy Markdown
Member

@jaydgoss jaydgoss commented Feb 17, 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

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 17, 2026
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-be branch from 2fbd02d to 5fdd512 Compare February 17, 2026 21:13
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from a6fde50 to 9602bce Compare February 17, 2026 21:13
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from efa338a to 90615f9 Compare February 17, 2026 21:25
@jaydgoss jaydgoss marked this pull request as ready for review February 17, 2026 21:36
@jaydgoss jaydgoss requested review from a team as code owners February 17, 2026 21:36
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from 90615f9 to e3c808e Compare February 17, 2026 22:05
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from e3c808e to c32c3b5 Compare February 17, 2026 22:41
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from c32c3b5 to 4ef3f15 Compare February 18, 2026 00:25
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@jaydgoss jaydgoss requested a review from a team February 18, 2026 16:59
Base automatically changed from jaygoss/uptime-assertions-ai-be to master February 18, 2026 16:59
@jaydgoss jaydgoss requested a review from a team as a code owner February 18, 2026 16:59
@jaydgoss jaydgoss force-pushed the jaygoss/uptime-assertions-ai-fe branch from 1eb026d to dba600c Compare February 18, 2026 17:05
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 18, 2026
@github-actions

This comment was marked as outdated.

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.
export function EditExistingUptimeDetectorForm({detector}: {detector: UptimeDetector}) {
const organization = useOrganization();
const showTestButton = organization.features.includes('uptime-runtime-assertions');
const hasRuntimeAssertions = organization.features.includes(
Copy link
Copy Markdown
Contributor

@Abdkhan14 Abdkhan14 Feb 18, 2026

Choose a reason for hiding this comment

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

@jaydgoss lets push the flag checks for the feature to a hook for consistency across both places

export interface AssertionSuggestion {
assertion_json: Op;
assertion_type: 'status_code' | 'json_path' | 'header';
comparison: 'equals' | 'not_equal' | 'less_than' | 'greater_than' | 'always';
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.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@Abdkhan14 Abdkhan14 left a comment

Choose a reason for hiding this comment

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

Lgtm, just a couple comments to consider

@jaydgoss jaydgoss merged commit c925081 into master Feb 18, 2026
62 checks passed
@jaydgoss jaydgoss deleted the jaygoss/uptime-assertions-ai-fe branch February 18, 2026 19:09
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
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
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

claude-code-assisted Scope: Backend Automatically applied to PRs that change backend components 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