Skip to content

: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.

feat(review_hog): describe Standard reviews in the review drawer as they ran (#114911)

Julian Bez1d048d30c897
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 8185272edef3..7c099568d73a 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -14559,13 +14559,21 @@ snapshots:
scenes-code-review--flag-disabled-for-staff--light:
hash: v1.k794b7964.a71251e301794f51a0a9140ab1442fada37b1cc0fb54095a5eb19499e0cb1b34.3GhhJCqNfLkY2WdBTTn0LHJifxiCqyEJ7viaHaoCoGA
scenes-code-review--narrow--dark:
- hash: v1.k794b7964.f41e442041cfbc73be732a84d6e2084588c1feb432feb29f241ce8fe95e61fb3.oA5ZbVIlc4hgY5lbsFa5YIlslR7ZX5DFESr3UPaPKe0
+ hash: v1.k794b7964.5c511c2c23d0f62b5341d355884ec1dd55d78daba0d5a57b288ea800ab7259af.dFLrjO1GHVsOIab7mzozoXFiBQyPne7TNYZ5xodTG4A
scenes-code-review--narrow--light:
- hash: v1.k794b7964.91f0cae5764c91e6cdedcce4a07b79733f7a838485a72ab62c37cb4030cdcc0d.-fxrrp8Nk5gjXCEVSe0l19hr70rF3Ppkk-8zb3P8X18
+ hash: v1.k794b7964.3f623416d580dbc799c05c0c71cb56a4d12db877c984c482a447fe91fd8c66f0.f4ZkK14Qjd5x3d7u7lstnxUc0z04MadleQL2KpFhNG4
scenes-code-review--narrow-settings--dark:
hash: v1.k794b7964.30e27208a1f2cd718962075ca898f14bd761e441ce9036b5ce1399fe2cdbe8e9.Per5PlPRaSDZNkhiLwOJcA_mfCNaA3JGY5USALMsd10
scenes-code-review--narrow-settings--light:
hash: v1.k794b7964.b5b6931c1780d1f0208323cc930d8983e95cb1a63cdeaf9efb9206d3298e6c98.d9mwbeuHYVDPANqB6KZ_ds9NM0ApXckCMMR0iepHugs
+ scenes-code-review--review-drawer-deep--dark:
+ hash: v1.k794b7964.3d0c356cbfdec3793670287abc63521fce410b72c34ec987d6b0465e40f795a6.dNKe3NSj7mZL96kEZTR2n1v2DKjve6eJ2YDxeQKLiQk
+ scenes-code-review--review-drawer-deep--light:
+ hash: v1.k794b7964.b71bb2476197904ac98be6a048ab93ea1d42ba372eead2feae34a453cfae6c78.jY5EuW83OorvyQdp7-sbU_fq_YH_j8sXZMWDq8wERBM
+ scenes-code-review--review-drawer-standard--dark:
+ hash: v1.k794b7964.15d432a648fa4f9c3014fb9eb2575a3fabef538e54a6b1c68ee365c3575c1903.KeVrff6VhdQx8AdPek8I7jfXGtRk5MCEybrtb_ZoCoA
+ scenes-code-review--review-drawer-standard--light:
+ hash: v1.k794b7964.b53341de7580b5171efd0dfee295ee2f4ef30dd69a057b3ef14e25b0d31709b3.g6L5bNqhOk1MwKDUX-iRS4LFjAKSrpZ6Znmuhv55FhY
scenes-code-review--saved-inbox-opt-ins--dark:
hash: v1.k794b7964.ad93f63add9cc729094908a1c95fd2d5a16cdc3cf60491d478103e0f8ef29e68.XWH14JWiIxuAv5FK2GruOU2sleoiBQ2AX9vCrVT3lk8
scenes-code-review--saved-inbox-opt-ins--light:
diff --git a/products/review_hog/backend/api/reviews.py b/products/review_hog/backend/api/reviews.py
index d9e5c5d5c887..c5013e3c10ef 100644
--- a/products/review_hog/backend/api/reviews.py
+++ b/products/review_hog/backend/api/reviews.py
@@ -62,6 +62,7 @@ from products.review_hog.backend.reviewer.progress import (
turn_markers,
turn_stats,
)
+from products.review_hog.backend.reviewer.review_design import REVIEW_DESIGN_PIPELINE, REVIEW_DESIGN_SINGLE_AGENT
from products.review_hog.backend.reviewer.review_state import completed_turn_review_mode
from products.review_hog.backend.reviewer.tools.github_meta import PRParser
@@ -154,6 +155,11 @@ class ReviewTriggerReviewMode(models.TextChoices):
FLASH = REVIEW_MODE_FLASH, "Standard"
+class ReviewTurnDesign(models.TextChoices):
+ PIPELINE = REVIEW_DESIGN_PIPELINE, "Pipeline"
+ SINGLE_AGENT = REVIEW_DESIGN_SINGLE_AGENT, "Single agent"
+
+
class ReviewLatestResolutionStatus(models.TextChoices):
RESOLVING = RESOLUTION_RESOLVING, "Resolving"
STOPPED = RESOLUTION_STOPPED, "Stopped"
@@ -249,6 +255,14 @@ class ReviewRecentReviewSerializer(serializers.Serializer):
help_text="What the returned turn ran: 'full' (Deep) or 'flash' (Standard). Null when the turn did "
"not record its mode (turns from before the mode was recorded).",
)
+ review_design = serializers.ChoiceField(
+ choices=ReviewTurnDesign.choices,
+ allow_null=True,
+ help_text="How the returned turn found its issues. 'pipeline': chunks, perspectives, a blind-spot sweep "
+ "and a separate validation step. 'single_agent': one main review plus focused lenses, with no separate "
+ "validation step. Null when the turn recorded no design (turns from before it was recorded ran the "
+ "pipeline).",
+ )
status_comment_url = serializers.CharField(
allow_null=True,
help_text="Link to the review's status comment on the pull request; null when there is no status "
@@ -768,6 +782,7 @@ def _review_payload(
"published": report.published_head_sha is not None,
"turn_published": str(run_index) in (report.published_head_shas or {}),
"review_mode": marker.review_mode if marker else None,
+ "review_design": snapshot.review_design,
"status_comment_url": f"{report.pr_url}#issuecomment-{report.status_comment_id}"
if report.pr_url and report.status_comment_id
else None,
diff --git a/products/review_hog/backend/tests/test_reviews_api.py b/products/review_hog/backend/tests/test_reviews_api.py
index 97a1c76163c2..eb0049f4b64a 100644
--- a/products/review_hog/backend/tests/test_reviews_api.py
+++ b/products/review_hog/backend/tests/test_reviews_api.py
@@ -387,6 +387,7 @@ class TestRecentReviewsAPI(APIBaseTest):
PRFile(filename="a.py", status="modified", additions=1, deletions=0),
PRFile(filename="b.py", status="modified", additions=1, deletions=0),
],
+ review_design=REVIEW_DESIGN_SINGLE_AGENT,
)
# A newer snapshot for a head that was never reviewed must not displace the reviewed one.
persist_pr_snapshot(
@@ -461,10 +462,13 @@ class TestRecentReviewsAPI(APIBaseTest):
assert (row["perspective_count"], row["perspective_issue_count"], row["blind_spot_issue_count"]) == (2, 3, 1)
assert (row["candidate_count"], row["dismissed_count"]) == (3, 1)
assert "perspective_selection" not in row
+ # The old-sha snapshot ran the pipeline; only the reviewed head's design may reach the row.
+ assert row["review_design"] == REVIEW_DESIGN_SINGLE_AGENT
# The detail exposes the head-matched selection per chunk (stale-head one filtered out),
# joined with the chunk set's files, with skipped lenses computed against the roster.
detail = self.client.get(f"{self.url}{report.id}/").json()
+ assert detail["review_design"] == REVIEW_DESIGN_SINGLE_AGENT
assert detail["perspective_selection"] == {
"roster": ["s-logic", "s-sec", "s-perf"],
"chunks": [
diff --git a/products/review_hog/frontend/CodeReviewScene.stories.tsx b/products/review_hog/frontend/CodeReviewScene.stories.tsx
index bbaf53a48cb7..c4ddf1467441 100644
--- a/products/review_hog/frontend/CodeReviewScene.stories.tsx
+++ b/products/review_hog/frontend/CodeReviewScene.stories.tsx
@@ -24,6 +24,8 @@ import type {
PatchedReviewProjectSettingsApi,
PatchedReviewUserSettingsApi,
ReviewInstallationClaimScopeEnumApi,
+ ReviewDetailApi,
+ ReviewFindingApi,
ReviewPerspectiveConfigApi,
ReviewPerspectiveStatsApi,
ReviewProjectSettingsApi,
@@ -79,12 +81,13 @@ function completedReview(overrides: Partial<ReviewRecentReviewApi>): ReviewRecen
published: true,
turn_published: true,
review_mode: 'full',
- status_comment_url: null,
+ review_design: 'pipeline',
+ status_comment_url: 'https://github.com/example-org/example-repo/pull/101#issuecomment-1001',
+ latest_resolution: null,
full_review_published: true,
in_progress: false,
progress: null,
resolution: null,
- latest_resolution: null,
must_fix_count: 1,
should_fix_count: 2,
consider_count: 1,
@@ -108,10 +111,19 @@ const recentReviews: ReviewRecentReviewApi[] = [
github_url: 'https://github.com/example-org/example-repo/pull/98',
head_branch: 'fix/digest-timezone',
last_run_at: '2026-09-29T15:30:00Z',
+ review_mode: 'flash',
+ review_design: 'single_agent',
+ status_comment_url: 'https://github.com/example-org/example-repo/pull/98#issuecomment-980',
+ full_review_published: false,
must_fix_count: 0,
should_fix_count: 1,
- consider_count: 0,
- dismissed_count: 1,
+ consider_count: 1,
+ candidate_count: 2,
+ dismissed_count: 0,
+ chunk_count: null,
+ perspective_count: 3,
+ perspective_issue_count: 5,
+ blind_spot_issue_count: null,
}),
// Started by the viewer on a teammate's pull request, so "Mine" shows its author.
completedReview({
@@ -122,6 +134,9 @@ const recentReviews: ReviewRecentReviewApi[] = [
github_url: 'https://github.com/example-org/example-repo/pull/95',
head_branch: 'feat/billing-cache',
last_run_at: '2026-09-28T09:00:00Z',
+ review_mode: null,
+ review_design: null,
+ status_comment_url: null,
must_fix_count: 0,
should_fix_count: 0,
consider_count: 1,
@@ -129,6 +144,129 @@ const recentReviews: ReviewRecentReviewApi[] = [
}),
]
+function finding(overrides: Partial<ReviewFindingApi>): ReviewFindingApi {
+ return {
+ title: 'Retry loop never gives up on a permanent error',
+ file: 'posthog/tasks/exports.py',
+ lines: [{ start: 42, end: 58 }],
+ body: 'A 4xx from the export target is retried like a timeout, so the job keeps retrying until the queue drops it.',
+ suggestion: 'Retry only on timeouts and 5xx responses, and fail fast on 4xx.',
+ effective_priority: 'must_fix',
+ reviewer_priority: 'must_fix',
+ source_perspective: 'review-hog-perspective-logic-correctness',
+ validator_category: 'bug',
+ validator_note: 'The handler catches every `HTTPError`, including 4xx, so the retry path is reachable.',
+ ...overrides,
+ }
+}
+
+function reviewDetail(review: ReviewRecentReviewApi, overrides: Partial<ReviewDetailApi>): ReviewDetailApi {
+ return {
+ ...review,
+ run_index: review.run_count,
+ head_sha: 'a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0',
+ perspective_selection: null,
+ report_markdown: '## Review\n\nFindings are posted as inline comments.',
+ run_urgency_threshold: 'consider',
+ findings: [],
+ dismissed_findings: [],
+ ...overrides,
+ }
+}
+
+const deepReviewDetail = reviewDetail(recentReviews[0], {
+ run_urgency_threshold: 'should_fix',
+ findings: [
+ finding({}),
+ finding({
+ title: 'Export status is written before the upload finishes',
+ effective_priority: 'should_fix',
+ reviewer_priority: 'should_fix',
+ source_perspective: 'review-hog-perspective-performance-reliability',
+ validator_category: 'performance',
+ }),
+ finding({
+ title: 'Backoff ignores the Retry-After header',
+ effective_priority: 'should_fix',
+ reviewer_priority: 'consider',
+ source_perspective: 'review-hog-blind-spots-general',
+ validator_category: 'best_practice',
+ }),
+ finding({
+ title: 'Log line repeats the export id',
+ effective_priority: 'consider',
+ reviewer_priority: 'consider',
+ validator_category: 'code_quality',
+ }),
+ ],
+ dismissed_findings: [
+ finding({
+ title: 'Possible race on the export lock',
+ effective_priority: 'should_fix',
+ reviewer_priority: 'should_fix',
+ validator_category: null,
+ validator_note: 'The lock is taken inside a transaction, so two workers cannot hold it at once.',
+ }),
+ ],
+ perspective_selection: {
+ roster: ['review-hog-perspective-logic-correctness', 'review-hog-perspective-performance-reliability'],
+ chunks: [
+ {
+ chunk_id: 1,
+ chunk_type: 'backend_logic',
+ files: ['posthog/tasks/exports.py', 'posthog/tasks/retry.py'],
+ perspectives: [
+ 'review-hog-perspective-logic-correctness',
+ 'review-hog-perspective-performance-reliability',
+ ],
+ skipped: [],
+ reason: 'Retry logic touches both correctness and reliability.',
+ },
+ {
+ chunk_id: 2,
+ chunk_type: 'tests',
+ files: ['posthog/tasks/test/test_exports.py'],
+ perspectives: ['review-hog-perspective-logic-correctness'],
+ skipped: ['review-hog-perspective-performance-reliability'],
+ reason: 'Test-only chunk.',
+ },
+ ],
+ },
+})
+
+// A single-agent turn stamps one placeholder verdict on every finding instead of a validator's reasoning.
+const SINGLE_AGENT_NOTE = 'Not validated separately. A Standard review publishes its findings directly.'
+
+const standardReviewDetail = reviewDetail(recentReviews[1], {
+ findings: [
+ finding({
+ title: 'Digest window uses the server timezone',
+ file: 'posthog/tasks/weekly_digest.py',
+ lines: [{ start: 88, end: 95 }],
+ effective_priority: 'should_fix',
+ reviewer_priority: 'should_fix',
+ source_perspective: 'flash-single-agent',
+ validator_category: null,
+ validator_note: SINGLE_AGENT_NOTE,
+ }),
+ finding({
+ title: 'Digest query scans every team on each run',
+ file: 'posthog/tasks/weekly_digest.py',
+ lines: [{ start: 120, end: null }],
+ effective_priority: 'consider',
+ reviewer_priority: 'consider',
+ source_perspective: 'flash-lens-performance-reliability',
+ validator_category: null,
+ validator_note: SINGLE_AGENT_NOTE,
+ }),
+ ],
+})
+
+const reviewDetails: Record<string, ReviewDetailApi> = {
+ [deepReviewDetail.id]: deepReviewDetail,
+ [standardReviewDetail.id]: standardReviewDetail,
+}
+
const perspectiveStats: ReviewPerspectiveStatsApi = {
report_count: 2,
perspectives: [
@@ -365,10 +503,21 @@ function rowById(id: string): [string, StoryRepositoryRow] | undefined {
return Object.entries(storyState.rows).find(([, row]) => row.id === id)
}
-function OpenTab({ tab, children }: { tab: CodeReviewTab; children: JSX.Element }): JSX.Element {
+function OpenTab({
+ tab,
+ review,
+ children,
+}: {
+ tab: CodeReviewTab
+ review?: string
+ children: JSX.Element
+}): JSX.Element {
useEffect(() => {
- router.actions.replace(urls.codeReview(), tab === 'settings' ? { tab } : {})
- }, [tab])
+ router.actions.replace(urls.codeReview(), {
+ ...(tab === 'settings' ? { tab } : {}),
+ ...(review ? { review } : {}),
+ })
+ }, [tab, review])
return children
}
@@ -392,7 +541,7 @@ const meta: Meta<typeof CodeReviewScene> = {
},
decorators: [
(Story, context): JSX.Element => (
- <OpenTab tab={context.parameters.tab ?? 'activity'}>
+ <OpenTab tab={context.parameters.tab ?? 'activity'} review={context.parameters.review}>
<div className="p-4">
<Story />
</div>
@@ -456,6 +605,10 @@ const meta: Meta<typeof CodeReviewScene> = {
},
'/api/projects/:team_id/review_hog/reviews/': { results: recentReviews, has_more: false },
'/api/projects/:team_id/review_hog/reviews/perspective_stats/': perspectiveStats,
+ '/api/projects/:team_id/review_hog/reviews/:id/': ({ params }) => {
+ const detail = reviewDetails[String(params.id)]
+ return detail ? [200, detail] : [404, { detail: 'Review not found.' }]
+ },
'/api/projects/:team_id/review_hog/perspectives/': perspectives,
'/api/projects/:team_id/review_hog/blind_spots/': [
singleSkill(
@@ -667,6 +820,25 @@ export const FlagDisabledForStaff: Story = {
},
}
+export const ReviewDrawerStandard: Story = {
+ parameters: { review: standardReviewDetail.id },
+ play: async () => {
+ const body = within(document.body)
+ await expect(await body.findByText('Digest window uses the server timezone')).toBeVisible()
+ await expect(body.getByText('How it ran')).toBeVisible()
+ await expect(body.queryByText(/Below threshold/)).not.toBeInTheDocument()
+ },
+}
+
+export const ReviewDrawerDeep: Story = {
+ parameters: { review: deepReviewDetail.id },
+ play: async () => {
+ const body = within(document.body)
+ await expect(await body.findByText('Retry loop never gives up on a permanent error')).toBeVisible()
+ await expect(body.getByText(/Below threshold/)).toBeVisible()
+ },
+}
+
const narrowDecorator: Decorator = (Story): JSX.Element => (
<div className="max-w-130">
<Story />
diff --git a/products/review_hog/frontend/CodeReviewScene.tsx b/products/review_hog/frontend/CodeReviewScene.tsx
index e3c676c64cf7..8d560e3139a4 100644
--- a/products/review_hog/frontend/CodeReviewScene.tsx
+++ b/products/review_hog/frontend/CodeReviewScene.tsx
@@ -32,10 +32,12 @@ import type {
ReviewIssuePriorityEnumApi,
ReviewRecentReviewApi,
ReviewResolutionStatusApi,
+ ReviewTriggerReviewModeEnumApi,
} from 'products/review_hog/frontend/generated/api.schemas'
import {
ReviewHogReviewsListScope,
ReviewTriggerRequestRunModeEnumApi,
+ ReviewTurnDesignEnumApi,
} from 'products/review_hog/frontend/generated/api.schemas'
import { AdoptSkillModal } from './AdoptSkillModal'
@@ -183,11 +185,21 @@ function prettifyCategory(category: string): string {
return cleaned.charAt(0).toUpperCase() + cleaned.slice(1)
}
+// Mirror SINGLE_AGENT_SOURCE and the FlashLens sources in reviewer/constants.py.
+const SINGLE_AGENT_MAIN_SOURCE = 'flash-single-agent'
+const SINGLE_AGENT_LENS_PREFIX = 'flash-lens-'
+
/** Scoreboard label for a finding's source skill — blind-spot skills all read as one sweep. */
function perspectiveLabel(skillName: string): string {
if (skillName.startsWith('review-hog-blind-spots-')) {
return 'Blind spots'
}
+ if (skillName === SINGLE_AGENT_MAIN_SOURCE) {
+ return 'Main review'
+ }
+ if (skillName.startsWith(SINGLE_AGENT_LENS_PREFIX)) {
+ return `Lens: ${prettifySkillName(skillName.slice(SINGLE_AGENT_LENS_PREFIX.length))}`
+ }
if (skillName === 'unknown') {
return 'Unknown'
}
@@ -234,6 +246,87 @@ function ReviewStatusDot({ review }: { review: ReviewRecentReviewApi }): JSX.Ele
)
}
+/** A Standard turn on the single-agent design: no chunks, no perspective selection, no separate validation. */
+function isSingleAgentReview(review: ReviewRecentReviewApi | null): boolean {
+ return review?.review_design === ReviewTurnDesignEnumApi.SingleAgent
+}
+
+const REVIEW_MODE_LABEL: Record<ReviewTriggerReviewModeEnumApi, string> = {
+ flash: 'Standard',
+ full: 'Deep',
+}
+
+function ReviewModeTag({ review }: { review: ReviewRecentReviewApi }): JSX.Element | null {
+ if (!review.review_mode) {
+ return null
+ }
+ return (
+ <LemonTag type="muted" size="small">
+ {REVIEW_MODE_LABEL[review.review_mode]}
+ </LemonTag>
+ )
+}
+
+/** Lens count from the sessions that ran: one session is the main pass, the rest are lenses. Null when the turn recorded none. */
+function singleAgentLensCount(review: ReviewRecentReviewApi): number | null {
+ return review.perspective_count ? review.perspective_count - 1 : null
+}
+
+/** Posted findings, and how many were raised before drops. Raised is null when unknown or not above posted. */
+function singleAgentCounts(review: ReviewRecentReviewApi): { posted: number; raised: number | null } {
+ const posted = review.must_fix_count + review.should_fix_count + review.consider_count
+ const raised = review.perspective_issue_count
+ return { posted, raised: raised !== null && raised > posted ? raised : null }
+}
+
+/** The funnel line for a single-agent turn, which has no validation step to count. */
+function SingleAgentFindingsLine({ review }: { review: ReviewRecentReviewApi }): JSX.Element {
+ const { posted, raised } = singleAgentCounts(review)
+ return (
+ <span>
+ Posted <span className="font-semibold text-default">{posted}</span>
+ {raised !== null && (
+ <>
+ {' '}
+ of <span className="font-semibold text-default">{raised}</span> raised
+ </>
+ )}
+ </span>
+ )
+}
+
+/** The drawer header for a single-agent turn: how it ran, and why the posted count can be lower than the raised count. */
+function SingleAgentDrawerSummary({ review }: { review: ReviewRecentReviewApi }): JSX.Element {
+ const { posted, raised } = singleAgentCounts(review)
+ const lenses = singleAgentLensCount(review)
+ const dropped = raised !== null ? raised - posted : 0
+ return (
+ <div className="flex flex-col gap-1 text-sm text-secondary">
+ <div>
+ Standard review: one main pass over the whole pull request
+ {lenses
+ ? ` plus ${lenses} ${lenses === 1 ? 'lens that focuses' : 'lenses that each focus'} on one area`
+ : ''}
+ . No separate validation step.
+ </div>
+ <div>
+ Posted <span className="font-semibold text-default">{posted}</span>
+ {raised !== null ? (
+ <>
+ {' '}
+ of <span className="font-semibold text-default">{raised}</span> issues raised. The other{' '}
+ {dropped === 1 ? 'one repeated' : `${dropped} repeated`} another finding or comment,{' '}
+ {dropped === 1 ? 'was' : 'were'} on code this pull request did not change, or went over the
+ per-review limit.
+ </>
+ ) : (
+ ` issue${posted === 1 ? '' : 's'}.`
+ )}
+ </div>
+ </div>
+ )
+}
+
function reviewTitle(review: ReviewRecentReviewApi): string {
return review.pr_title ?? `${review.repository}#${review.pr_number ?? review.head_branch}`
}
@@ -362,6 +455,7 @@ function RecentReviewRow({ review }: { review: ReviewRecentReviewApi }): JSX.Ele
Not published
</LemonTag>
)}
+ <ReviewModeTag review={review} />
</div>
<div className="mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-secondary">
<span className="whitespace-nowrap font-mono text-tertiary">
@@ -442,14 +536,32 @@ function RecentReviewRow({ review }: { review: ReviewRecentReviewApi }): JSX.Ele
</span>
</div>
<div className="text-xs text-secondary">
- <span className="font-semibold text-default">{review.candidate_count}</span> findings raised →{' '}
- <span className="font-semibold text-default">{validated}</span> kept after validation →{' '}
- <span className="font-semibold text-default">{review.dismissed_count}</span> dismissed
+ {isSingleAgentReview(review) ? (
+ <SingleAgentFindingsLine review={review} />
+ ) : (
+ <>
+ <span className="font-semibold text-default">{review.candidate_count}</span> findings
+ raised → <span className="font-semibold text-default">{validated}</span> kept after
+ validation →{' '}
+ <span className="font-semibold text-default">{review.dismissed_count}</span> dismissed
+ </>
+ )}
</div>
- <div>
+ <div className="flex flex-wrap items-center gap-2">
<LemonButton size="small" type="secondary" onClick={() => openReviewDetail(review)}>
View findings
</LemonButton>
+ {review.status_comment_url && (
+ <LemonButton
+ size="small"
+ type="tertiary"
+ to={review.status_comment_url}
+ targetBlank
+ sideIcon={<IconExternal />}
+ >
+ View status comment
+ </LemonButton>
+ )}
</div>
</div>
)}
@@ -663,7 +775,7 @@ function FindingCard({ finding, dismissed }: { finding: ReviewFindingApi; dismis
</LemonTag>
)}
{finding.source_perspective && (
- <span className="text-xs text-tertiary">{prettifySkillName(finding.source_perspective)}</span>
+ <span className="text-xs text-tertiary">{perspectiveLabel(finding.source_perspective)}</span>
)}
</div>
<span className={`text-base font-semibold ${dismissed ? 'text-secondary' : ''}`}>{finding.title}</span>
@@ -701,15 +813,20 @@ function FindingCard({ finding, dismissed }: { finding: ReviewFindingApi; dismis
</LemonMarkdown>
),
},
- {
- key: 'validator',
- header: dismissed ? 'Why it was dismissed' : "Why we think it's a valid issue",
- content: (
- <LemonMarkdown className="text-sm text-secondary" disableImages>
- {finding.validator_note}
- </LemonMarkdown>
- ),
- },
+ // A single-agent turn has no validator, so its note is a placeholder, not reasoning.
+ ...(isSingleAgentReview(reviewDetail)
+ ? []
+ : [
+ {
+ key: 'validator' as const,
+ header: dismissed ? 'Why it was dismissed' : "Why we think it's a valid issue",
+ content: (
+ <LemonMarkdown className="text-sm text-secondary" disableImages>
+ {finding.validator_note}
+ </LemonMarkdown>
+ ),
+ },
+ ]),
]}
/>
</div>
@@ -734,6 +851,9 @@ function DrawerPublishedTab(): JSX.Element {
return <DrawerFindingsSkeleton />
}
const isPublished = reviewDetail?.published ?? false
+ if (!reviewFindingsSplit.published.length && isSingleAgentReview(reviewDetail)) {
+ return <div className="text-sm text-secondary">This review found nothing to post to the pull request.</div>
+ }
if (!reviewFindingsSplit.published.length) {
return (
<div className="text-sm text-secondary">
@@ -894,6 +1014,36 @@ function DrawerChunksTab(): JSX.Element {
)
}
+/** The "How it ran" tab for a single-agent turn, which has no chunk plan to show. */
+function DrawerHowItRanTab(): JSX.Element {
+ const { reviewDetail } = useValues(reviewHogSettingsLogic)
+
+ if (!reviewDetail) {
+ return <DrawerFindingsSkeleton />
+ }
+ const lenses = singleAgentLensCount(reviewDetail)
+ const { posted, raised } = singleAgentCounts(reviewDetail)
+ const issuesRaised = reviewDetail.perspective_issue_count
+ return (
+ <ul className="m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-secondary">
+ {lenses !== null && (
+ <li>
+ Ran the main review and {lenses} lens{lenses === 1 ? '' : 'es'}
+ </li>
+ )}
+ {reviewDetail.files_reviewed !== null && <li>Read {reviewDetail.files_reviewed} files</li>}
+ {issuesRaised !== null && (
+ <li>
+ Raised {issuesRaised} issues
+ {raised !== null
+ ? `; ${raised - posted} not posted (repeats, unchanged code, or over the limit)`
+ : ''}
+ </li>
+ )}
+ </ul>
+ )
+}
+
function ReviewDetailDrawer(): JSX.Element {
const {
reviewDrawerOpen,
@@ -907,6 +1057,7 @@ function ReviewDetailDrawer(): JSX.Element {
// The list row carries the header facts, so the drawer opens instantly while findings load.
const review = reviewDetail ?? openedReview
+ const singleAgent = isSingleAgentReview(review)
return (
<LemonDrawer
@@ -914,11 +1065,20 @@ function ReviewDetailDrawer(): JSX.Element {
onClose={closeReviewDrawer}
title={review ? reviewTitle(review) : ''}
description={
- review
- ? `${review.repository}#${review.pr_number ?? review.head_branch}${
- review.pr_author ? ` · by ${review.pr_author}` : ''
- }`
- : undefined
+ review ? (
+ <span className="flex flex-wrap items-center gap-x-2 gap-y-1">
+ <span>
+ {review.repository}#{review.pr_number ?? review.head_branch}
+ {review.pr_author ? ` · by ${review.pr_author}` : ''}
+ </span>
+ <ReviewModeTag review={review} />
+ {review.status_comment_url && (
+ <Link to={review.status_comment_url} target="_blank" targetBlankIcon>
+ Status comment
+ </Link>
+ )}
+ </span>
+ ) : undefined
}
width={640}
footer={
@@ -930,7 +1090,9 @@ function ReviewDetailDrawer(): JSX.Element {
}
>
<div className="flex flex-col gap-2">
- {reviewDetail ? (
+ {reviewDetail && singleAgent ? (
+ <SingleAgentDrawerSummary review={reviewDetail} />
+ ) : reviewDetail ? (
<div className="text-sm text-secondary">
<span className="font-semibold text-default">{reviewDetail.candidate_count}</span> findings
raised · <span className="font-semibold text-default">{reviewDetail.findings.length}</span> kept
@@ -952,7 +1114,8 @@ function ReviewDetailDrawer(): JSX.Element {
</div>
)}
<LemonTabs<ReviewDrawerTab>
- activeKey={reviewDrawerTab}
+ // Standard has no Dismissed tab, so a stale selection falls back to the posted tab.
+ activeKey={singleAgent && reviewDrawerTab === 'dismissed' ? 'published' : reviewDrawerTab}
onChange={setReviewDrawerTab}
tabs={[
{
@@ -961,28 +1124,28 @@ function ReviewDetailDrawer(): JSX.Element {
// actually posted; findings a store-only run kept above the bar read
// "Kept". `review` falls back to the list row, so a published review
// doesn't flash "Kept" while its detail loads.
- label: `${review?.published ? 'Published' : 'Kept'}${
+ label: `${review?.published ? (singleAgent ? 'Posted' : 'Published') : 'Kept'}${
reviewFindingsSplit ? ` (${reviewFindingsSplit.published.length})` : ''
}`,
content: <DrawerPublishedTab />,
},
- {
+ // A single-agent turn publishes at every urgency, so nothing sits below a threshold.
+ !singleAgent && {
key: 'below_threshold',
label: `Below threshold${
reviewFindingsSplit ? ` (${reviewFindingsSplit.belowThreshold.length})` : ''
}`,
content: <DrawerBelowThresholdTab />,
},
- {
+ // A single-agent turn has no validator, so there are no dismissals to show.
+ !singleAgent && {
key: 'dismissed',
label: `Dismissed${reviewDetail ? ` (${reviewDetail.dismissed_findings.length})` : ''}`,
content: <DrawerDismissedTab />,
},
- {
- key: 'chunks',
- label: 'Chunks',
- content: <DrawerChunksTab />,
- },
+ singleAgent
+ ? { key: 'how_it_ran', label: 'How it ran', content: <DrawerHowItRanTab /> }
+ : { key: 'chunks', label: 'Chunks', content: <DrawerChunksTab /> },
{
key: 'review',
label: 'Review body',
diff --git a/products/review_hog/frontend/generated/api.schemas.ts b/products/review_hog/frontend/generated/api.schemas.ts
index 1e76beda7f33..6b69d393e2e9 100644
--- a/products/review_hog/frontend/generated/api.schemas.ts
+++ b/products/review_hog/frontend/generated/api.schemas.ts
@@ -619,6 +619,17 @@ export const ReviewTriggerReviewModeEnumApi = {
Flash: 'flash',
} as const
+/**
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent
+ */
+export type ReviewTurnDesignEnumApi = (typeof ReviewTurnDesignEnumApi)[keyof typeof ReviewTurnDesignEnumApi]
+
+export const ReviewTurnDesignEnumApi = {
+ Pipeline: 'pipeline',
+ SingleAgent: 'single_agent',
+} as const
+
/**
* * `fetching` - fetching
* * `chunking` - chunking
@@ -792,6 +803,11 @@ export interface ReviewRecentReviewApi {
* * `full` - Deep
* * `flash` - Standard */
review_mode: ReviewTriggerReviewModeEnumApi | null
+ /** How the returned turn found its issues. 'pipeline': chunks, perspectives, a blind-spot sweep and a separate validation step. 'single_agent': one main review plus focused lenses, with no separate validation step. Null when the turn recorded no design (turns from before it was recorded ran the pipeline).
+ *
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent */
+ review_design: ReviewTurnDesignEnumApi | null
/**
* Link to the review's status comment on the pull request; null when there is no status comment or no pull request URL.
* @nullable
@@ -1023,6 +1039,11 @@ export interface ReviewDetailApi {
* * `full` - Deep
* * `flash` - Standard */
review_mode: ReviewTriggerReviewModeEnumApi | null
+ /** How the returned turn found its issues. 'pipeline': chunks, perspectives, a blind-spot sweep and a separate validation step. 'single_agent': one main review plus focused lenses, with no separate validation step. Null when the turn recorded no design (turns from before it was recorded ran the pipeline).
+ *
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent */
+ review_design: ReviewTurnDesignEnumApi | null
/**
* Link to the review's status comment on the pull request; null when there is no status comment or no pull request URL.
* @nullable
diff --git a/products/review_hog/frontend/reviewHogSettingsLogic.ts b/products/review_hog/frontend/reviewHogSettingsLogic.ts
index 32e3a60e67c1..f4771cfa38ba 100644
--- a/products/review_hog/frontend/reviewHogSettingsLogic.ts
+++ b/products/review_hog/frontend/reviewHogSettingsLogic.ts
@@ -53,7 +53,7 @@ import type { LLMSkillListApi } from 'products/skills/frontend/generated/api.sch
export type ReviewSkillKind = 'perspective' | 'blind_spots' | 'validator' | 'resolution'
-export type ReviewDrawerTab = 'published' | 'below_threshold' | 'dismissed' | 'chunks' | 'review'
+export type ReviewDrawerTab = 'published' | 'below_threshold' | 'dismissed' | 'chunks' | 'how_it_ran' | 'review'
export type CodeReviewTab = 'activity' | 'settings'
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index b50dea86de2a..4f27a472cca7 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -95219,6 +95219,18 @@ export namespace Schemas {
Flash: 'flash',
} as const;
+ /**
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent
+ */
+ export type ReviewTurnDesignEnum = typeof ReviewTurnDesignEnum[keyof typeof ReviewTurnDesignEnum];
+
+
+ export const ReviewTurnDesignEnum = {
+ Pipeline: 'pipeline',
+ SingleAgent: 'single_agent',
+ } as const;
+
/**
* * `fetching` - fetching
* * `chunking` - chunking
@@ -95501,6 +95513,11 @@ export namespace Schemas {
* * `full` - Deep
* * `flash` - Standard */
review_mode: ReviewTriggerReviewModeEnum | null;
+ /** How the returned turn found its issues. 'pipeline': chunks, perspectives, a blind-spot sweep and a separate validation step. 'single_agent': one main review plus focused lenses, with no separate validation step. Null when the turn recorded no design (turns from before it was recorded ran the pipeline).
+ *
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent */
+ review_design: ReviewTurnDesignEnum | null;
/**
* Link to the review's status comment on the pull request; null when there is no status comment or no pull request URL.
* @nullable
@@ -95871,6 +95888,11 @@ export namespace Schemas {
* * `full` - Deep
* * `flash` - Standard */
review_mode: ReviewTriggerReviewModeEnum | null;
+ /** How the returned turn found its issues. 'pipeline': chunks, perspectives, a blind-spot sweep and a separate validation step. 'single_agent': one main review plus focused lenses, with no separate validation step. Null when the turn recorded no design (turns from before it was recorded ran the pipeline).
+ *
+ * * `pipeline` - Pipeline
+ * * `single_agent` - Single agent */
+ review_design: ReviewTurnDesignEnum | null;
/**
* Link to the review's status comment on the pull request; null when there is no status comment or no pull request URL.
* @nullable