: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(today): let a person step off a report's reviewers (#113287)
Vojta Bartoš6bf49603ac67
diff --git a/frontend/src/layout/today/todayPreviewCards.ts b/frontend/src/layout/today/todayPreviewCards.tsindex 26596655f2df..b6da6051745f 100644--- a/frontend/src/layout/today/todayPreviewCards.ts+++ b/frontend/src/layout/today/todayPreviewCards.ts@@ -71,6 +71,8 @@ export interface TodayReportCard {/** Resolved or dismissed since the briefing, or null while open. */stateLabel: string | nullresolved: boolean+ /** Whether the person is one of the report's suggested reviewers, and so can step off it. */+ canLeaveReview: booleanpriority: string | nullsummary: string | nullpullRequestState: PrStateEnumApi | nulldiff --git a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsxindex 4726f5c8a449..98d51d79164c 100644--- a/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayHomeSidebar.tsx@@ -12,7 +12,7 @@ import { TodayPreviewTrigger } from '~/layout/today/TodayPreviewTrigger'import { displayConventionalCommitTitle } from 'products/signals/frontend/inbox/utils/reportPresentation'-import { isExternalHref, itemHref, itemSource, itemStateLabel } from './todayBriefingItems'+import { isExternalHref, itemHref, itemReportId, itemSource, itemStateLabel } from './todayBriefingItems'import { TodayIcon } from './TodayIcon'import { todayLogic } from './todayLogic'import { TodayMoreReports } from './TodayMoreReports'@@ -20,7 +20,7 @@ import { TodayNavItem } from './TodayNavItem'import { TodayReportNavItem } from './TodayReportNavItem'function PersonalBriefingNavItems(): JSX.Element {- const { briefingItems, reportPreviews, hoveredItemKey } = useValues(todayLogic)+ const { briefingItems, reportPreviews, hoveredItemKey, reportStateOverrides } = useValues(todayLogic)const { itemOpened, setHoveredItemKey } = useActions(todayLogic)const { location } = useValues(router)const currentPath = removeProjectIdIfPresent(location.pathname)@@ -31,18 +31,20 @@ function PersonalBriefingNavItems(): JSX.Element {const href = itemHref(item)const source = itemSource(item)const preview = reportPreviews.sidebar[item.key]+ const reportId = itemReportId(item)+ const state = (reportId ? reportStateOverrides[reportId] : undefined) ?? item.stateconst row = (<TodayNavItemkey={item.key}title={displayConventionalCommitTitle(item.title, 'Untitled report')}- meta={itemStateLabel(item) ?? (item.signal || source.label)}+ meta={itemStateLabel({ state }) ?? (item.signal || source.label)}color={source.color}icon={<TodayIcon icon={source.icon} />}to={href}target={isExternalHref(href) ? '_blank' : undefined}active={hoveredItemKey === item.key}current={removeProjectIdIfPresent(href) === currentPath}- state={item.state}+ state={state}dataAttr="today-nav-item"onClick={() => itemOpened(item, 'sidebar')}onHoverChange={(hovered) => setHoveredItemKey(hovered ? item.key : null)}diff --git a/frontend/src/scenes/project-homepage/today/TodayReportHoverCard.tsx b/frontend/src/scenes/project-homepage/today/TodayReportHoverCard.tsxindex b3da777ff59d..a28f99bca1b4 100644--- a/frontend/src/scenes/project-homepage/today/TodayReportHoverCard.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayReportHoverCard.tsx@@ -1,7 +1,7 @@import { useActions, useValues } from 'kea'import { Suspense, useEffect } from 'react'-import { IconCheckCircle, IconHide, IconPullRequest } from '@posthog/icons'+import { IconCheckCircle, IconHide, IconLeave, IconPullRequest } from '@posthog/icons'import {Badge,Button,@@ -57,7 +57,7 @@ const LISTED_METRIC_COUNT = 2export function TodayReportHoverCard({ preview }: { preview: TodayReportPreview }): JSX.Element {const { card } = previewconst { reportStateOverrides } = useValues(todayLogic)- const { reportPreviewed, requestReportVerdict } = useActions(todayLogic)+ const { reportPreviewed, requestReportVerdict, leaveReportReview } = useActions(todayLogic)// Keyed on the report, not the card object: a poll replaces the object while the card stays open.useEffect(() => {reportPreviewed(card.key, preview.surface)@@ -108,19 +108,27 @@ export function TodayReportHoverCard({ preview }: { preview: TodayReportPreviewreturn (<div className="flex flex-col" data-attr="today-report-hover-card">- {/* `flex-nowrap` keeps the state badge beside a long title. */}- <Item size="xs" className="flex-nowrap items-start">+ <Item size="xs" className="items-start"><ItemContent className="min-w-0 gap-0.5">- {/* `wrap-anywhere`: the title sizes to its content, so a long title would widen the card. */}- <ItemTitle className="wrap-anywhere">- <span className="min-w-0 font-semibold">{card.title}</span>- </ItemTitle>+ {/* The badge shares a row with the title alone, so it narrows the title and not the+ line below, which has to stay on one line. */}+ <div className="flex items-start justify-between gap-2">+ {/* `wrap-anywhere`: the title sizes to its content, so a long title would widen the card. */}+ <ItemTitle className="min-w-0 wrap-anywhere">+ <span className="min-w-0 font-semibold">{card.title}</span>+ </ItemTitle>+ {stateLabel && (+ <ItemActions className="shrink-0">+ <Badge variant={resolved ? 'completed' : 'default'}>{stateLabel}</Badge>+ </ItemActions>+ )}+ </div>+ {/* The lead gives up room to the mark, which is short and must stay whole. */}{(lead || card.pullRequestUrl) && (- <ItemDescription className="flex flex-wrap items-center gap-x-1.5">- {lead && <span>{lead}</span>}+ <ItemDescription className="flex flex-nowrap items-center gap-x-2">+ {lead && <span className="truncate">{lead}</span>}{card.pullRequestUrl && (- <span className="flex min-w-0 items-center gap-1.5">- {lead && <span aria-hidden>·</span>}+ <span className="flex shrink-0 items-center gap-1.5"><LinkPrimitiveto={card.pullRequestUrl}target="_blank"@@ -142,11 +150,6 @@ export function TodayReportHoverCard({ preview }: { preview: TodayReportPreview</ItemDescription>)}</ItemContent>- {stateLabel && (- <ItemActions className="self-start">- <Badge variant={resolved ? 'completed' : 'default'}>{stateLabel}</Badge>- </ItemActions>- )}</Item>{card.summary && (// Its own row, so the summary uses the full card width, not the column beside the state badge.@@ -244,6 +247,21 @@ export function TodayReportHoverCard({ preview }: { preview: TodayReportPreview<IconCheckCircle />Resolve</Button>+ {/* The click gives the report a state label, which takes this whole row off the+ card, so the request cannot be sent twice and needs no in-flight state. */}+ {card.canLeaveReview && (+ <Button+ variant="outline"+ size="xs"+ disabled={isSample}+ title="Remove yourself from this report’s reviewers"+ onClick={() => leaveReportReview(reportId, preview.surface)}+ data-attr="today-report-hover-card-leave-review"+ >+ <IconLeave />+ Not me+ </Button>+ )}<Buttonvariant="outline"size="xs"diff --git a/frontend/src/scenes/project-homepage/today/TodayReportNavItem.tsx b/frontend/src/scenes/project-homepage/today/TodayReportNavItem.tsxindex aa62222bf246..a9d362850ebe 100644--- a/frontend/src/scenes/project-homepage/today/TodayReportNavItem.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayReportNavItem.tsx@@ -24,18 +24,19 @@ interface TodayReportNavItemProps {export function TodayReportNavItem({ report, preview, source, dataAttr }: TodayReportNavItemProps): JSX.Element {const { reportId, hoveredReportId, reportStateOverrides } = useValues(todayLogic)const { reportOpened, setHoveredReportId } = useActions(todayLogic)+ const override = reportStateOverrides[report.id]return (<TodayPreviewTrigger payload={preview}><TodayNavItemtitle={displayConventionalCommitTitle(report.title, 'Untitled report')}- meta={itemStateLabel({ state: reportStateOverrides[report.id] ?? 'open' }) ?? reportMeta(report)}+ meta={itemStateLabel({ state: override ?? 'open' }) ?? reportMeta(report)}color={reportSource(report).color}icon={<TodayIcon icon={reportIcon(report)} />}to={urls.todayReport(report.id)}active={hoveredReportId === report.id}current={reportId === report.id}- state={reportStateOverrides[report.id]}+ state={override}dataAttr={dataAttr}onClick={() => reportOpened(report, source)}onHoverChange={(hovered) => setHoveredReportId(hovered ? report.id : null)}diff --git a/frontend/src/scenes/project-homepage/today/todayBriefingItems.ts b/frontend/src/scenes/project-homepage/today/todayBriefingItems.tsindex 10c02f668c4b..4be4eadc1a38 100644--- a/frontend/src/scenes/project-homepage/today/todayBriefingItems.ts+++ b/frontend/src/scenes/project-homepage/today/todayBriefingItems.ts@@ -44,6 +44,7 @@ const STATE_LABELS: Record<BriefingItemStateEnumApi, string | null> = {open: null,done: 'Resolved',dismissed: 'Dismissed',+ left: 'Not yours',}/** What happened to the item since the briefing was written, or null while it is still open. */@@ -51,6 +52,13 @@ export function itemStateLabel(item: Pick<BriefingItemApi, 'state'>): string | nreturn STATE_LABELS[item.state]}+// The briefing reasons a report gets when it names the person, the reports the for_you count covers.+const NAMES_PERSON_REASONS: ReadonlySet<TodayItemReasonEnumApi> = new Set(['waiting_for_you', 'suggested_reviewer'])++export function itemNamesPerson(item: Pick<BriefingItemApi, 'reason'>): boolean {+ return NAMES_PERSON_REASONS.has(item.reason)+}+const REPORT_STATUS_STATES: Record<string, BriefingItemStateEnumApi> = {resolved: 'done',suppressed: 'dismissed',@@ -70,6 +78,7 @@ export function briefingItemReportCard(item: BriefingItemApi): TodayReportCard {reason: itemReasonLabel(item),stateLabel: itemStateLabel(item),resolved: item.state === 'done',+ canLeaveReview: itemNamesPerson(item),priority: item.report?.priority ?? null,summary: item.report?.summary || null,pullRequestState: item.report?.pull_request_state ?? null,diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts b/frontend/src/scenes/project-homepage/today/todayLogic.test.tsindex cd5f2c86ef41..cb0f232eeb0d 100644--- a/frontend/src/scenes/project-homepage/today/todayLogic.test.ts+++ b/frontend/src/scenes/project-homepage/today/todayLogic.test.ts@@ -9,6 +9,7 @@ import { makeReport } from 'products/signals/frontend/inbox/__mocks__/inboxMocksimport { SignalReportStatus } from 'products/signals/frontend/inbox/types'import type { BriefingApi, BriefingItemReportApi } from 'products/today/frontend/generated/api.schemas'+import { itemStateLabel } from './todayBriefingItems'import { BRIEFING_POLL_MS, MORE_REPORTS_LIMIT, TOP_REPORT_COUNT, reportIdFromPath, todayLogic } from './todayLogic'import { todayReportLogic } from './todayReportLogic'import { isSampleReportId } from './todaySampleReports'@@ -53,6 +54,8 @@ describe('todayLogic', () => {let briefingCalls: numberlet stateResponse: [number, any]let reportResponse: [number, any] | null+ let leaveReviewersResponse: [number, any]+ let stateCalls: numberbeforeEach(() => {listResponse = [200, { results: [], count: 0 }]@@ -61,6 +64,8 @@ describe('todayLogic', () => {briefingCalls = 0stateResponse = [200, {}]reportResponse = null+ leaveReviewersResponse = [204, {}]+ stateCalls = 0useMocks({get: {'/api/projects/:team_id/signals/reports/for_you/': ({ request }) => {@@ -78,7 +83,13 @@ describe('todayLogic', () => {200,makeBriefing({ id: 'b-next', status: 'writing' }),],- '/api/projects/:team_id/signals/reports/:id/state/': () => stateResponse,+ '/api/projects/:team_id/signals/reports/:id/state/': () => {+ stateCalls += 1+ return stateResponse+ },+ },+ delete: {+ '/api/projects/:team_id/signals/reports/:id/reviewers/me/': () => leaveReviewersResponse,},})initKeaTests()@@ -365,6 +376,26 @@ describe('todayLogic', () => {expect(Object.keys(logic.values.teamReportPreviews.sidebar)).toEqual(['team-a'])})+ test.each([+ ['takes a report the person steps off their list', 204, 'left', 'Not yours'],+ ['puts the report back when stepping off it fails', 500, 'open', null],+ ])('%s', async (_, status, finalState, finalLabel) => {+ briefingResponses = [[200, makeBriefing()]]+ leaveReviewersResponse = [status, { detail: 'Refused.' }]+ const logic = todayLogic()+ logic.mount()+ await expectLogic(logic).toFinishAllListeners()++ logic.actions.leaveReportReview('a', 'sidebar')+ expect(logic.values.briefingItems[0].state).toEqual('left')++ await expectLogic(logic).toFinishAllListeners()+ expect(logic.values.briefingItems[0].state).toEqual(finalState)+ expect(itemStateLabel({ state: logic.values.reportStateOverrides.a ?? 'open' })).toEqual(finalLabel)+ // Stepping off changes who the report is routed to, never the report's own state.+ expect(stateCalls).toEqual(0)+ })+it('asks for the top reports for the person and counts the rest', async () => {const reports = [makeReport({ id: 'a' }), makeReport({ id: 'b' })]listResponse = [200, { results: reports, count: 9 }]diff --git a/frontend/src/scenes/project-homepage/today/todayLogic.ts b/frontend/src/scenes/project-homepage/today/todayLogic.tsindex 0c506ec6cb57..74fc9f4157ae 100644--- a/frontend/src/scenes/project-homepage/today/todayLogic.ts+++ b/frontend/src/scenes/project-homepage/today/todayLogic.ts@@ -20,6 +20,7 @@ import { TeamType, UserType } from '~/types'import {signalsReportsForYouRetrieve,signalsReportsRetrieve,+ signalsReportsReviewersMeDestroy,signalsReportsStateCreate,} from 'products/signals/frontend/generated/api'import type {@@ -36,7 +37,6 @@ import type {BriefingApi,BriefingItemApi,BriefingItemStateEnumApi,- TodayItemReasonEnumApi,} from 'products/today/frontend/generated/api.schemas'import type { TeamPublicType } from '../../../types'@@ -49,6 +49,7 @@ import {isBriefingSettled,isExternalHref,itemHref,+ itemNamesPerson,itemReportId,} from './todayBriefingItems'import { SAMPLE_BRIEFING, isSampleReportId, parseSampleParam, sampleTopReports } from './todaySampleReports'@@ -57,8 +58,6 @@ import { TodayBriefingSegment, briefingForReports, teamReportCard } from './todaexport const TOP_REPORT_COUNT = 5// The most reports the for_you endpoint returns in one call (MAX_FOR_YOU_REPORTS on the backend).export const MORE_REPORTS_LIMIT = 20-// The briefing reasons a report gets when it names the person, the reports the for_you count covers.-const NAMES_PERSON_REASONS: ReadonlySet<TodayItemReasonEnumApi> = new Set(['waiting_for_you', 'suggested_reviewer'])const CLOCK_MS = 30_000export const BRIEFING_POLL_MS = 5_000// The run's budget is 10 minutes (RUN_TIMEOUT in logic/generate.py). Stop asking a little after that.@@ -299,6 +298,16 @@ export interface todayLogicActions {item: BriefingItemApisurface: TodayItemOpenSurface}+ leaveReportReview: (+ reportId: string,+ surface: TodayReportVerdictSurface+ ) => {+ reportId: string+ surface: TodayReportVerdictSurface+ }+ leaveReportReviewFailure: (reportId: string) => {+ reportId: string+ }loadMoreReports: () => anyloadMoreReportsFailure: (error: string,@@ -530,6 +539,8 @@ export const todayLogic = kea<todayLogicType>([surface: TodayReportVerdictSurface) => ({ target, verdict, surface }),setReportVerdictFailure: (reportId: string) => ({ reportId }),+ leaveReportReview: (reportId: string, surface: TodayReportVerdictSurface) => ({ reportId, surface }),+ leaveReportReviewFailure: (reportId: string) => ({ reportId }),addReportVerdictReason: (target: TodayReportVerdictTarget, verdict: TodayReportVerdict) => ({target,verdict,@@ -676,6 +687,11 @@ export const todayLogic = kea<todayLogicType>([const { [reportId]: _, ...rest } = overridesreturn rest},+ leaveReportReview: (overrides, { reportId }) => ({ ...overrides, [reportId]: 'left' }),+ leaveReportReviewFailure: (overrides, { reportId }) => {+ const { [reportId]: _, ...rest } = overrides+ return rest+ },},],reloadingAfterRefresh: [@@ -835,7 +851,7 @@ export const todayLogic = kea<todayLogicType>([// item, or one the person only claimed, is not in it and must not be taken off it.const countedShownIds = showPersonalBriefing? briefingItems- .filter((item) => item.state === 'open' && NAMES_PERSON_REASONS.has(item.reason))+ .filter((item) => item.state === 'open' && itemNamesPerson(item)).map(itemReportId).filter((id): id is string => id !== null): reports.map((report) => report.id)@@ -1071,6 +1087,22 @@ export const todayLogic = kea<todayLogicType>([button: { label: 'Add a reason', action: () => actions.addReportVerdictReason(target, verdict) },})},+ // No confirm dialog: unlike a verdict, this changes nothing for anyone but the person.+ leaveReportReview: async ({ reportId, surface }) => {+ try {+ await signalsReportsReviewersMeDestroy(String(values.currentProjectId), reportId)+ } catch (error) {+ actions.leaveReportReviewFailure(reportId)+ lemonToast.error(+ (error instanceof ApiError && error.detail) ||+ 'Couldn’t remove you from the reviewers. Try again, or change them from the Inbox.'+ )+ return+ }+ // pinned: analytics event name and properties. Renaming them breaks dashboards.+ posthog.capture('today report review left', { surface })+ lemonToast.success('Removed you from the reviewers')+ },addReportVerdictReason: ({ target, verdict }) => {const copy = VERDICTS[verdict]const dialogCopy = {diff --git a/frontend/src/scenes/project-homepage/today/todayReportLogic.ts b/frontend/src/scenes/project-homepage/today/todayReportLogic.tsindex 898dd7802281..9ee0f733ada2 100644--- a/frontend/src/scenes/project-homepage/today/todayReportLogic.ts+++ b/frontend/src/scenes/project-homepage/today/todayReportLogic.ts@@ -21,7 +21,6 @@ import {todayReportsPageRetrieve,} from 'products/today/frontend/generated/api'import type {- BriefingItemStateEnumApi,CodeFileApi,FigureMarkApi,FigureTextEnumApi,@@ -35,6 +34,7 @@ import {todayExcerptChoiceCreateBodyFindingMax,} from 'products/today/frontend/generated/api.zod'+import type { BriefingItemStateEnumApi } from '../../../../../products/today/frontend/generated/api.schemas'import { reportItemState } from './todayBriefingItems'import { type TodaySignalDestination } from './todayEvidence'import { type TodayMarkedFigure, markedFigures, staleEvidenceDate } from './todayFigureSources'diff --git a/frontend/src/scenes/project-homepage/today/todaySignalReports.ts b/frontend/src/scenes/project-homepage/today/todaySignalReports.tsindex 6bf76f18273d..30fb40294d47 100644--- a/frontend/src/scenes/project-homepage/today/todaySignalReports.ts+++ b/frontend/src/scenes/project-homepage/today/todaySignalReports.ts@@ -101,6 +101,7 @@ export function teamReportCard(report: SignalReport): TodayReportCard {reason: null,stateLabel: null,resolved: false,+ canLeaveReview: report.is_suggested_reviewer,priority: report.priority ?? null,summary: report.summary_lead || null,pullRequestState: report.implementation_pr_merged ? 'merged' : (report.implementation_pr_state ?? null),diff --git a/products/signals/backend/briefing_reports.py b/products/signals/backend/briefing_reports.pyindex 0f888d949a54..5a9f25c66295 100644--- a/products/signals/backend/briefing_reports.py+++ b/products/signals/backend/briefing_reports.py@@ -270,6 +270,25 @@ def _names_person(team_id: int, user: User) -> Q:)+def report_ids_naming_user(*, team_id: int, user: User, report_ids: Sequence[str]) -> set[str]:+ """Which of these reports still name the person as a suggested reviewer.++ A briefing is a saved list, so an item it picked because the report named the person can outlive+ that fact. Reading membership live is what lets a reader tell a report they stepped off from one+ that is still theirs.+ """+ if not report_ids:+ return set()+ github_login = user.get_github_login()+ naming = report_ids_naming_reviewers(+ team_id=team_id,+ user_uuids=[str(user.uuid)],+ github_logins=[github_login.lower()] if github_login else [],+ logins_match_unidentified_only=False,+ ).filter(report_id__in=list(report_ids))+ return {str(row["report_id"]) for row in naming}++def _source_products(team_id: int, report_ids: Sequence[str]) -> dict[str, list[str]]:"""Per report, the products its signals came from. A ClickHouse failure costs the colors, not the reports."""if not report_ids:diff --git a/products/signals/backend/facade/api.py b/products/signals/backend/facade/api.pyindex 78289f0b462f..ea12672361ea 100644--- a/products/signals/backend/facade/api.py+++ b/products/signals/backend/facade/api.py@@ -40,6 +40,7 @@ from products.signals.backend.briefing_reports import (OpenReportCounts as OpenReportCounts,open_report_counts as open_report_counts,report_details as report_details,+ report_ids_naming_user as report_ids_naming_user,reports_for_briefing as reports_for_briefing,)from products.signals.backend.contracts import DIRECT_STEERABLE_SOURCES, SIGNAL_VARIANT_LOOKUP, SignalRemediationdiff --git a/products/signals/backend/test/test_signal_report_artefact_api.py b/products/signals/backend/test/test_signal_report_artefact_api.pyindex 166900b2fe39..e2f38307b6cd 100644--- a/products/signals/backend/test/test_signal_report_artefact_api.py+++ b/products/signals/backend/test/test_signal_report_artefact_api.py@@ -1055,6 +1055,95 @@ class TestSignalReportArtefactViewSet(APIBaseTest):assert self._reviewer_filter_matches(report, alice)+ # --- DELETE reviewers/me (step off a report) ---++ def _leave_reviewers_url(self, report_id: str) -> str:+ return f"/api/projects/{self.team.id}/signals/reports/{report_id}/reviewers/me/"++ @parameterized.expand(+ [+ ("stored_by_uuid", True, False),+ ("stored_by_login", False, True),+ ("stored_by_both", True, True),+ ]+ )+ def test_leave_reviewers_removes_the_caller_however_they_are_stored(self, _name, by_uuid, by_login):+ _attach_github_login(self.user, "CallerCase")+ teammate = self._create_org_member("[email protected]", github_login="teammate")+ report = self._create_report()+ caller_entry: dict = {}+ if by_uuid:+ caller_entry["user_uuid"] = str(self.user.uuid)+ if by_login:+ caller_entry["github_login"] = "callercase"+ self._create_artefact(report, content=[caller_entry, {"user_uuid": str(teammate.uuid)}])++ response = self.client.delete(self._leave_reviewers_url(str(report.id)))++ assert response.status_code == status.HTTP_204_NO_CONTENT+ assert [r["user_uuid"] for r in self._latest_reviewers(report)] == [str(teammate.uuid)]+ assert not self._reviewer_filter_matches(report, self.user)++ def test_leave_reviewers_keeps_an_entry_whose_login_was_reassigned(self):+ _attach_github_login(self.user, "CallerCase")+ teammate = self._create_org_member("[email protected]", github_login=None)+ report = self._create_report()+ self._create_artefact(+ report,+ content=[+ {"user_uuid": str(teammate.uuid), "github_login": "callercase"},+ {"user_uuid": str(self.user.uuid)},+ ],+ )++ response = self.client.delete(self._leave_reviewers_url(str(report.id)))++ assert response.status_code == status.HTTP_204_NO_CONTENT+ assert [r["user_uuid"] for r in self._latest_reviewers(report)] == [str(teammate.uuid)]++ def test_leave_reviewers_does_not_reevaluate_autostart(self):+ # Auto-start runs the task as the user the row is attributed to, so this would start a+ # billable run as the person who just stepped off.+ teammate = self._create_org_member("[email protected]", github_login="teammate")+ report = self._create_report()+ self._create_artefact(report, content=[{"user_uuid": str(self.user.uuid)}, {"user_uuid": str(teammate.uuid)}])++ with patch.object(SignalReportArtefact, "_schedule_autostart_reevaluation") as scheduled:+ response = self.client.delete(self._leave_reviewers_url(str(report.id)))+ assert response.status_code == status.HTTP_204_NO_CONTENT+ assert scheduled.call_count == 0++ # The add path still re-evaluates, which is what makes the removal's silence meaningful.+ put = self.client.put(+ f"/api/projects/{self.team.id}/signals/reports/{report.id}/reviewers/",+ data=json.dumps({"content": [{"user_uuid": str(teammate.uuid)}]}),+ content_type="application/json",+ )+ assert put.status_code == status.HTTP_200_OK+ assert scheduled.call_count == 1++ def test_leave_reviewers_keeps_a_reviewer_who_left_the_organization(self):+ former = self._create_org_member("[email protected]", github_login="former")+ report = self._create_report()+ self._create_artefact(report, content=[{"user_uuid": str(self.user.uuid)}, {"user_uuid": str(former.uuid)}])+ OrganizationMembership.objects.filter(user=former, organization=self.organization).delete()++ response = self.client.delete(self._leave_reviewers_url(str(report.id)))++ assert response.status_code == status.HTTP_204_NO_CONTENT+ assert [r["user_uuid"] for r in self._latest_reviewers(report)] == [str(former.uuid)]++ def test_leave_reviewers_writes_nothing_when_the_caller_is_not_a_reviewer(self):+ teammate = self._create_org_member("[email protected]", github_login="teammate")+ report = self._create_report()+ self._create_artefact(report, content=[{"user_uuid": str(teammate.uuid)}])++ response = self.client.delete(self._leave_reviewers_url(str(report.id)))++ assert response.status_code == status.HTTP_204_NO_CONTENT+ assert self._reviewers_count(report) == 1+ assert [r["user_uuid"] for r in self._latest_reviewers(report)] == [str(teammate.uuid)]+def test_diff_with_non_dict_content_returns_400_not_500(self):# Log content is stored as arbitrary JSON; a non-object commit payload must not 500.report = self._create_report()diff --git a/products/signals/backend/views.py b/products/signals/backend/views.pyindex e8d959e8eeb1..f0fac0bd4cf1 100644--- a/products/signals/backend/views.py+++ b/products/signals/backend/views.py@@ -2621,6 +2621,30 @@ class SignalReportViewSet(read_serializer = SignalReportArtefactSerializer(new_artefact, context=self.get_serializer_context())return Response(read_serializer.data)+ @extend_schema(+ summary="Step off a report's suggested reviewers",+ description=(+ "Take the calling user off this report's suggested reviewers, leaving the other reviewers "+ "as they are. The report itself is untouched: it stays open for whoever is left, and for "+ "the project. Succeeds whether or not the caller was on the list."+ ),+ request=None,+ responses={+ 204: OpenApiResponse(description="The caller is no longer a suggested reviewer."),+ 400: OpenApiResponse(description="A reviewer who stays no longer resolves to a member of this team."),+ },+ )+ @action(detail=True, methods=["delete"], url_path="reviewers/me", required_scopes=["task:write"])+ def leave_reviewers(self, request, **kwargs):+ report = cast(SignalReport, self.get_object())+ try:+ remove_suggested_reviewer(+ team=self.team, report_id=str(report.id), user=cast(User, request.user), request=request+ )+ except ReviewerWriteError as e:+ return Response({"error": str(e)}, status=status.HTTP_400_BAD_REQUEST)+ return Response(status=status.HTTP_204_NO_CONTENT)+def destroy(self, request, *args, **kwargs):"""Soft-delete a report and its signals via the deletion workflow."""report = cast(SignalReport, self.get_object())@@ -4794,6 +4818,156 @@ def append_suggested_reviewers(return new_artefact+def _reviewer_entry_names(entry: dict, *, user_uuid: str, github_login: str | None) -> bool:+ """Whether a stored reviewer entry routes to this person.++ A login only stands in for an entry that carries no uuid of its own, the same rule the reviewer+ filter applies. GitHub reassigns logins, so matching one against an entry that names someone else+ by uuid would let the caller take that person off the report.+ """+ stored_uuid = str(entry.get("user_uuid") or "")+ if stored_uuid:+ return stored_uuid == user_uuid+ return bool(github_login) and str(entry.get("github_login") or "").strip().lower() == github_login+++def _stored_reviewer_entry(entry: dict) -> dict:+ """A stored reviewer entry in the canonical shape, carried over field for field.++ A reviewer the caller did not touch keeps whatever their entry already holds. Re-resolving them+ would make an unrelated stale entry, for someone who has since left the organization, reject a+ write that is only about the caller.+ """+ commits = entry.get("relevant_commits")+ return {+ "github_login": entry.get("github_login"),+ "user_uuid": entry.get("user_uuid"),+ "github_name": entry.get("github_name") if isinstance(entry.get("github_name"), str) else None,+ "relevant_commits": commits if isinstance(commits, list) else [],+ "reason": bounded_reviewer_reason(entry.get("reason")) or None,+ "source_skill": entry.get("source_skill"),+ "is_skill_owner": bool(entry.get("is_skill_owner")),+ }+++def remove_suggested_reviewer(*, team: Team, report_id: str, user: User, request: Request) -> bool:+ """Take one person off a report's suggested reviewers and leave everyone else as they are.++ Returns whether the person was on the list. This is deliberately not routed through+ `append_suggested_reviewers`, which exists to add: it merges a caller-supplied list forward and+ re-resolves every entry, and it lets the write re-evaluate auto-start. A removal needs the+ opposite of all three.++ The read, the filter and the write sit in one transaction behind the report lock, so a reviewer+ added between them is not dropped, and not recorded as removed by the person stepping off.++ `reevaluate_autostart=False`: the new row is attributed to the caller, and auto-start runs an+ implementation task as the user a reviewers edit is attributed to. Stepping off a report must+ never start work, least of all under the credentials of the person who just declined it.+ """+ user_id = request.user.id+ if user_id is None: # unreachable behind authentication, but keeps attribution honest+ raise serializers.ValidationError("Cannot attribute a reviewer edit to an anonymous user.")+ attribution = ArtefactAttribution.from_user(user_id)+ # Read off the request here: scout note forwarding runs after commit, where there is no request.+ scoped_team_ids = get_authenticator_scoped_team_ids(request.successful_authenticator)+ scoped_team_id_tuple = tuple(scoped_team_ids) if scoped_team_ids is not None else None+ was_impersonated = is_impersonated_session(request)+ github_login = user.get_github_login()+ github_login = github_login.lower() if github_login else None++ with transaction.atomic():+ report = (+ SignalReport.objects.select_for_update()+ .filter(id=report_id, team_id=team.id)+ .exclude(status=SignalReport.Status.DELETED)+ .first()+ )+ if report is None:+ raise NotFound()++ current = (+ SignalReportArtefact.objects.filter(+ report_id=report_id,+ type=SignalReportArtefact.ArtefactType.SUGGESTED_REVIEWERS,+ )+ .order_by("-created_at")+ .first()+ )+ try:+ prior_content = json.loads(current.content) if current else []+ except (json.JSONDecodeError, ValueError):+ prior_content = []+ if not isinstance(prior_content, list):+ return False++ prior = [entry for entry in prior_content if isinstance(entry, dict)]+ kept = [+ entry+ for entry in prior+ if not _reviewer_entry_names(entry, user_uuid=str(user.uuid), github_login=github_login)+ ]+ if len(kept) == len(prior):+ return False++ new_content = [_stored_reviewer_entry(entry) for entry in kept]+ SignalReportArtefact.append_status(+ team_id=team.id,+ report_id=str(report_id),+ content=SuggestedReviewers.model_validate(new_content),+ attribution=attribution,+ reevaluate_autostart=False,+ )++ log_activity(+ organization_id=None,+ team_id=team.id,+ user=cast(User, request.user),+ was_impersonated=was_impersonated,+ item_id=report_id,+ scope="SignalReport",+ activity="suggested_reviewers_changed",+ detail=Detail(+ name=report.title,+ changes=[+ Change(+ type="SignalReport",+ action="changed",+ field="suggested_reviewers",+ before=list(dict.fromkeys(_reviewer_identity_label(entry) for entry in prior)),+ after=list(dict.fromkeys(_reviewer_identity_label(entry) for entry in new_content)),+ )+ ],+ ),+ )+ correction = (+ None+ if was_impersonated or not github_login+ else ReviewerCorrection(+ report_id=str(report_id),+ added_logins=(),+ removed_logins=(github_login,),+ actor_user_id=user_id,+ scoped_team_ids=scoped_team_id_tuple,+ )+ )+ # on_commit so a rolled-back edit steers nothing. No notification: a removal adds no+ # reviewer and assigns no pull request.+ transaction.on_commit(+ partial(+ _record_reviewer_edit,+ team=team,+ report_id=str(report_id),+ github_logins=[entry["github_login"] for entry in new_content if entry["github_login"]],+ user_uuids=[+ entry["user_uuid"] for entry in new_content if entry["user_uuid"] and not entry["github_login"]+ ],+ correction=correction,+ )+ )+ return True++def _record_reviewer_edit(*,team: Team,diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.tsindex 54d8b90d4b39..03d05169ae58 100644--- a/products/signals/frontend/generated/api.ts+++ b/products/signals/frontend/generated/api.ts@@ -770,6 +770,25 @@ export const signalsReportsReviewersUpdate = async (})}+export const getSignalsReportsReviewersMeDestroyUrl = (projectId: string, id: string) => {+ return `/api/projects/${projectId}/signals/reports/${id}/reviewers/me/`+}++/**+ * Take the calling user off this report's suggested reviewers, leaving the other reviewers as they are. The report itself is untouched: it stays open for whoever is left, and for the project. Succeeds whether or not the caller was on the list.+ * @summary Step off a report's suggested reviewers+ */+export const signalsReportsReviewersMeDestroy = async (+ projectId: string,+ id: string,+ options?: RequestInit+): Promise<void> => {+ return apiMutator<void>(getSignalsReportsReviewersMeDestroyUrl(projectId, id), {+ ...options,+ method: 'DELETE',+ })+}+export const getSignalsReportsSignalsRetrieveUrl = (projectId: string, id: string) => {return `/api/projects/${projectId}/signals/reports/${id}/signals/`}diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex 7d53930527bd..505e6f6a975f 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -216,6 +216,26 @@ tools:id:aliases:- report_id+ inbox-reports-leave-reviewers:+ operation: signals_reports_reviewers_me_destroy+ enabled: true+ scopes:+ - task:write+ annotations:+ readOnly: false+ destructive: false+ idempotent: true+ title: Step off a report's suggested reviewers+ description: >+ Take the authenticated user off this report's suggested reviewers, leaving the other reviewers in place. Use+ it when a report was routed to them by mistake, so it stops reaching them without closing it for anyone+ else. The report's own state does not change: it stays open for whoever is left, and for the project.+ Succeeds whether or not the user was on the list, so a repeat call is safe. To change who else reviews a+ report, edit its `suggested_reviewers` artefact instead.+ param_overrides:+ id:+ aliases:+ - report_idinbox-reports-list:operation: signals_reports_listenabled: truediff --git a/products/today/backend/facade/enums.py b/products/today/backend/facade/enums.pyindex 35ede53361e9..7cfe71dd173d 100644--- a/products/today/backend/facade/enums.py+++ b/products/today/backend/facade/enums.py@@ -59,6 +59,8 @@ class ItemState(StrEnum):DONE = "done"# Dismissed or deleted since the briefing was written.DISMISSED = "dismissed"+ # The report no longer names the viewer as a reviewer, while it stays open for the team.+ LEFT = "left"class KeyClauseRole(LabeledStrEnum):diff --git a/products/today/backend/logic/briefings.py b/products/today/backend/logic/briefings.pyindex d504f12795b6..2a0d3c7f2f17 100644--- a/products/today/backend/logic/briefings.py+++ b/products/today/backend/logic/briefings.py@@ -18,7 +18,7 @@ from posthog.temporal.common.client import sync_connectfrom products.signals.backend.facade import api as signalsfrom ..facade import contracts-from ..facade.enums import BriefingStatus, BriefingTrigger, BriefingWriter, ItemGroup, ItemState+from ..facade.enums import BriefingStatus, BriefingTrigger, BriefingWriter, ItemGroup, ItemReason, ItemStatefrom ..models import DailyBriefingfrom ..temporal.inputs import GENERATE_WORKFLOW_NAME, GenerateBriefingInputs, generate_workflow_idfrom .content import BriefingContent@@ -216,6 +216,32 @@ def _live_states(reports: dict[str, signals.BriefingReportDetails]) -> dict[str,return {key: _REPORT_STATES[detail.status] for key, detail in reports.items() if detail.status in _REPORT_STATES}+_NAMES_PERSON_REASONS = frozenset({ItemReason.WAITING_FOR_YOU, ItemReason.SUGGESTED_REVIEWER})+++def _left_item_keys(team: Team, user: User, items: list[FactSheetItem], states: dict[str, ItemState]) -> set[str]:+ """Items the briefing picked because the report named the person, which it no longer does.++ The briefing is a saved list, so without this the report comes back on the next page load as+ though nothing happened. A report that already resolved or was dismissed keeps that state, which+ is the stronger thing to say about it.+ """+ candidates = {+ item.key: item.key.split(":", 1)[1]+ for item in items+ if item.key.startswith("report:") and item.reason in _NAMES_PERSON_REASONS and item.key not in states+ }+ if not candidates:+ return set()+ try:+ naming = signals.report_ids_naming_user(team_id=team.id, user=user, report_ids=list(candidates.values()))+ except Exception as error:+ # A failed lookup costs the label, not the briefing.+ capture_exception(error, {"team_id": team.id, "product": "today"})+ return set()+ return {key for key, report_id in candidates.items() if report_id not in naming}++def _report_contract(detail: signals.BriefingReportDetails) -> contracts.BriefingItemReport | None:# A deleted report keeps its state on the item, but none of its content, as in the Inbox.if detail.status == _DELETED_REPORT_STATUS:@@ -267,6 +293,7 @@ def to_contract(content = BriefingContent.model_validate(briefing.content or {})reports = _report_details(team, shown, metric_access)states = _live_states(reports)+ states |= dict.fromkeys(_left_item_keys(team, user, shown, states), ItemState.LEFT)counts = _inbox_counts(team, user, shown)return contracts.Briefing(id=str(briefing.id),diff --git a/products/today/backend/presentation/serializers.py b/products/today/backend/presentation/serializers.pyindex 41149722c98d..4b7a8874b69b 100644--- a/products/today/backend/presentation/serializers.py+++ b/products/today/backend/presentation/serializers.py@@ -138,7 +138,7 @@ class BriefingItemSerializer(DataclassSerializer):dataclass = BriefingItemextra_kwargs = {"state": {- "help_text": "`done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, else `open`. Pull requests always stay `open`."+ "help_text": "`done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, `left` when the report no longer names the viewer as a suggested reviewer, else `open`. Pull requests always stay `open`."},}diff --git a/products/today/frontend/generated/api.schemas.ts b/products/today/frontend/generated/api.schemas.tsindex bd448672d2fc..caa4eb9157b8 100644--- a/products/today/frontend/generated/api.schemas.ts+++ b/products/today/frontend/generated/api.schemas.ts@@ -241,6 +241,7 @@ export const TodayItemReasonEnumApi = {* * `open` - OPEN* * `done` - DONE* * `dismissed` - DISMISSED+ * * `left` - LEFT*/export type BriefingItemStateEnumApi = (typeof BriefingItemStateEnumApi)[keyof typeof BriefingItemStateEnumApi]@@ -248,6 +249,7 @@ export const BriefingItemStateEnumApi = {Open: 'open',Done: 'done',Dismissed: 'dismissed',+ Left: 'left',} as constexport interface BriefingItemApi {@@ -273,11 +275,12 @@ export interface BriefingItemApi {group: TodayItemGroupEnumApisource: TodayItemSourceEnumApireason: TodayItemReasonEnumApi- /** `done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, else `open`. Pull requests always stay `open`.+ /** `done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, `left` when the report no longer names the viewer as a suggested reviewer, else `open`. Pull requests always stay `open`.** * `open` - OPEN* * `done` - DONE- * * `dismissed` - DISMISSED */+ * * `dismissed` - DISMISSED+ * * `left` - LEFT */state: BriefingItemStateEnumApi}diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 620907e5c9a8..d2ef6c76e87b 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -7002,6 +7002,20 @@"readOnlyHint": false}},+ "inbox-reports-leave-reviewers": {+ "description": "Take the authenticated user off this report's suggested reviewers, leaving the other reviewers in place. Use it when a report was routed to them by mistake, so it stops reaching them without closing it for anyone else. The report's own state does not change: it stays open for whoever is left, and for the project. Succeeds whether or not the user was on the list, so a repeat call is safe. To change who else reviews a report, edit its `suggested_reviewers` artefact instead.",+ "category": "Signals",+ "feature": "signals",+ "summary": "Step off a report's suggested reviewers",+ "title": "Step off a report's suggested reviewers",+ "required_scopes": ["task:write"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": false+ }+ },"inbox-reports-list": {"description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed, i.e. human-dismissed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `dismissal_reason` / `dismissal_note` on dismissed rows) before acting. For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed`, `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.","category": "Signals",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex aae262b99961..9932bb0712e2 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -7199,6 +7199,20 @@"readOnlyHint": false}},+ "inbox-reports-leave-reviewers": {+ "description": "Take the authenticated user off this report's suggested reviewers, leaving the other reviewers in place. Use it when a report was routed to them by mistake, so it stops reaching them without closing it for anyone else. The report's own state does not change: it stays open for whoever is left, and for the project. Succeeds whether or not the user was on the list, so a repeat call is safe. To change who else reviews a report, edit its `suggested_reviewers` artefact instead.",+ "category": "Signals",+ "feature": "signals",+ "summary": "Step off a report's suggested reviewers",+ "title": "Step off a report's suggested reviewers",+ "required_scopes": ["task:write"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": false+ }+ },"inbox-reports-list": {"description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers, `unclaimed`, and `assignee=me`. Claimed reports remain actionable and visible; use `unclaimed=true` to pick work that has no owner and no draft, open, or unknown PR. Some statuses are hidden by default (currently suppressed, i.e. human-dismissed); pass `include_all_statuses=true` to list reports in every status. Do this when deduplicating against the full inbox state, and read each row's `status` (plus `dismissal_reason` / `dismissal_note` on dismissed rows) before acting. For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log, including signal findings, judgments, and log entries, is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default. To answer \"what should I look at next\", pass `view=actionable` with `use_priority_preference=true`, `sort=priority`, and `limit=10`: that returns ready, actionable reports that have no implementation PR yet, at or above the requesting user's personal PR-generation threshold, falling back to the project threshold. `use_priority_preference` selects which priorities to include, and does not order them, so pass `sort=priority` to put P0 first; the default ordering can put a recently updated P4 above an older P0. Without `limit` a page holds up to 100 reports, each with its summary. The other views are `needs_input` (waiting on a human), `needs_decision` (failed reports, plus actionable ready or pending-input reports without an implementation PR), `monitoring` (an implementation PR is open), `resolved`, `dismissed`, `not_actionable`, and `all`. Narrow by reviewer with `scope=for_me`, or `scope=teammate` plus `teammate_uuid`; the default `scope=entire_project` searches every report. `priority`, `source_product`, and `scout` each take a comma-separated list. To find the self-driving reports for one source record — e.g. what the inbox already investigated for a specific support ticket — pass that record's id as `source_id` together with exactly one `source_product` (for a support ticket: `source_product=conversations` and the ticket's UUID as `source_id`); add `include_all_statuses=true` to include dismissed ones. Each row includes typed impact metric metadata and any accessible cached snapshot, but omits live query definitions and comparisons. Queryless legacy or malformed metrics are always redacted. Listing reports does not execute metric queries.","category": "Signals",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 1898068efe32..c52a0afd7b87 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -18691,6 +18691,7 @@ export namespace Schemas {* * `open` - OPEN* * `done` - DONE* * `dismissed` - DISMISSED+ * * `left` - LEFT*/export type BriefingItemStateEnum = typeof BriefingItemStateEnum[keyof typeof BriefingItemStateEnum];@@ -18699,6 +18700,7 @@ export namespace Schemas {Open: 'open',Done: 'done',Dismissed: 'dismissed',+ Left: 'left',} as const;export interface BriefingItem {@@ -18724,11 +18726,12 @@ export namespace Schemas {group: TodayItemGroupEnum;source: TodayItemSourceEnum;reason: TodayItemReasonEnum;- /** `done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, else `open`. Pull requests always stay `open`.+ /** `done` when the item was resolved since the briefing was written, `dismissed` when it was dismissed or suppressed, `left` when the report no longer names the viewer as a suggested reviewer, else `open`. Pull requests always stay `open`.** * `open` - OPEN* * `done` - DONE- * * `dismissed` - DISMISSED */+ * * `dismissed` - DISMISSED+ * * `left` - LEFT */state: BriefingItemStateEnum;}diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 14e156f65908..e1a74884b674 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -3,7 +3,7 @@* MCP service uses these Zod schemas for generated tool handlers.* To regenerate: hogli build:openapi*- * PostHog API - MCP 52 enabled ops+ * PostHog API - MCP 53 enabled ops* OpenAPI spec version: 1.0.0*/import * as zod from 'zod'@@ -280,6 +280,19 @@ export const SignalsReportsMergeCreateBody = () => zod.object({),})+/**+ * Take the calling user off this report's suggested reviewers, leaving the other reviewers as they are. The report itself is untouched: it stays open for whoever is left, and for the project. Succeeds whether or not the caller was on the list.+ * @summary Step off a report's suggested reviewers+ */+export const SignalsReportsReviewersMeDestroyParams = () => zod.object({+ id: zod.string().describe('A UUID string identifying this signal report.'),+ project_id: zod+ .string()+ .describe(+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."+ ),+})+/*** Transition a report to a new state. The model validates allowed transitions, except that a* verdict the report already holds (dismissing a suppressed report, resolving a resolved one)diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.tsindex 28d2f9080ef2..4e5e314e12b1 100644--- a/services/mcp/src/tools/generated/signals.ts+++ b/services/mcp/src/tools/generated/signals.ts@@ -365,6 +365,27 @@ const inboxReportsClaim = (): ToolBase<},})+const InboxReportsLeaveReviewersSchema = () => {+ const SignalsReportsReviewersMeDestroyParams = orvalSchemas.SignalsReportsReviewersMeDestroyParams()+ return z.preprocess(+ normalizeParamAliases({ id: ['report_id'] }),+ SignalsReportsReviewersMeDestroyParams.omit({ project_id: true })+ )+}++const inboxReportsLeaveReviewers = (): ToolBase<ReturnType<typeof InboxReportsLeaveReviewersSchema>, unknown> => ({+ name: 'inbox-reports-leave-reviewers',+ schema: InboxReportsLeaveReviewersSchema(),+ handler: async (context: Context, params: z.infer<ReturnType<typeof InboxReportsLeaveReviewersSchema>>) => {+ const projectId = await context.stateManager.getProjectId()+ const result = await context.api.request<unknown>({+ method: 'DELETE',+ path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/reports/${encodeURIComponent(String(params.id))}/reviewers/me/`,+ })+ return result+ },+})+const InboxReportsListSchema = () => {const SignalsReportsListQueryParams = orvalSchemas.SignalsReportsListQueryParams()return SignalsReportsListQueryParams@@ -2564,6 +2585,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'inbox-report-checks-retrieve': inboxReportChecksRetrieve,'inbox-reports-bulk-set-state': inboxReportsBulkSetState,'inbox-reports-claim': inboxReportsClaim,+ 'inbox-reports-leave-reviewers': inboxReportsLeaveReviewers,'inbox-reports-list': inboxReportsList,'inbox-reports-merge': inboxReportsMerge,'inbox-reports-retrieve': inboxReportsRetrieve,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-leave-reviewers.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-leave-reviewers.jsonnew file mode 100644index 000000000000..8c12b1bce844--- /dev/null+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-leave-reviewers.json@@ -0,0 +1,11 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "properties": {+ "id": {+ "description": "A UUID string identifying this signal report.",+ "type": "string"+ }+ },+ "required": ["id"],+ "type": "object"+}