Skip to content

Conversation

@szokeasaurusrex
Copy link
Member

Caution

This PR is a Proof of Concept and is NOT intended to be merged.
It demonstrates the feasibility of integrating Sentry's Seer AI code review into the CLI.

Description

Adds a new sentry-cli review command that analyzes the most recent commit using Sentry's Seer AI bug prediction service.

Features:

  • Reviews HEAD vs HEAD~1 diff
  • Sends diff to Sentry API with 10-minute timeout for long-running analysis
  • Displays predictions with severity coloring (HIGH/MEDIUM/LOW)
  • Uses git2 types directly (Oid, Diff) with custom serde serializers for proper lifetime management

Edge cases handled:

  • Merge commits (rejected)
  • Initial commits with no parent (rejected)
  • Binary files (skipped)
  • Large diffs >500KB (rejected)
  • Missing remote URL (rejected)

Issues

szokeasaurusrex and others added 2 commits January 14, 2026 17:49
Implements a new `sentry-cli review` command that analyzes the most recent
commit (HEAD vs HEAD~1) using Sentry's Seer AI bug prediction service.

Features:
- Extracts git diff and sends to Sentry API
- Displays predictions with severity coloring (HIGH/MEDIUM/LOW)
- 10-minute timeout for long-running analysis
- Handles edge cases: merge commits, binary files, large diffs

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Use git2::Oid and git2::Diff<'a> instead of converting to strings
early. Add serialize_oid and serialize_diff custom serde serializers.
Restructure run_review() to keep Repository alive for proper lifetimes.

Remove ReviewArgs from derive_parser since command has no arguments.
Simplify display code with for loop, cached to_lowercase, and cleaner
severity styling.

Co-Authored-By: Claude <[email protected]>
@linear
Copy link

linear bot commented Jan 14, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Add experimental AI code review command [PoC] ([#3084](https://github.com/getsentry/sentry-cli/pull/3084))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 3ffc369

@szokeasaurusrex szokeasaurusrex changed the base branch from master to cursor/fix-intuitive-path-behavior-for-sourcemaps-claude-4.5-sonnet-thinking-2872 January 14, 2026 16:58
@szokeasaurusrex szokeasaurusrex changed the base branch from cursor/fix-intuitive-path-behavior-for-sourcemaps-claude-4.5-sonnet-thinking-2872 to szokeasaurusrex/mcp January 14, 2026 16:59
szokeasaurusrex and others added 4 commits January 14, 2026 18:09
Move ReviewRequest, ReviewResponse, ReviewPrediction types and the
review_code() method from the command module to src/api/mod.rs to follow
the established pattern where API types and methods live in the api module.

Co-Authored-By: Claude <[email protected]>
Add proper imports for StdDuration and SerError to improve readability
instead of using std::time::Duration and serde::ser::Error inline.

Co-Authored-By: Claude <[email protected]>
Convert review command to use clap's derive API pattern with ReviewArgs
struct and add to SentryCLICommand enum. Hide the command from help text
since it's experimental.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants