:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(review_hog): return head, report and resolve plan from the trigger (#114890)
Julian Beza435eb03f7ef
diff --git a/products/review_hog/backend/api/reviews.py b/products/review_hog/backend/api/reviews.pyindex 992b8f7d2aa7..96dc9fab13ac 100644--- a/products/review_hog/backend/api/reviews.py+++ b/products/review_hog/backend/api/reviews.py@@ -29,6 +29,7 @@ from products.review_hog.backend.requested_reviews import (RUN_MODE_REVIEW,RUN_MODE_REVIEW_ONLY,PRReviewRequestStatus,+ ResolveSkipReason,request_pr_review,)from products.review_hog.backend.review_request_rules import ReviewRequestRefusal@@ -37,7 +38,7 @@ from products.review_hog.backend.reviewer.artefact_content import (ReviewIssueFinding,ValidationVerdict,)-from products.review_hog.backend.reviewer.constants import REVIEW_MODE_FULL, effective_priority+from products.review_hog.backend.reviewer.constants import REVIEW_MODE_FLASH, REVIEW_MODE_FULL, effective_priorityfrom products.review_hog.backend.reviewer.models.issues_review import IssuePriorityfrom products.review_hog.backend.reviewer.models.split_pr_into_chunks import ChunksListfrom products.review_hog.backend.reviewer.persistence import load_chunk_set, load_findings_bundle, load_turn_findings@@ -294,6 +295,11 @@ class ReviewTriggerRequestSerializer(serializers.Serializer):)+class ReviewTriggerReviewMode(models.TextChoices):+ FULL = REVIEW_MODE_FULL, "Deep"+ FLASH = REVIEW_MODE_FLASH, "Standard"++class ReviewTriggerResponseSerializer(serializers.Serializer):workflow_id = serializers.CharField(allow_blank=True, help_text="Temporal workflow id for the started review run; empty when no run was started."@@ -301,9 +307,37 @@ class ReviewTriggerResponseSerializer(serializers.Serializer):status = serializers.CharField(help_text="Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the ""pull request's current commit already has a published review in the requested mode, "- "'joined_running_review' when a review was already in flight and the request joined its queue. "+ "'joined_running_review' when a review was already running and the request was queued on that "+ "pull request's run, to start after the running turn. ""A requested Deep review waits for an active Standard review.")+ repository = serializers.CharField(help_text="The pull request's repository as 'owner/repo'.")+ pr_number = serializers.IntegerField(help_text="The pull request number.")+ head_sha = serializers.CharField(+ allow_null=True, help_text="The pull request's head commit when the request was accepted."+ )+ review_mode = serializers.ChoiceField(+ choices=ReviewTriggerReviewMode.choices,+ allow_null=True,+ help_text="The review this request runs: 'full' (Deep) or 'flash' (Standard). Null for 'resolve_only', "+ "which runs no review.",+ )+ report_id = serializers.UUIDField(+ allow_null=True,+ help_text="Id of the pull request's existing review, for `review-hog-reviews-get`. Null on the pull "+ "request's first run, which creates the review later.",+ )+ requested_at = serializers.DateTimeField(help_text="Server time when the request was accepted.")+ resolve_will_run = serializers.BooleanField(+ help_text="Whether this request runs the resolution stage, which can push fix commits to the pull request."+ )+ resolve_skip_reason = serializers.ChoiceField(+ choices=ResolveSkipReason.choices,+ allow_null=True,+ help_text="Why the resolution stage does not run: 'run_mode_excludes_resolve' ('review_only' and "+ "'flash' never resolve), 'owner_not_opted_in' (the pull request owner has not turned on resolving "+ "comments), 'already_reviewed' (no run starts). Null when it runs.",+ )class ReviewTriggerErrorSerializer(serializers.Serializer):@@ -768,18 +802,19 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet},summary="Start a review of a pull request",description="Start a ReviewHog review of any pull request the project's GitHub App installation can "- "access, and publish it back to the PR. The requesting user is the review's acting user: their "- "enabled perspectives, blind-spot check, validator, and urgency threshold drive the run, and it "- "appears under their recent reviews. Resolution writes to the branch only when the pull request "- "owner opted in, whoever asks. `run_mode` picks the variant: a review (which chains the resolution "- "stage per the owner's resolve_comments setting), a review without resolving, resolution only, or a "- "lower-cost Standard review that never resolves comments and is refused after a published Deep review. "- "Nonexistent, closed, and fork PRs are rejected synchronously; "- "a PR whose current commit already has a published review returns 'already_reviewed' without "- "starting a run (resolve_only skips that check — settling threads on a reviewed head is its whole "- "point), and triggering a PR whose run is currently in flight joins that run. "- "Otherwise non-blocking: returns the Temporal workflow id immediately while the run executes in "- "the worker.",+ "access, and publish it back to the PR. The run appears under the requesting user's recent reviews. "+ "A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency "+ "threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull "+ "request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that "+ "chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review "+ "without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review "+ "that never resolves comments and is refused after a published Deep review. "+ "Nonexistent, closed, and fork PRs are rejected synchronously. "+ "A PR whose current commit already has a published review in the requested mode returns "+ "'already_reviewed' without starting a run (resolve_only skips that check, because settling threads "+ "on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. "+ "Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and "+ "whether resolution will run, while the run executes in the worker.",)@action(methods=["POST"], detail=False, required_scopes=["review_hog:write"])def trigger(self, request: Request, **kwargs) -> Response:@@ -795,6 +830,7 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet},status=status.HTTP_400_BAD_REQUEST,)+ requested_at = timezone.now()try:outcome = request_pr_review(team_id=team_id,@@ -815,7 +851,20 @@ class ReviewRecentReviewsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSetstatus=_TRIGGER_REFUSAL_STATUS[outcome.status],)return Response(- ReviewTriggerResponseSerializer({"workflow_id": outcome.workflow_id, "status": outcome.status.value}).data,+ ReviewTriggerResponseSerializer(+ {+ "workflow_id": outcome.workflow_id,+ "status": outcome.status.value,+ "repository": outcome.repository,+ "pr_number": outcome.pr_number,+ "head_sha": outcome.head_sha,+ "review_mode": outcome.review_mode,+ "report_id": outcome.report_id,+ "requested_at": requested_at,+ "resolve_will_run": outcome.resolve_will_run,+ "resolve_skip_reason": outcome.resolve_skip_reason,+ }+ ).data,status=status.HTTP_200_OKif outcome.status == PRReviewRequestStatus.ALREADY_REVIEWEDelse status.HTTP_202_ACCEPTED,diff --git a/products/review_hog/backend/requested_reviews.py b/products/review_hog/backend/requested_reviews.pyindex 4cf7a7b866c7..6b7809a93de5 100644--- a/products/review_hog/backend/requested_reviews.py+++ b/products/review_hog/backend/requested_reviews.py@@ -8,6 +8,8 @@ requester and checked their access to the project.import loggingfrom enum import StrEnum+from django.db import models+from posthog.dataclasses import frozenfrom posthog.models.integration import GitHubIntegration@@ -52,6 +54,14 @@ class PRReviewRequestStatus(StrEnum):REFUSED = "refused"+class ResolveSkipReason(models.TextChoices):+ """Why an accepted request runs no resolution stage."""++ RUN_MODE_EXCLUDES_RESOLVE = "run_mode_excludes_resolve", "The run mode never resolves comments"+ OWNER_NOT_OPTED_IN = "owner_not_opted_in", "The pull request owner has not opted in to resolution"+ ALREADY_REVIEWED = "already_reviewed", "No run starts, because the head already has a review in this mode"++@frozenclass PRReviewRequestOutcome:status: PRReviewRequestStatus@@ -59,6 +69,14 @@ class PRReviewRequestOutcome:# Written for the requester. Built from the repository name, the PR number and fixed text only.error: str = ""refusal: ReviewRequestRefusal | None = None+ repository: str = ""+ pr_number: int | None = None+ head_sha: str | None = None+ # None for a resolve-only run, which reviews nothing.+ review_mode: str | None = None+ # None until the first run of the pull request creates the report.+ report_id: str | None = None+ resolve_skip_reason: ResolveSkipReason | None = None@propertydef started(self) -> bool:@@ -68,6 +86,10 @@ class PRReviewRequestOutcome:PRReviewRequestStatus.ALREADY_REVIEWED,)+ @property+ def resolve_will_run(self) -> bool:+ return self.started and self.resolve_skip_reason is None+def fetch_pr_metadata(github: GitHubIntegration, owner: str, repo: str, pr_number: int) -> PRMetadata:"""One `GET /pulls/{n}` with the installation token — enough to answer the trigger honestly.@@ -85,6 +107,37 @@ def fetch_pr_metadata(github: GitHubIntegration, owner: str, repo: str, pr_numbereturn PRFetcher(owner=owner, repo=repo, pr_number=pr_number, token=token).fetch_pr_metadata(pr)+def owner_allows_resolution(team_id: int, repository: str, pr_meta: PRMetadata) -> bool:+ """Whether the pull request owner opted in to resolution. The resolution run checks again before it writes."""+ pull_request_owner = PullRequestOwnerResolver.resolve(+ team_id, repository=repository, author_login=pr_meta.author, head_branch=pr_meta.head_branch+ )+ return ResolutionGate.load(team_id, pull_request_owner.user_id).allows(REVIEW_MODE_FULL)+++def accepted_outcome(+ *,+ status: PRReviewRequestStatus,+ workflow_id: str,+ repository: str,+ pr_number: int,+ pr_meta: PRMetadata,+ report: ReviewReport | None,+ review_mode: str | None,+ resolve_skip_reason: ResolveSkipReason | None,+) -> PRReviewRequestOutcome:+ return PRReviewRequestOutcome(+ status=status,+ workflow_id=workflow_id,+ repository=repository,+ pr_number=pr_number,+ head_sha=pr_meta.head_sha,+ review_mode=review_mode,+ report_id=str(report.id) if report is not None else None,+ resolve_skip_reason=resolve_skip_reason,+ )++def request_pr_review(*,team_id: int,@@ -150,13 +203,12 @@ def request_pr_review()# Rebuilt canonical URL: the parser accepts trailing paths (e.g. …/pull/123/files).pr_url = f"https://github.com/{owner}/{repo}/pull/{pr_number}"+ # Repository casing can differ per trigger (the report stores whatever its trigger carried).+ report = ReviewReport.objects.for_team(team_id).filter(repository__iexact=repository, pr_number=pr_number).first()if run_mode == RUN_MODE_RESOLVE_ONLY:- # Checked here so the requester sees the answer. The resolution run checks again before it writes.- pull_request_owner = PullRequestOwnerResolver.resolve(- team_id, repository=repository, author_login=pr_meta.author, head_branch=pr_meta.head_branch- )- if not ResolutionGate.load(team_id, pull_request_owner.user_id).allows(REVIEW_MODE_FULL):+ # Checked here so the requester sees the answer.+ if not owner_allows_resolution(team_id, repository, pr_meta):return PRReviewRequestOutcome(status=PRReviewRequestStatus.REFUSED,error="Comments are resolved only on pull requests whose owner turned on resolving comments "@@ -175,10 +227,17 @@ def request_pr_review(logger.info(f"ReviewHog {trigger_source} trigger started resolution {workflow_id} for {pr_url} by user {requester_id}")- return PRReviewRequestOutcome(status=PRReviewRequestStatus.STARTED, workflow_id=workflow_id)+ return accepted_outcome(+ status=PRReviewRequestStatus.STARTED,+ workflow_id=workflow_id,+ repository=repository,+ pr_number=pr_number,+ pr_meta=pr_meta,+ report=report,+ review_mode=None,+ resolve_skip_reason=None,+ )- # Repository casing can differ per trigger (the report stores whatever its trigger carried).- report = ReviewReport.objects.for_team(team_id).filter(repository__iexact=repository, pr_number=pr_number).first()review_mode = REVIEW_MODE_FLASH if run_mode == RUN_MODE_FLASH else REVIEW_MODE_FULLif flash_refusal(report, review_mode) is not None:return PRReviewRequestOutcome(@@ -190,7 +249,24 @@ def request_pr_review(if report is not None and review_already_published(report, pr_meta.head_sha or "", review_mode):# The workflow would early-exit before resolving the acting user anyway — say so instead# of answering "started" for a run that will do nothing.- return PRReviewRequestOutcome(status=PRReviewRequestStatus.ALREADY_REVIEWED)+ return accepted_outcome(+ status=PRReviewRequestStatus.ALREADY_REVIEWED,+ workflow_id="",+ repository=repository,+ pr_number=pr_number,+ pr_meta=pr_meta,+ report=report,+ review_mode=review_mode,+ resolve_skip_reason=ResolveSkipReason.RUN_MODE_EXCLUDES_RESOLVE+ if run_mode != RUN_MODE_REVIEW+ else ResolveSkipReason.ALREADY_REVIEWED,+ )+ if run_mode != RUN_MODE_REVIEW:+ resolve_skip_reason: ResolveSkipReason | None = ResolveSkipReason.RUN_MODE_EXCLUDES_RESOLVE+ elif owner_allows_resolution(team_id, repository, pr_meta):+ resolve_skip_reason = None+ else:+ resolve_skip_reason = ResolveSkipReason.OWNER_NOT_OPTED_IN# Probed before the start: a same-id start joins the running turn, whose inputs keep the# original trigger, so the requester's tier lift has to be written here (see the helper).joins_running_review = workflow_running(@@ -217,8 +293,19 @@ def request_pr_review(logger.info(f"ReviewHog {trigger_source} trigger joined running workflow {workflow_id} for {pr_url} (tier lifted={lifted})")- return PRReviewRequestOutcome(status=PRReviewRequestStatus.JOINED_RUNNING_REVIEW, workflow_id=workflow_id)- logger.info(- f"ReviewHog {trigger_source} trigger started workflow {workflow_id} for {pr_url} by user {requester_id}"+ outcome_status = PRReviewRequestStatus.JOINED_RUNNING_REVIEW+ else:+ logger.info(+ f"ReviewHog {trigger_source} trigger started workflow {workflow_id} for {pr_url} by user {requester_id}"+ )+ outcome_status = PRReviewRequestStatus.STARTED+ return accepted_outcome(+ status=outcome_status,+ workflow_id=workflow_id,+ repository=repository,+ pr_number=pr_number,+ pr_meta=pr_meta,+ report=report,+ review_mode=review_mode,+ resolve_skip_reason=resolve_skip_reason,)- return PRReviewRequestOutcome(status=PRReviewRequestStatus.STARTED, workflow_id=workflow_id)diff --git a/products/review_hog/backend/tests/test_ui_trigger_api.py b/products/review_hog/backend/tests/test_ui_trigger_api.pyindex 6a4091914119..aff069e75a02 100644--- a/products/review_hog/backend/tests/test_ui_trigger_api.py+++ b/products/review_hog/backend/tests/test_ui_trigger_api.py@@ -1,5 +1,6 @@from uuid import uuid4+import time_machinefrom posthog.test.base import APIBaseTestfrom unittest.mock import MagicMock, patch@@ -52,6 +53,7 @@ class TestReviewHogUiTriggerApi(APIBaseTest):body["run_mode"] = run_modereturn self.client.post(f"/api/projects/{self.team.id}/review_hog/reviews/trigger/", body, format="json")+ @time_machine.travel("2026-10-10T12:00:00Z", tick=False)@patch(_META, return_value=_pr_meta())@patch(_ACCESS, return_value=object())@patch(_START, return_value="wf-ui-1")@@ -66,7 +68,23 @@ class TestReviewHogUiTriggerApi(APIBaseTest):resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123/files")self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED, resp.content)- self.assertEqual(resp.json(), {"workflow_id": "wf-ui-1", "status": "started"})+ # A first run has no report yet, and an author with no linked PostHog user owns nothing, so+ # nobody opted in to resolution.+ self.assertEqual(+ resp.json(),+ {+ "workflow_id": "wf-ui-1",+ "status": "started",+ "repository": "PostHog/posthog.com",+ "pr_number": 123,+ "head_sha": "abc123",+ "review_mode": "full",+ "report_id": None,+ "requested_at": "2026-10-10T12:00:00Z",+ "resolve_will_run": False,+ "resolve_skip_reason": "owner_not_opted_in",+ },+ )mock_access.assert_called_once_with(self.team.id, "PostHog/posthog.com")mock_start.assert_called_once_with(pr_url="https://github.com/PostHog/posthog.com/pull/123",@@ -106,6 +124,51 @@ class TestReviewHogUiTriggerApi(APIBaseTest):self.assertEqual(mock_start.call_args.kwargs["review_mode"], expected_review_mode)mock_start_resolution.assert_not_called()+ @parameterized.expand(+ [+ ("owner_opted_in", "review", True, True, None),+ ("review_only_never_resolves", "review_only", True, False, "run_mode_excludes_resolve"),+ ("owner_not_opted_in", "review", False, False, "owner_not_opted_in"),+ ]+ )+ @patch(_META, return_value=_pr_meta(head_sha="def456"))+ @patch(_ACCESS, return_value=object())+ @patch(_START, return_value="wf-ui-1")+ def test_trigger_says_which_head_and_report_it_targets_and_whether_resolve_runs(+ self,+ _name: str,+ run_mode: str,+ owner_opted_in: bool,+ resolve_will_run: bool,+ resolve_skip_reason: str | None,+ _mock_start: MagicMock,+ _mock_access: MagicMock,+ _mock_meta: MagicMock,+ ) -> None:+ UserSocialAuth.objects.create(user=self.user, provider="github", uid="gh-1", extra_data={"login": "octocat"})+ ReviewUserSettings.objects.for_team(self.team.id).create(+ team_id=self.team.id, user_id=self.user.id, preferences={"resolve_comments": owner_opted_in}+ )+ report = ReviewReport.objects.for_team(self.team.id).create(+ team_id=self.team.id,+ repository="posthog/posthog.com",+ pr_number=123,+ head_branch="feature",+ base_branch="master",+ published_head_sha="abc123",+ )++ resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123/files", run_mode=run_mode)++ self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED, resp.content)+ body = resp.json()+ self.assertEqual(+ {key: body[key] for key in ("repository", "pr_number", "head_sha", "report_id")},+ {"repository": "PostHog/posthog.com", "pr_number": 123, "head_sha": "def456", "report_id": str(report.id)},+ )+ self.assertEqual(body["resolve_will_run"], resolve_will_run)+ self.assertEqual(body["resolve_skip_reason"], resolve_skip_reason)+@patch(_META, return_value=_pr_meta(author="teammate"))@patch(_ACCESS, return_value=object())@patch(_START_RESOLUTION, return_value="wf-resolve-1")@@ -237,7 +300,7 @@ class TestReviewHogUiTriggerApi(APIBaseTest):# Settling threads on a reviewed head is resolve-only's whole point: the already_reviewed# early-return must not apply, and no review workflow may start. A published-at-head report# is exactly the state a "Review" click would refuse.- ReviewReport.objects.for_team(self.team.id).create(+ report = ReviewReport.objects.for_team(self.team.id).create(team_id=self.team.id,repository="posthog/posthog.com",pr_number=123,@@ -249,7 +312,17 @@ class TestReviewHogUiTriggerApi(APIBaseTest):resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123/files", run_mode="resolve_only")self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED, resp.content)- self.assertEqual(resp.json(), {"workflow_id": "wf-resolve-1", "status": "started"})+ body = resp.json()+ self.assertEqual(+ {key: body[key] for key in ("workflow_id", "status", "review_mode", "report_id", "resolve_will_run")},+ {+ "workflow_id": "wf-resolve-1",+ "status": "started",+ "review_mode": None,+ "report_id": str(report.id),+ "resolve_will_run": True,+ },+ )mock_start.assert_not_called()mock_start_resolution.assert_called_once_with(pr_url="https://github.com/PostHog/posthog.com/pull/123",@@ -332,7 +405,8 @@ class TestReviewHogUiTriggerApi(APIBaseTest):resp = self._trigger("https://github.com/PostHog/posthog.com/pull/123", run_mode=run_mode)self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED, resp.content)- self.assertEqual(resp.json(), {"workflow_id": "wf-ui-1", "status": "joined_running_review"})+ self.assertEqual(resp.json()["workflow_id"], "wf-ui-1")+ self.assertEqual(resp.json()["status"], "joined_running_review")mock_start.assert_called_once()report.refresh_from_db()self.assertEqual(report.review_tier, expected_tier.value)@@ -472,7 +546,7 @@ class TestReviewHogUiTriggerApi(APIBaseTest):_mock_access,_mock_meta,):- ReviewReport.objects.for_team(self.team.id).create(+ report = ReviewReport.objects.for_team(self.team.id).create(team_id=self.team.id,repository="posthog/posthog.com",pr_number=123,@@ -486,6 +560,7 @@ class TestReviewHogUiTriggerApi(APIBaseTest):self.assertEqual(resp.status_code, expected_status, resp.content)self.assertEqual(resp.json()["status"], expected_marker)+ self.assertEqual(resp.json()["report_id"], str(report.id))self.assertEqual(mock_start.called, starts)@parameterized.expand(diff --git a/products/review_hog/frontend/generated/api.schemas.ts b/products/review_hog/frontend/generated/api.schemas.tsindex e4321dc5d7ec..91d895bade46 100644--- a/products/review_hog/frontend/generated/api.schemas.ts+++ b/products/review_hog/frontend/generated/api.schemas.ts@@ -1062,11 +1062,65 @@ export interface ReviewTriggerRequestApi {run_mode?: ReviewTriggerRequestRunModeEnumApi}+/**+ * * `full` - Deep+ * * `flash` - Standard+ */+export type ReviewTriggerReviewModeEnumApi =+ (typeof ReviewTriggerReviewModeEnumApi)[keyof typeof ReviewTriggerReviewModeEnumApi]++export const ReviewTriggerReviewModeEnumApi = {+ Full: 'full',+ Flash: 'flash',+} as const++/**+ * * `run_mode_excludes_resolve` - The run mode never resolves comments+ * * `owner_not_opted_in` - The pull request owner has not opted in to resolution+ * * `already_reviewed` - No run starts, because the head already has a review in this mode+ */+export type ResolveSkipReasonEnumApi = (typeof ResolveSkipReasonEnumApi)[keyof typeof ResolveSkipReasonEnumApi]++export const ResolveSkipReasonEnumApi = {+ RunModeExcludesResolve: 'run_mode_excludes_resolve',+ OwnerNotOptedIn: 'owner_not_opted_in',+ AlreadyReviewed: 'already_reviewed',+} as const+export interface ReviewTriggerResponseApi {/** Temporal workflow id for the started review run; empty when no run was started. */workflow_id: string- /** Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the pull request's current commit already has a published review in the requested mode, 'joined_running_review' when a review was already in flight and the request joined its queue. A requested Deep review waits for an active Standard review. */+ /** Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the pull request's current commit already has a published review in the requested mode, 'joined_running_review' when a review was already running and the request was queued on that pull request's run, to start after the running turn. A requested Deep review waits for an active Standard review. */status: string+ /** The pull request's repository as 'owner/repo'. */+ repository: string+ /** The pull request number. */+ pr_number: number+ /**+ * The pull request's head commit when the request was accepted.+ * @nullable+ */+ head_sha: string | null+ /** The review this request runs: 'full' (Deep) or 'flash' (Standard). Null for 'resolve_only', which runs no review.+ *+ * * `full` - Deep+ * * `flash` - Standard */+ review_mode: ReviewTriggerReviewModeEnumApi | null+ /**+ * Id of the pull request's existing review, for `review-hog-reviews-get`. Null on the pull request's first run, which creates the review later.+ * @nullable+ */+ report_id: string | null+ /** Server time when the request was accepted. */+ requested_at: string+ /** Whether this request runs the resolution stage, which can push fix commits to the pull request. */+ resolve_will_run: boolean+ /** Why the resolution stage does not run: 'run_mode_excludes_resolve' ('review_only' and 'flash' never resolve), 'owner_not_opted_in' (the pull request owner has not turned on resolving comments), 'already_reviewed' (no run starts). Null when it runs.+ *+ * * `run_mode_excludes_resolve` - The run mode never resolves comments+ * * `owner_not_opted_in` - The pull request owner has not opted in to resolution+ * * `already_reviewed` - No run starts, because the head already has a review in this mode */+ resolve_skip_reason: ResolveSkipReasonEnumApi | null}/**diff --git a/products/review_hog/frontend/generated/api.ts b/products/review_hog/frontend/generated/api.tsindex 4537e8e89f49..6310725d036a 100644--- a/products/review_hog/frontend/generated/api.ts+++ b/products/review_hog/frontend/generated/api.ts@@ -626,7 +626,7 @@ export const getReviewHogReviewsTriggerCreateUrl = (projectId: string) => {}/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The requesting user is the review's acting user: their enabled perspectives, blind-spot check, validator, and urgency threshold drive the run, and it appears under their recent reviews. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: a review (which chains the resolution stage per the owner's resolve_comments setting), a review without resolving, resolution only, or a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously; a PR whose current commit already has a published review returns 'already_reviewed' without starting a run (resolve_only skips that check — settling threads on a reviewed head is its whole point), and triggering a PR whose run is currently in flight joins that run. Otherwise non-blocking: returns the Temporal workflow id immediately while the run executes in the worker.+ * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const reviewHogReviewsTriggerCreate = async (diff --git a/products/review_hog/frontend/generated/api.zod.ts b/products/review_hog/frontend/generated/api.zod.tsindex 4a5075bc9854..8953c753e2b1 100644--- a/products/review_hog/frontend/generated/api.zod.ts+++ b/products/review_hog/frontend/generated/api.zod.ts@@ -213,7 +213,7 @@ export const ReviewHogResolutionPartialUpdateBody = /* @__PURE__ */ zod.object({})/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The requesting user is the review's acting user: their enabled perspectives, blind-spot check, validator, and urgency threshold drive the run, and it appears under their recent reviews. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: a review (which chains the resolution stage per the owner's resolve_comments setting), a review without resolving, resolution only, or a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously; a PR whose current commit already has a published review returns 'already_reviewed' without starting a run (resolve_only skips that check — settling threads on a reviewed head is its whole point), and triggering a PR whose run is currently in flight joins that run. Otherwise non-blocking: returns the Temporal workflow id immediately while the run executes in the worker.+ * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const reviewHogReviewsTriggerCreateBodyRunModeDefault = `review`diff --git a/products/review_hog/mcp/tools.yaml b/products/review_hog/mcp/tools.yamlindex 5f119425bb04..8aaa4ea27960 100644--- a/products/review_hog/mcp/tools.yaml+++ b/products/review_hog/mcp/tools.yaml@@ -18,10 +18,11 @@ tools:idempotent: truetitle: Get a ReviewHog reviewdescription: >- Fetch one completed ReviewHog review by `id` (from `review-hog-reviews-list`), including the latest turn's- validated `findings` (each with file, line ranges, priority, and the suggested fix), the- `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. A first- review still in flight has no detail yet — poll `review-hog-reviews-list` until it completes.+ Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns+ the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested+ fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR.+ While a re-review runs, the findings are still the previous turn's. A first review that is still running has+ no detail yet, so poll `review-hog-reviews-list` until it completes.feature_flag: review-hogreview-hog-reviews-list:operation: review_hog_reviews_list@@ -35,12 +36,12 @@ tools:list: truetitle: List ReviewHog reviewsdescription: >- List recent ReviewHog reviews on this project — use it to poll a review's status. Running reviews come- first, each with `in_progress: true` and a `progress` object (the in-flight turn's `review_stage` plus- `done`/`total` counters); completed reviews follow, newest first, with their finding counts by priority- (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id`- opens the full review via `review-hog-reviews-get`. Defaults to the requesting user's reviews; pass- `scope=everyone` for every review on the project, and `limit` to widen the page.+ List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first,+ each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total`+ counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`,+ `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full+ review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull+ requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.feature_flag: review-hogreview-hog-reviews-trigger:operation: review_hog_reviews_trigger_create@@ -54,17 +55,22 @@ tools:title: Trigger a ReviewHog reviewdescription: >Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g.- `https://github.com/PostHog/posthog/pull/123`); the repository must be accessible to the project's GitHub- App installation. `run_mode` picks the variant: `review` (the default) reviews the PR, publishes the review- to it, and then chains the comment-resolution stage when the requesting user's `resolve_comments` setting is- on; `review_only` reviews without resolving; `resolve_only` skips the review and only works the PR's- existing unresolved review threads; `flash` runs a Standard review, published on a lower-cost model, and- never resolves comments or pushes fixes. IMPORTANT: resolve-capable runs write to the PR itself. They may- push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads.- Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR.- Non-blocking: returns a `workflow_id` and `status` of `started` while the run executes. If the PR's current- commit already has a published review it returns `already_reviewed` without starting a run (`resolve_only`- skips that check, since resolving is useful exactly then), and triggering a PR whose review is already- running joins the in-flight run. Poll progress with `review-hog-reviews-list` and read the finished findings- with `review-hog-reviews-get`.+ `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub+ App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the+ PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard+ review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's+ existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving+ comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app+ opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why+ not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to+ review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but+ the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`,+ `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the+ PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a+ published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only`+ skips that check). A request while a review runs is queued on that PR's run and returns+ `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for+ `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409+ without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. Poll+ progress with `review-hog-reviews-list` and read the findings with `review-hog-reviews-get`.feature_flag: review-hogdiff --git a/products/stamphog/backend/facade/enums.py b/products/stamphog/backend/facade/enums.pyindex 76bb84973572..6bf17a4bd0f1 100644--- a/products/stamphog/backend/facade/enums.py+++ b/products/stamphog/backend/facade/enums.py@@ -8,12 +8,14 @@ the implementation (logic/, models.py).from enum import StrEnum+from posthog.enums import LabeledStrEnum-class ReviewMode(StrEnum):++class ReviewMode(LabeledStrEnum):# Every relevant PR event triggers a review (the default).- ALL = "all"+ ALL = "all", "All pull requests"# Reviews run only for PRs carrying the repo's trigger label (Action-style opt-in).- LABEL = "label"+ LABEL = "label", "Labeled pull requests"class ReviewRunStatus(StrEnum):diff --git a/products/stamphog/backend/presentation/serializers.py b/products/stamphog/backend/presentation/serializers.pyindex 1ab566b40c9c..31c68ede0854 100644--- a/products/stamphog/backend/presentation/serializers.py+++ b/products/stamphog/backend/presentation/serializers.py@@ -98,7 +98,7 @@ class StamphogRepoConfigSerializer(DataclassSerializer):return fieldsreview_mode = serializers.ChoiceField(- choices=[(m.value, m.value) for m in ReviewMode],+ choices=ReviewMode.choices,read_only=True,help_text=("When reviews run: 'all' reviews every pull request (the default); 'label' reviews "@@ -739,7 +739,7 @@ class StamphogRepoConfigWriteSerializer(serializers.Serializer):required=False, help_text="Whether merged PRs on this repo are captured for the daily Slack digest.")review_mode = serializers.ChoiceField(- choices=[(m.value, m.value) for m in ReviewMode],+ choices=ReviewMode.choices,required=False,help_text=("When reviews run: 'all' reviews every pull request (the default); 'label' reviews "diff --git a/products/stamphog/frontend/generated/api.schemas.ts b/products/stamphog/frontend/generated/api.schemas.tsindex cbd24c64ba3a..4580d9ca129c 100644--- a/products/stamphog/frontend/generated/api.schemas.ts+++ b/products/stamphog/frontend/generated/api.schemas.ts@@ -155,8 +155,8 @@ export interface PaginatedStamphogPullRequestListApi {}/**- * * `all` - all- * * `label` - label+ * * `all` - All pull requests+ * * `label` - Labeled pull requests*/export type ReviewModeEnumApi = (typeof ReviewModeEnumApi)[keyof typeof ReviewModeEnumApi]@@ -179,8 +179,8 @@ export interface StamphogRepoConfigApi {digest_enabled?: boolean/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */readonly review_mode: ReviewModeEnumApi/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: string@@ -225,8 +225,8 @@ export interface StamphogRepoConfigWriteApi {digest_enabled?: boolean/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */review_mode?: ReviewModeEnumApi/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: string@@ -255,8 +255,8 @@ export interface PatchedStamphogRepoConfigWriteApi {digest_enabled?: boolean/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */review_mode?: ReviewModeEnumApi/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: stringdiff --git a/products/stamphog/frontend/generated/api.zod.ts b/products/stamphog/frontend/generated/api.zod.tsindex dfc42232f30e..bc9d2bd56b6f 100644--- a/products/stamphog/frontend/generated/api.zod.ts+++ b/products/stamphog/frontend/generated/api.zod.ts@@ -23,10 +23,10 @@ export const StamphogRepoConfigsCreateBody = /* @__PURE__ */ zod.describe('Whether merged PRs on this repo are captured for the daily Slack digest.'),review_mode: zod.enum(['all', 'label'])- .describe('\* `all` - all\n\* `label` - label')+ .describe('\* `all` - All pull requests\n\* `label` - Labeled pull requests').optional().describe(- "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - all\n\* `label` - label"+ "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - All pull requests\n\* `label` - Labeled pull requests"),trigger_label: zod.string()@@ -51,10 +51,10 @@ export const StamphogRepoConfigsUpdateBody = /* @__PURE__ */ zod.describe('Whether merged PRs on this repo are captured for the daily Slack digest.'),review_mode: zod.enum(['all', 'label'])- .describe('\* `all` - all\n\* `label` - label')+ .describe('\* `all` - All pull requests\n\* `label` - Labeled pull requests').optional().describe(- "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - all\n\* `label` - label"+ "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - All pull requests\n\* `label` - Labeled pull requests"),trigger_label: zod.string()@@ -79,10 +79,10 @@ export const StamphogRepoConfigsPartialUpdateBody = /* @__PURE__ */ zod.describe('Whether merged PRs on this repo are captured for the daily Slack digest.'),review_mode: zod.enum(['all', 'label'])- .describe('\* `all` - all\n\* `label` - label')+ .describe('\* `all` - All pull requests\n\* `label` - Labeled pull requests').optional().describe(- "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - all\n\* `label` - label"+ "When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.\n\n\* `all` - All pull requests\n\* `label` - Labeled pull requests"),trigger_label: zod.string()diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 66ec2e3cfcd0..fae4104331ef 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -10975,7 +10975,7 @@"feature_flag": "notebook-generated-widgets"},"review-hog-reviews-get": {- "description": "Fetch one completed ReviewHog review by `id` (from `review-hog-reviews-list`), including the latest turn's validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. A first review still in flight has no detail yet — poll `review-hog-reviews-list` until it completes.",+ "description": "Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.","category": "ReviewHog","feature": "review_hog","summary": "Get a ReviewHog review",@@ -10990,7 +10990,7 @@"feature_flag": "review-hog"},"review-hog-reviews-list": {- "description": "List recent ReviewHog reviews on this project — use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the in-flight turn's `review_stage` plus `done`/`total` counters); completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review via `review-hog-reviews-get`. Defaults to the requesting user's reviews; pass `scope=everyone` for every review on the project, and `limit` to widen the page.",+ "description": "List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.","category": "ReviewHog","feature": "review_hog","summary": "List ReviewHog reviews",@@ -11005,7 +11005,7 @@"feature_flag": "review-hog"},"review-hog-reviews-trigger": {- "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`); the repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) reviews the PR, publishes the review to it, and then chains the comment-resolution stage when the requesting user's `resolve_comments` setting is on; `review_only` reviews without resolving; `resolve_only` skips the review and only works the PR's existing unresolved review threads; `flash` runs a Standard review, published on a lower-cost model, and never resolves comments or pushes fixes. IMPORTANT: resolve-capable runs write to the PR itself. They may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns a `workflow_id` and `status` of `started` while the run executes. If the PR's current commit already has a published review it returns `already_reviewed` without starting a run (`resolve_only` skips that check, since resolving is useful exactly then), and triggering a PR whose review is already running joins the in-flight run. Poll progress with `review-hog-reviews-list` and read the finished findings with `review-hog-reviews-get`.",+ "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. Poll progress with `review-hog-reviews-list` and read the findings with `review-hog-reviews-get`.","category": "ReviewHog","feature": "review_hog","summary": "Trigger a ReviewHog review",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 1cc1a43af03a..bad77113ddb4 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -11580,7 +11580,7 @@"feature_flag": "notebook-generated-widgets"},"review-hog-reviews-get": {- "description": "Fetch one completed ReviewHog review by `id` (from `review-hog-reviews-list`), including the latest turn's validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. A first review still in flight has no detail yet — poll `review-hog-reviews-list` until it completes.",+ "description": "Fetch one ReviewHog review by `id` (from `review-hog-reviews-list` or the trigger's `report_id`). It returns the last completed turn: its validated `findings` (each with file, line ranges, priority, and the suggested fix), the `dismissed_findings` the validator dropped and why, and the `report_markdown` published to the PR. While a re-review runs, the findings are still the previous turn's. A first review that is still running has no detail yet, so poll `review-hog-reviews-list` until it completes.","category": "ReviewHog","feature": "review_hog","summary": "Get a ReviewHog review",@@ -11595,7 +11595,7 @@"feature_flag": "review-hog"},"review-hog-reviews-list": {- "description": "List recent ReviewHog reviews on this project — use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the in-flight turn's `review_stage` plus `done`/`total` counters); completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review via `review-hog-reviews-get`. Defaults to the requesting user's reviews; pass `scope=everyone` for every review on the project, and `limit` to widen the page.",+ "description": "List recent ReviewHog reviews on this project. Use it to poll a review's status. Running reviews come first, each with `in_progress: true` and a `progress` object (the running turn's `review_stage` plus `done`/`total` counters). Completed reviews follow, newest first, with their finding counts by priority (`must_fix_count`, `should_fix_count`, `consider_count`) and whether they were `published`. Each row's `id` opens the full review with `review-hog-reviews-get`. The default `scope=mine` covers reviews you ran plus reviews of pull requests you authored. Pass `scope=everyone` for every review on the project, and `limit` to widen the page.","category": "ReviewHog","feature": "review_hog","summary": "List ReviewHog reviews",@@ -11610,7 +11610,7 @@"feature_flag": "review-hog"},"review-hog-reviews-trigger": {- "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`); the repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) reviews the PR, publishes the review to it, and then chains the comment-resolution stage when the requesting user's `resolve_comments` setting is on; `review_only` reviews without resolving; `resolve_only` skips the review and only works the PR's existing unresolved review threads; `flash` runs a Standard review, published on a lower-cost model, and never resolves comments or pushes fixes. IMPORTANT: resolve-capable runs write to the PR itself. They may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns a `workflow_id` and `status` of `started` while the run executes. If the PR's current commit already has a published review it returns `already_reviewed` without starting a run (`resolve_only` skips that check, since resolving is useful exactly then), and triggering a PR whose review is already running joins the in-flight run. Poll progress with `review-hog-reviews-list` and read the finished findings with `review-hog-reviews-get`.",+ "description": "Start a ReviewHog run on a pull request. Pass the PR as `pr_url` (e.g. `https://github.com/PostHog/posthog/pull/123`). The repository must be accessible to the project's GitHub App installation. `run_mode` picks the variant: `review` (the default) is a Deep review, published to the PR, followed by the Resolve stage; `review_only` is a Deep review without Resolve; `flash` is a Standard review on a lower-cost model that never resolves; `resolve_only` skips the review and only works the PR's existing unresolved review threads. Resolve runs only when the pull request owner opted in to resolving comments, not the requester. The owner is the PR author, or the Inbox reviewer for a PR the PostHog app opened. The response's `resolve_will_run` says whether Resolve will run, and `resolve_skip_reason` says why not. IMPORTANT: Resolve writes to the PR itself. It may push signed fix commits to the PR's branch, reply to review threads, and resolve bot-authored threads. Nothing is deleted and the commits are plain appends, but the actions are public to everyone on the PR. Non-blocking: returns `status` `started`, with `repository`, `pr_number`, the `head_sha` the request targets, `review_mode`, `requested_at`, and `report_id` (null on the PR's first run; find it later with `review-hog-reviews-list`). If the PR's current commit already has a published review in the requested mode, it returns `already_reviewed` without starting a run (`resolve_only` skips that check). A request while a review runs is queued on that PR's run and returns `joined_running_review`. Refusals: 409 with `code` `flash_after_full` (the PR has a Deep review, so ask for `review` instead) or `resolution_not_opted_in` (`resolve_only` on a PR whose owner did not opt in); 409 without a code while Resolve runs on the PR, or while a review runs for a `resolve_only` request. Poll progress with `review-hog-reviews-list` and read the findings with `review-hog-reviews-get`.","category": "ReviewHog","feature": "review_hog","summary": "Trigger a ReviewHog review",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex c40c3f1443e0..144409b54d87 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -73093,8 +73093,8 @@ export namespace Schemas {}/**- * * `all` - all- * * `label` - label+ * * `all` - All pull requests+ * * `label` - Labeled pull requests*/export type ReviewModeEnum = typeof ReviewModeEnum[keyof typeof ReviewModeEnum];@@ -73118,8 +73118,8 @@ export namespace Schemas {digest_enabled?: boolean;/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */readonly review_mode: ReviewModeEnum;/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: string;@@ -83681,8 +83681,8 @@ export namespace Schemas {digest_enabled?: boolean;/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */review_mode?: ReviewModeEnum;/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: string;@@ -94577,6 +94577,20 @@ export namespace Schemas {Stopped: 'stopped',} as const;+ /**+ * * `run_mode_excludes_resolve` - The run mode never resolves comments+ * * `owner_not_opted_in` - The pull request owner has not opted in to resolution+ * * `already_reviewed` - No run starts, because the head already has a review in this mode+ */+ export type ResolveSkipReasonEnum = typeof ResolveSkipReasonEnum[keyof typeof ResolveSkipReasonEnum];+++ export const ResolveSkipReasonEnum = {+ RunModeExcludesResolve: 'run_mode_excludes_resolve',+ OwnerNotOptedIn: 'owner_not_opted_in',+ AlreadyReviewed: 'already_reviewed',+ } as const;+/*** * `likely_active_soon` - Likely Active Soon* * `at_risk_of_inactivity` - At Risk Of Inactivity@@ -95996,11 +96010,52 @@ export namespace Schemas {run_mode?: ReviewTriggerRequestRunModeEnum;}+ /**+ * * `full` - Deep+ * * `flash` - Standard+ */+ export type ReviewTriggerReviewModeEnum = typeof ReviewTriggerReviewModeEnum[keyof typeof ReviewTriggerReviewModeEnum];+++ export const ReviewTriggerReviewModeEnum = {+ Full: 'full',+ Flash: 'flash',+ } as const;+export interface ReviewTriggerResponse {/** Temporal workflow id for the started review run; empty when no run was started. */workflow_id: string;- /** Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the pull request's current commit already has a published review in the requested mode, 'joined_running_review' when a review was already in flight and the request joined its queue. A requested Deep review waits for an active Standard review. */+ /** Run lifecycle marker: 'started' when the review was queued, 'already_reviewed' when the pull request's current commit already has a published review in the requested mode, 'joined_running_review' when a review was already running and the request was queued on that pull request's run, to start after the running turn. A requested Deep review waits for an active Standard review. */status: string;+ /** The pull request's repository as 'owner/repo'. */+ repository: string;+ /** The pull request number. */+ pr_number: number;+ /**+ * The pull request's head commit when the request was accepted.+ * @nullable+ */+ head_sha: string | null;+ /** The review this request runs: 'full' (Deep) or 'flash' (Standard). Null for 'resolve_only', which runs no review.+ *+ * * `full` - Deep+ * * `flash` - Standard */+ review_mode: ReviewTriggerReviewModeEnum | null;+ /**+ * Id of the pull request's existing review, for `review-hog-reviews-get`. Null on the pull request's first run, which creates the review later.+ * @nullable+ */+ report_id: string | null;+ /** Server time when the request was accepted. */+ requested_at: string;+ /** Whether this request runs the resolution stage, which can push fix commits to the pull request. */+ resolve_will_run: boolean;+ /** Why the resolution stage does not run: 'run_mode_excludes_resolve' ('review_only' and 'flash' never resolve), 'owner_not_opted_in' (the pull request owner has not turned on resolving comments), 'already_reviewed' (no run starts). Null when it runs.+ *+ * * `run_mode_excludes_resolve` - The run mode never resolves comments+ * * `owner_not_opted_in` - The pull request owner has not opted in to resolution+ * * `already_reviewed` - No run starts, because the head already has a review in this mode */+ resolve_skip_reason: ResolveSkipReasonEnum | null;}export interface ReviewUserSettings {@@ -105555,8 +105610,8 @@ export namespace Schemas {digest_enabled?: boolean;/** When reviews run: 'all' reviews every pull request (the default); 'label' reviews only pull requests carrying the trigger label, mirroring the Action's opt-in flow.*- * * `all` - all- * * `label` - label */+ * * `all` - All pull requests+ * * `label` - Labeled pull requests */review_mode?: ReviewModeEnum;/** Pull request label that triggers a review when review_mode is 'label'. Defaults to 'stamphog'. */trigger_label?: string;diff --git a/services/mcp/src/generated/review_hog/api.ts b/services/mcp/src/generated/review_hog/api.tsindex a1459caa33c9..f2be9ed564f4 100644--- a/services/mcp/src/generated/review_hog/api.ts+++ b/services/mcp/src/generated/review_hog/api.ts@@ -56,7 +56,7 @@ export const ReviewHogReviewsRetrieveParams = () => zod.object({})/**- * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The requesting user is the review's acting user: their enabled perspectives, blind-spot check, validator, and urgency threshold drive the run, and it appears under their recent reviews. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: a review (which chains the resolution stage per the owner's resolve_comments setting), a review without resolving, resolution only, or a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously; a PR whose current commit already has a published review returns 'already_reviewed' without starting a run (resolve_only skips that check — settling threads on a reviewed head is its whole point), and triggering a PR whose run is currently in flight joins that run. Otherwise non-blocking: returns the Temporal workflow id immediately while the run executes in the worker.+ * Start a ReviewHog review of any pull request the project's GitHub App installation can access, and publish it back to the PR. The run appears under the requesting user's recent reviews. A Deep review uses the requester's enabled perspectives, blind-spot check, validator, and urgency threshold; a Standard review uses none of them. Resolution writes to the branch only when the pull request owner opted in, whoever asks. `run_mode` picks the variant: 'review' is a Deep review that chains the resolution stage per the owner's resolve_comments setting, 'review_only' is a Deep review without resolving, 'resolve_only' runs resolution only, and 'flash' is a lower-cost Standard review that never resolves comments and is refused after a published Deep review. Nonexistent, closed, and fork PRs are rejected synchronously. A PR whose current commit already has a published review in the requested mode returns 'already_reviewed' without starting a run (resolve_only skips that check, because settling threads on a reviewed head is its whole point). A request while a review runs is queued on that PR's run. Otherwise non-blocking: returns immediately with the PR's head, the review's id when one exists, and whether resolution will run, while the run executes in the worker.* @summary Start a review of a pull request*/export const ReviewHogReviewsTriggerCreateParams = () => zod.object({