Skip to content

Open-source status page, incident response and uptime monitoring

chore: web content incident management + drop feature flag (#2849)

Maximilian Kaske45b9b509c150
diff --git a/apps/dashboard/src/app/(dashboard)/incidents/[id]/client.tsx b/apps/dashboard/src/app/(dashboard)/incidents/[id]/client.tsx
index 2f81159fe..c47412781 100644
--- a/apps/dashboard/src/app/(dashboard)/incidents/[id]/client.tsx
+++ b/apps/dashboard/src/app/(dashboard)/incidents/[id]/client.tsx
@@ -42,7 +42,6 @@ import { IncidentStatusReport } from "@/components/incidents/incident-status-rep
import { IncidentTimelineItem } from "@/components/incidents/incident-timeline";
import { ResolveReportDialog } from "@/components/incidents/resolve-report-dialog";
import { incidentEndedAt } from "@/data/managed-incidents.client";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
function slackChannelUrl(teamId: string, channelId: string): string {
@@ -51,17 +50,14 @@ function slackChannelUrl(teamId: string, channelId: string): string {
export function Client({ id }: { id: number }) {
const trpc = useTRPC();
- const enabled = useFeature("incident-management");
const { data: workspace } = useQuery(trpc.workspace.get.queryOptions());
const { data: incident, isError } = useQuery({
...trpc.incident.get.queryOptions({ id }),
- enabled,
retry: false,
});
- const { data: events } = useQuery({
- ...trpc.incident.listEvents.queryOptions({ id }),
- enabled,
- });
+ const { data: events } = useQuery(
+ trpc.incident.listEvents.queryOptions({ id }),
+ );
const [followUp, setFollowUp] = useState<{ note: string } | null>(null);
if (isError) {
diff --git a/apps/dashboard/src/app/(dashboard)/incidents/[id]/page.tsx b/apps/dashboard/src/app/(dashboard)/incidents/[id]/page.tsx
index 089e47116..f22a46c58 100644
--- a/apps/dashboard/src/app/(dashboard)/incidents/[id]/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/incidents/[id]/page.tsx
@@ -14,8 +14,8 @@ export default async function Page({
if (!Number.isInteger(incidentId)) return notFound();
const queryClient = getQueryClient();
- // Throws FORBIDDEN without the feature / NOT_FOUND for a foreign id;
- // prefetchQuery swallows both and the client renders the empty state.
+ // Throws NOT_FOUND for a foreign id; prefetchQuery swallows it and the
+ // client renders the empty state.
await Promise.all([
queryClient
.prefetchQuery(trpc.incident.get.queryOptions({ id: incidentId }))
diff --git a/apps/dashboard/src/app/(dashboard)/incidents/client.tsx b/apps/dashboard/src/app/(dashboard)/incidents/client.tsx
index 9b5e39e1a..acabe597d 100644
--- a/apps/dashboard/src/app/(dashboard)/incidents/client.tsx
+++ b/apps/dashboard/src/app/(dashboard)/incidents/client.tsx
@@ -17,29 +17,11 @@ import {
import { columns } from "@/components/data-table/managed-incidents/columns";
import { DataTable } from "@/components/ui/data-table/data-table";
import { DataTablePaginationSimple } from "@/components/ui/data-table/data-table-pagination";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
export function Client() {
const trpc = useTRPC();
- const enabled = useFeature("incident-management");
- const { data: incidents } = useQuery({
- ...trpc.incident.list.queryOptions(),
- enabled,
- });
-
- if (!enabled) {
- return (
- <SectionGroup>
- <EmptyStateContainer>
- <EmptyStateTitle>Incidents are not available yet</EmptyStateTitle>
- <EmptyStateDescription>
- Incident management is rolling out gradually.
- </EmptyStateDescription>
- </EmptyStateContainer>
- </SectionGroup>
- );
- }
+ const { data: incidents } = useQuery(trpc.incident.list.queryOptions());
return (
<SectionGroup>
diff --git a/apps/dashboard/src/app/(dashboard)/incidents/layout.tsx b/apps/dashboard/src/app/(dashboard)/incidents/layout.tsx
index 1db8e71b7..40d9b859c 100644
--- a/apps/dashboard/src/app/(dashboard)/incidents/layout.tsx
+++ b/apps/dashboard/src/app/(dashboard)/incidents/layout.tsx
@@ -15,7 +15,6 @@ export default async function Layout({
children: React.ReactNode;
}) {
const queryClient = getQueryClient();
- // Throws FORBIDDEN without the feature; prefetchQuery swallows it.
await queryClient.prefetchQuery(trpc.incident.list.queryOptions());
return (
diff --git a/apps/dashboard/src/app/(dashboard)/incidents/nav-actions.tsx b/apps/dashboard/src/app/(dashboard)/incidents/nav-actions.tsx
index 24b6954b4..d75deb47c 100644
--- a/apps/dashboard/src/app/(dashboard)/incidents/nav-actions.tsx
+++ b/apps/dashboard/src/app/(dashboard)/incidents/nav-actions.tsx
@@ -5,18 +5,16 @@ import { useParams } from "next/navigation";
import { DeclareIncidentButton } from "@/components/incidents/declare-incident-button";
import { NavFeedback } from "@/components/nav/nav-feedback";
-import { useFeature } from "@/hooks/use-feature";
export function NavActions() {
const params = useParams<{ id?: string }>();
- const enabled = useFeature("incident-management");
// The layout also wraps /incidents/[id]; the detail page has its own actions.
const isList = !params.id;
return (
<div className="flex items-center gap-2 text-sm">
<NavFeedback />
- {enabled && isList ? (
+ {isList ? (
<DeclareIncidentButton>
<Button size="sm">Declare incident</Button>
</DeclareIncidentButton>
diff --git a/apps/dashboard/src/app/(dashboard)/monitors/[id]/constants.ts b/apps/dashboard/src/app/(dashboard)/monitors/[id]/constants.ts
index c4ed02b5a..cdb290645 100644
--- a/apps/dashboard/src/app/(dashboard)/monitors/[id]/constants.ts
+++ b/apps/dashboard/src/app/(dashboard)/monitors/[id]/constants.ts
@@ -1,5 +1,5 @@
import type { IconType } from "@openstatus/icons";
-import { Settings, Overview, Logs, Incident } from "@openstatus/icons";
+import { Settings, Overview, Logs, CloudOff } from "@openstatus/icons";
export const MONITOR_TABS: {
value: string;
@@ -8,6 +8,6 @@ export const MONITOR_TABS: {
}[] = [
{ value: "overview", label: "Overview", icon: Overview },
{ value: "logs", label: "Logs", icon: Logs },
- { value: "incidents", label: "Downtime", icon: Incident },
+ { value: "incidents", label: "Downtime", icon: CloudOff },
{ value: "edit", label: "Settings", icon: Settings },
];
diff --git a/apps/dashboard/src/app/(dashboard)/monitors/[id]/incidents/page.tsx b/apps/dashboard/src/app/(dashboard)/monitors/[id]/incidents/page.tsx
index adae79f41..86020fb57 100644
--- a/apps/dashboard/src/app/(dashboard)/monitors/[id]/incidents/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/monitors/[id]/incidents/page.tsx
@@ -3,7 +3,6 @@
import { Info } from "@openstatus/icons";
import { useQuery } from "@tanstack/react-query";
import { useParams } from "next/navigation";
-import { useMemo } from "react";
import { Link } from "@/components/common/link";
import { Note } from "@/components/common/note";
@@ -19,16 +18,15 @@ import {
SectionHeader,
SectionTitle,
} from "@/components/content/section";
-import { getColumns } from "@/components/data-table/incidents/columns";
+import { columns } from "@/components/data-table/incidents/columns";
import { DataTable } from "@/components/ui/data-table/data-table";
import { DataTablePaginationSimple } from "@/components/ui/data-table/data-table-pagination";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
export default function Page() {
const { id } = useParams<{ id: string }>();
const trpc = useTRPC();
- const { data: incidents } = useQuery(
+ const { data: monitorIncidents } = useQuery(
trpc.monitorIncident.list.queryOptions({
monitorId: Number.parseInt(id),
}),
@@ -36,13 +34,8 @@ export default function Page() {
const { data: monitor } = useQuery(
trpc.monitor.get.queryOptions({ id: Number.parseInt(id) }),
);
- const incidentsEnabled = useFeature("incident-management");
- const columns = useMemo(
- () => getColumns({ declare: incidentsEnabled }),
- [incidentsEnabled],
- );
- if (!incidents || !monitor) return null;
+ if (!monitorIncidents || !monitor) return null;
return (
<SectionGroup>
@@ -67,7 +60,7 @@ export default function Page() {
)}
</SectionDescription>
</SectionHeader>
- {incidents.length === 0 ? (
+ {monitorIncidents.length === 0 ? (
<EmptyStateContainer>
<EmptyStateTitle>No downtime</EmptyStateTitle>
<EmptyStateDescription>
@@ -77,7 +70,7 @@ export default function Page() {
) : (
<DataTable
columns={columns}
- data={incidents}
+ data={monitorIncidents}
paginationComponent={DataTablePaginationSimple}
/>
)}
diff --git a/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx b/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx
index 8481710d3..9d55080a9 100644
--- a/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx
+++ b/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx
@@ -14,12 +14,10 @@ import { useState } from "react";
import { FormSheetMaintenanceCreate } from "@/components/forms/maintenance/sheet-create";
import { FormSheetStatusReportCreate } from "@/components/forms/status-report/sheet-create";
import { DeclareIncidentButton } from "@/components/incidents/declare-incident-button";
-import { useFeature } from "@/hooks/use-feature";
export function CreateEventButtonGroup() {
const [maintenanceOpen, setMaintenanceOpen] = useState(false);
const [incidentOpen, setIncidentOpen] = useState(false);
- const incidentsEnabled = useFeature("incident-management");
return (
<div>
@@ -44,11 +42,9 @@ export function CreateEventButtonGroup() {
<DropdownMenuItem onSelect={() => setMaintenanceOpen(true)}>
Create Maintenance
</DropdownMenuItem>
- {incidentsEnabled ? (
- <DropdownMenuItem onSelect={() => setIncidentOpen(true)}>
- Declare Incident
- </DropdownMenuItem>
- ) : null}
+ <DropdownMenuItem onSelect={() => setIncidentOpen(true)}>
+ Declare Incident
+ </DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</ButtonGroup>
@@ -57,7 +53,7 @@ export function CreateEventButtonGroup() {
onOpenChange={setMaintenanceOpen}
/>
{/* Mounted on demand: the sheet fetches integrations as soon as it renders. */}
- {incidentsEnabled && incidentOpen ? (
+ {incidentOpen ? (
<DeclareIncidentButton open onOpenChange={setIncidentOpen} />
) : null}
</div>
diff --git a/apps/dashboard/src/app/(dashboard)/overview/layout.tsx b/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
index ee1ac8185..5454ebbf5 100644
--- a/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
+++ b/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
@@ -20,10 +20,12 @@ export default async function Layout({
queryClient.prefetchQuery(trpc.monitorIncident.list.queryOptions()),
queryClient.prefetchQuery(trpc.statusReport.list.queryOptions({})),
queryClient.prefetchQuery(trpc.maintenance.list.queryOptions()),
- // Throws FORBIDDEN without the feature; prefetchQuery swallows it.
queryClient.prefetchQuery(
trpc.incident.list.queryOptions({ status: ["open", "mitigated"] }),
),
+ queryClient.prefetchQuery(
+ trpc.incident.list.queryOptions({ status: ["resolved", "canceled"] }),
+ ),
]);
return (
diff --git a/apps/dashboard/src/app/(dashboard)/overview/page.tsx b/apps/dashboard/src/app/(dashboard)/overview/page.tsx
index 19bac0ee3..2a853478d 100644
--- a/apps/dashboard/src/app/(dashboard)/overview/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/overview/page.tsx
@@ -3,7 +3,6 @@
import { Agent } from "@openstatus/icons";
import { useQuery } from "@tanstack/react-query";
import Link from "next/link";
-import { useMemo } from "react";
import { NoteButton } from "@/components/common/note";
import { NoteDismissible } from "@/components/common/note-dismissible";
@@ -19,8 +18,7 @@ import {
SectionTitle,
} from "@/components/content/section";
import { Section } from "@/components/content/section";
-import { columns as incidentColumns } from "@/components/data-table/managed-incidents/columns";
-import { getColumns } from "@/components/data-table/overview-events/columns";
+import { columns } from "@/components/data-table/overview-events/columns";
import {
MetricCard,
MetricCardGroup,
@@ -31,7 +29,6 @@ import {
} from "@/components/metric/metric-card";
import { DataTable } from "@/components/ui/data-table/data-table";
import { buildOverviewData } from "@/data/overview-events.client";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
import { CreateEventButtonGroup } from "./create-event-button-group";
@@ -42,33 +39,42 @@ export default function Page() {
const { data: monitors } = useQuery(trpc.monitor.list.queryOptions());
const { data: pages } = useQuery(trpc.page.list.queryOptions());
// no period — an incident open for weeks must still surface here
- const { data: incidents } = useQuery(
+ const { data: monitorIncidents } = useQuery(
trpc.monitorIncident.list.queryOptions(),
);
const { data: statusReports } = useQuery(
trpc.statusReport.list.queryOptions({}),
);
const { data: maintenances } = useQuery(trpc.maintenance.list.queryOptions());
- const incidentsEnabled = useFeature("incident-management");
- const { data: openIncidents } = useQuery({
- ...trpc.incident.list.queryOptions({ status: ["open", "mitigated"] }),
- enabled: incidentsEnabled,
- });
- const columns = useMemo(
- () => getColumns({ declare: incidentsEnabled }),
- [incidentsEnabled],
+ const { data: openIncidents, isPending: openIncidentsPending } = useQuery(
+ trpc.incident.list.queryOptions({ status: ["open", "mitigated"] }),
+ );
+ const { data: endedIncidents, isPending: endedIncidentsPending } = useQuery(
+ trpc.incident.list.queryOptions({ status: ["resolved", "canceled"] }),
);
- if (!monitors || !pages || !incidents || !statusReports || !maintenances)
+ if (
+ !monitors ||
+ !pages ||
+ !monitorIncidents ||
+ !statusReports ||
+ !maintenances ||
+ // wait for the incident queries; a failed one still renders (see below)
+ openIncidentsPending ||
+ endedIncidentsPending
+ )
return null;
const { needsAttention, upcomingMaintenances, recentlyResolved, metrics } =
buildOverviewData({
monitors,
pages,
- incidents,
+ monitorIncidents,
statusReports,
maintenances,
+ // undefined on a failed query — falls back to the downtime count
+ managedIncidents: openIncidents,
+ endedIncidents,
});
return (
@@ -119,17 +125,6 @@ export default function Page() {
})}
</MetricCardGroup>
</Section>
- {openIncidents?.length ? (
- <Section>
- <SectionHeader>
- <SectionTitle>Open Incidents</SectionTitle>
- <SectionDescription>
- Incidents your team is responding to.
- </SectionDescription>
- </SectionHeader>
- <DataTable columns={incidentColumns} data={openIncidents} />
- </Section>
- ) : null}
<Section>
<SectionHeader>
<SectionTitle>Needs Attention</SectionTitle>
diff --git a/apps/dashboard/src/app/(dashboard)/settings/integrations/slack-card.tsx b/apps/dashboard/src/app/(dashboard)/settings/integrations/slack-card.tsx
index d7065ab36..0f4d3e443 100644
--- a/apps/dashboard/src/app/(dashboard)/settings/integrations/slack-card.tsx
+++ b/apps/dashboard/src/app/(dashboard)/settings/integrations/slack-card.tsx
@@ -17,7 +17,6 @@ import {
FormCardTitle,
FormCardUpgrade,
} from "@/components/forms/form-card";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
const SERVER_URL =
@@ -43,9 +42,7 @@ export function SlackIntegrationCard({
const trpc = useTRPC();
const queryClient = useQueryClient();
const isConnected = !!integration;
- const incidents = useFeature("incident-management");
- const needsReconnect =
- incidents && (integration?.missingScopes.length ?? 0) > 0;
+ const needsReconnect = (integration?.missingScopes.length ?? 0) > 0;
const deleteIntegration = useMutation(
trpc.integrationRouter.deleteIntegration.mutationOptions({
diff --git a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/[reportId]/page.tsx b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/[reportId]/page.tsx
index d0ec20ad1..00c7c1614 100644
--- a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/[reportId]/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/[reportId]/page.tsx
@@ -29,16 +29,9 @@ export default async function Page({
queryClient.prefetchQuery(
trpc.pageSubscriber.list.queryOptions({ pageId }),
),
- // forStatusReport throws FORBIDDEN without the feature; skip it then.
- queryClient
- .fetchQuery(trpc.workspace.get.queryOptions())
- .then((workspace) =>
- workspace.features.includes("incident-management")
- ? queryClient.prefetchQuery(
- trpc.incident.forStatusReport.queryOptions({ statusReportId }),
- )
- : undefined,
- ),
+ queryClient.prefetchQuery(
+ trpc.incident.forStatusReport.queryOptions({ statusReportId }),
+ ),
]);
// the URL's page must own the report
if (report.pageId !== pageId) notFound();
diff --git a/apps/dashboard/src/app/api/chat/route.ts b/apps/dashboard/src/app/api/chat/route.ts
index b6ca81a9b..bd135dbfa 100644
--- a/apps/dashboard/src/app/api/chat/route.ts
+++ b/apps/dashboard/src/app/api/chat/route.ts
@@ -3,7 +3,6 @@ import {
type ChatStoredMessage,
storedMessageSchema,
} from "@openstatus/db/src/schema";
-import { isFeatureEnabled } from "@openstatus/services";
import {
agentTools,
buildAgentSystemPrompt,
@@ -155,10 +154,6 @@ export async function POST(req: NextRequest) {
workspaceName: ctx.workspace.name ?? "Unknown",
surface: "dashboard",
canNotifySubscribers: ctx.workspace.limits["status-subscribers"] === true,
- incidentManagement: isFeatureEnabled(
- ctx.workspace,
- "incident-management",
- ),
}),
messages: modelMessages,
tools,
diff --git a/apps/dashboard/src/components/command-menu/command-menu.tsx b/apps/dashboard/src/components/command-menu/command-menu.tsx
index d717ac273..c2872762d 100644
--- a/apps/dashboard/src/components/command-menu/command-menu.tsx
+++ b/apps/dashboard/src/components/command-menu/command-menu.tsx
@@ -153,8 +153,8 @@ export function CommandMenu() {
statusPagesGroup(data.statusPages),
statusReportsGroup(data.sortedStatusReports),
maintenancesGroup(data.sortedMaintenances, data.pageTitleById),
- navigationGroup({ incidents: data.incidentsEnabled }),
- createGroup({ incidents: data.incidentsEnabled }),
+ navigationGroup(),
+ createGroup(),
settingsGroup(),
workspacesGroup(data.otherWorkspaces, switchWorkspace),
helpGroup(),
@@ -259,7 +259,7 @@ export function CommandMenu() {
onOpenChange={(o) => setActiveSheet(o ? { sheet: "support" } : null)}
/>
{/* Mounted on demand: the sheet fetches integrations as soon as it renders. */}
- {data.incidentsEnabled && activeSheet?.sheet === "declare-incident" ? (
+ {activeSheet?.sheet === "declare-incident" ? (
<DeclareIncidentButton
open
onOpenChange={(o) => {
diff --git a/apps/dashboard/src/components/command-menu/groups/static.ts b/apps/dashboard/src/components/command-menu/groups/static.ts
index 66fcc069f..a63a07fe9 100644
--- a/apps/dashboard/src/components/command-menu/groups/static.ts
+++ b/apps/dashboard/src/components/command-menu/groups/static.ts
@@ -7,16 +7,14 @@ import { SETTINGS_TABS } from "@/config/settings";
import type { CommandMenuGroup, CommandMenuItem } from "../types";
-// Incident entries are feature-flagged. Unlike the sidebar, Incidents sits
-// right below Overview: the palette is for reaching the urgent thing fast.
-export function navigationGroup({
- incidents,
-}: {
- incidents: boolean;
-}): CommandMenuGroup {
- const items = incidents
- ? [...NAV_MENU_ITEMS.slice(0, 1), NAV.incidents, ...NAV_MENU_ITEMS.slice(1)]
- : NAV_MENU_ITEMS;
+// Unlike the sidebar, Incidents sits right below Overview: the palette is for
+// reaching the urgent thing fast.
+export function navigationGroup(): CommandMenuGroup {
+ const items = [
+ ...NAV_MENU_ITEMS.slice(0, 1),
+ NAV.incidents,
+ ...NAV_MENU_ITEMS.slice(1),
+ ];
return {
heading: "Navigation",
items: items.map((item) => ({
@@ -59,15 +57,11 @@ export function createMaintenanceItem(pageId?: number): CommandMenuItem {
};
}
-export function createGroup({
- incidents,
-}: {
- incidents: boolean;
-}): CommandMenuGroup {
+export function createGroup(): CommandMenuGroup {
return {
heading: "Create",
items: [
- ...(incidents ? [declareIncidentItem()] : []),
+ declareIncidentItem(),
{
value: "Create Monitor",
label: "Create Monitor",
diff --git a/apps/dashboard/src/components/command-menu/use-command-menu-data.ts b/apps/dashboard/src/components/command-menu/use-command-menu-data.ts
index dea8196df..60ff92db9 100644
--- a/apps/dashboard/src/components/command-menu/use-command-menu-data.ts
+++ b/apps/dashboard/src/components/command-menu/use-command-menu-data.ts
@@ -2,12 +2,10 @@
import { useQuery } from "@tanstack/react-query";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
export function useCommandMenuData({ open }: { open: boolean }) {
const trpc = useTRPC();
- const incidentsEnabled = useFeature("incident-management");
// `enabled: open` keeps the always-mounted palette from fetching on every
// dashboard load; data stays cached once fetched.
@@ -31,12 +29,9 @@ export function useCommandMenuData({ open }: { open: boolean }) {
const { data: maintenances } = useQuery(
trpc.maintenance.list.queryOptions(undefined, { enabled: open }),
);
- // Server rejects the query without the feature — never fire it unflagged.
// Server order is already open → mitigated → newest declared.
const { data: incidents } = useQuery(
- trpc.incident.list.queryOptions(undefined, {
- enabled: open && incidentsEnabled,
- }),
+ trpc.incident.list.queryOptions(undefined, { enabled: open }),
);
const otherWorkspaces =
@@ -64,8 +59,7 @@ export function useCommandMenuData({ open }: { open: boolean }) {
const pageTitleById = new Map(statusPages?.map((p) => [p.id, p.title]) ?? []);
return {
- incidentsEnabled,
- incidents: incidentsEnabled ? incidents : undefined,
+ incidents,
monitors,
statusPages,
statusReports,
diff --git a/apps/dashboard/src/components/data-table/incidents/columns.tsx b/apps/dashboard/src/components/data-table/incidents/columns.tsx
index 1bf3c22e1..fc0f55aab 100644
--- a/apps/dashboard/src/components/data-table/incidents/columns.tsx
+++ b/apps/dashboard/src/components/data-table/incidents/columns.tsx
@@ -100,9 +100,4 @@ const actionsColumn: ColumnDef<Incident> = {
},
};
-/** `declare` adds the incident-management quick action; omit it when the feature is off. */
-export function getColumns({ declare }: { declare: boolean }) {
- return declare
- ? [...baseColumns, declareColumn, actionsColumn]
- : [...baseColumns, actionsColumn];
-}
+export const columns = [...baseColumns, declareColumn, actionsColumn];
diff --git a/apps/dashboard/src/components/data-table/overview-events/columns.tsx b/apps/dashboard/src/components/data-table/overview-events/columns.tsx
index f7f5ba142..21d206a86 100644
--- a/apps/dashboard/src/components/data-table/overview-events/columns.tsx
+++ b/apps/dashboard/src/components/data-table/overview-events/columns.tsx
@@ -17,8 +17,8 @@ import { TableCellDate } from "@/components/data-table/table-cell-date";
import { TableCellLink } from "@/components/data-table/table-cell-link";
import { TableCellNumber } from "@/components/data-table/table-cell-number";
import { FormSheetStatusReportUpdateCreate } from "@/components/forms/status-report-update/sheet-create";
-import { DeclareFromRow } from "@/components/incidents/declare-from-row";
import { DataTableColumnHeader } from "@/components/ui/data-table/data-table-column-header";
+import { statusConfig as managedIncidentStatusConfig } from "@/data/managed-incidents.client";
import {
type OverviewEvent,
eventTypeConfig,
@@ -37,6 +37,8 @@ function getStatus(event: OverviewEvent): { label: string; color: string } {
switch (event.type) {
case "incident":
return incidentStatusConfig[getIncidentStatus(event.incident)];
+ case "managedIncident":
+ return managedIncidentStatusConfig[event.incident.status];
case "report":
return { label: event.report.status, color: colors[event.report.status] };
case "maintenance":
@@ -51,6 +53,11 @@ function getTitle(event: OverviewEvent): { title: string; href: string } {
title: event.incident.monitor.name,
href: `/monitors/${event.incident.monitor.id}/incidents`,
};
+ case "managedIncident":
+ return {
+ title: event.incident.title,
+ href: `/incidents/${event.incident.id}`,
+ };
case "report":
return {
title: event.report.title,
@@ -162,7 +169,7 @@ const baseColumns: ColumnDef<OverviewEvent>[] = [
},
];
-const actionColumn = (declare: boolean): ColumnDef<OverviewEvent> => ({
+const actionColumn: ColumnDef<OverviewEvent> = {
id: "action",
header: () => null,
cell: ({ row }) => {
@@ -171,13 +178,6 @@ const actionColumn = (declare: boolean): ColumnDef<OverviewEvent> => ({
case "incident":
return (
<div className="flex justify-end gap-1">
- {!declare || event.incident.resolvedAt ? null : (
- <DeclareFromRow
- title={`${event.incident.monitor.name} is down`}
- startedAt={event.incident.startedAt}
- source={{ type: "monitor_incident", id: event.incident.id }}
- />
- )}
<IncidentActionCell incident={event.incident} />
</div>
);
@@ -185,14 +185,6 @@ const actionColumn = (declare: boolean): ColumnDef<OverviewEvent> => ({
if (event.report.status === "resolved") return null;
return (
<div className="flex justify-end gap-1">
- {declare ? (
- <DeclareFromRow
- title={event.report.title}
- startedAt={getStartedAt(event)}
- source={{ type: "status_report", id: event.report.id }}
- statusReportId={event.report.id}
- />
- ) : null}
<FormSheetStatusReportUpdateCreate report={event.report}>
<Button variant="outline" size="sm" className="h-7">
Add Update
@@ -200,15 +192,16 @@ const actionColumn = (declare: boolean): ColumnDef<OverviewEvent> => ({
</FormSheetStatusReportUpdateCreate>
</div>
);
+ case "managedIncident":
case "maintenance":
return null;
}
},
enableSorting: false,
meta: {
- cellClassName: cn("text-right", declare ? "w-[180px]" : "w-[110px]"),
+ cellClassName: "w-[110px] text-right",
},
-});
+};
const actionsColumn: ColumnDef<OverviewEvent> = {
id: "actions",
@@ -217,6 +210,8 @@ const actionsColumn: ColumnDef<OverviewEvent> = {
switch (event.type) {
case "incident":
return <IncidentRowActions incident={event.incident} />;
+ case "managedIncident":
+ return null;
case "report":
return <StatusReportRowActions report={event.report} />;
case "maintenance":
@@ -228,7 +223,4 @@ const actionsColumn: ColumnDef<OverviewEvent> = {
},
};
-/** `declare` adds the incident-management quick action; omit it when the feature is off. */
-export function getColumns({ declare }: { declare: boolean }) {
- return [...baseColumns, actionColumn(declare), actionsColumn];
-}
+export const columns = [...baseColumns, actionColumn, actionsColumn];
diff --git a/apps/dashboard/src/components/data-table/table-cell-date.tsx b/apps/dashboard/src/components/data-table/table-cell-date.tsx
index bb84a7853..c9b7bece8 100644
--- a/apps/dashboard/src/components/data-table/table-cell-date.tsx
+++ b/apps/dashboard/src/components/data-table/table-cell-date.tsx
@@ -1,6 +1,9 @@
+"use client";
+
import { format } from "date-fns";
import { HoverCardTimestamp } from "@/components/common/hover-card-timestamp";
+import { useHydrated } from "@/hooks/use-hydrated";
import { cn } from "@/lib/utils";
export function TableCellDate({
@@ -9,11 +12,13 @@ export function TableCellDate({
formatStr = "LLL dd, y HH:mm:ss",
...props
}: React.ComponentProps<"div"> & { value: unknown; formatStr?: string }) {
+ // local-time text differs between server and browser
+ const hydrated = useHydrated();
if (value instanceof Date) {
return (
<HoverCardTimestamp date={value}>
<div className={cn("text-muted-foreground", className)} {...props}>
- {format(value, formatStr)}
+ {hydrated ? format(value, formatStr) : null}
</div>
</HoverCardTimestamp>
);
diff --git a/apps/dashboard/src/components/incidents/declare-from-row.tsx b/apps/dashboard/src/components/incidents/declare-from-row.tsx
index 99c11cf0e..06bc789ce 100644
--- a/apps/dashboard/src/components/incidents/declare-from-row.tsx
+++ b/apps/dashboard/src/components/incidents/declare-from-row.tsx
@@ -3,7 +3,6 @@
import { Button } from "@openstatus/ui/components/ui/button";
import { useQuery } from "@tanstack/react-query";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
import {
@@ -24,13 +23,11 @@ export function DeclareFromRow({
statusReportId?: number;
}) {
const trpc = useTRPC();
- const enabled = useFeature("incident-management");
// A report can belong to one incident; declaring another would fail on submit.
const { data: incidents } = useQuery({
...trpc.incident.list.queryOptions(),
- enabled: enabled && statusReportId !== undefined,
+ enabled: statusReportId !== undefined,
});
- if (!enabled) return null;
if (incidents?.some((i) => i.statusReport?.id === statusReportId)) {
return null;
}
diff --git a/apps/dashboard/src/components/nav/app-sidebar.tsx b/apps/dashboard/src/components/nav/app-sidebar.tsx
index afe87d160..41230be85 100644
--- a/apps/dashboard/src/components/nav/app-sidebar.tsx
+++ b/apps/dashboard/src/components/nav/app-sidebar.tsx
@@ -25,7 +25,6 @@ import { NavStatusPages } from "@/components/nav/nav-status-pages";
import { NavUser } from "@/components/nav/nav-user";
import { WorkspaceSwitcher } from "@/components/nav/workspace-switcher";
import { NAV } from "@/config/nav";
-import { useFeature } from "@/hooks/use-feature";
import { NavBanner } from "./nav-banner";
import { NavHelp } from "./nav-help";
@@ -59,19 +58,16 @@ const data = {
};
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
- const incidents = useFeature("incident-management");
- const overview = incidents
- ? [
- ...data.overview.slice(0, 3),
- {
- name: NAV.incidents.label,
- url: NAV.incidents.href,
- icon: NAV.incidents.icon,
- badge: "New",
- },
- ...data.overview.slice(3),
- ]
- : data.overview;
+ const overview = [
+ ...data.overview.slice(0, 3),
+ {
+ name: NAV.incidents.label,
+ url: NAV.incidents.href,
+ icon: NAV.incidents.icon,
+ badge: "New",
+ },
+ ...data.overview.slice(3),
+ ];
return (
<Sidebar collapsible="icon" {...props}>
diff --git a/apps/dashboard/src/components/status-reports/status-report-properties.tsx b/apps/dashboard/src/components/status-reports/status-report-properties.tsx
index 2caa9082a..218c6d4b8 100644
--- a/apps/dashboard/src/components/status-reports/status-report-properties.tsx
+++ b/apps/dashboard/src/components/status-reports/status-report-properties.tsx
@@ -13,7 +13,6 @@ import {
PropertyValue,
} from "@/components/content/property-list";
import { statusVariants } from "@/data/status-report-updates.client";
-import { useFeature } from "@/hooks/use-feature";
import { useTRPC } from "@/lib/trpc/client";
type StatusReport = NonNullable<RouterOutputs["statusReport"]["get"]>;
@@ -26,13 +25,11 @@ export function StatusReportProperties({
publicUrl: string;
}) {
const trpc = useTRPC();
- const incidentsEnabled = useFeature("incident-management");
- const { data: incident } = useQuery({
- ...trpc.incident.forStatusReport.queryOptions({
+ const { data: incident } = useQuery(
+ trpc.incident.forStatusReport.queryOptions({
statusReportId: report.id,
}),
- enabled: incidentsEnabled,
- });
+ );
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
return (
@@ -50,23 +47,21 @@ export function StatusReportProperties({
<PropertyLink href={publicUrl}>{report.page.title}</PropertyLink>
</PropertyValue>
</Property>
- {incidentsEnabled ? (
- <Property>
- <PropertyLabel>Incident</PropertyLabel>
- <PropertyValue>
- {incident ? (
- <Link
- href={`/incidents/${incident.id}`}
- className="truncate font-normal"
- >
- {incident.title}
- </Link>
- ) : (
- <span className="text-muted-foreground">None</span>
- )}
- </PropertyValue>
- </Property>
- ) : null}
+ <Property>
+ <PropertyLabel>Incident</PropertyLabel>
+ <PropertyValue>
+ {incident ? (
+ <Link
+ href={`/incidents/${incident.id}`}
+ className="truncate font-normal"
+ >
+ {incident.title}
+ </Link>
+ ) : (
+ <span className="text-muted-foreground">None</span>
+ )}
+ </PropertyValue>
+ </Property>
<Property>
<PropertyLabel>Timezone</PropertyLabel>
<PropertyValue>
diff --git a/apps/dashboard/src/data/managed-incidents.client.ts b/apps/dashboard/src/data/managed-incidents.client.ts
index 9a41b7fd8..9e16a6ec4 100644
--- a/apps/dashboard/src/data/managed-incidents.client.ts
+++ b/apps/dashboard/src/data/managed-incidents.client.ts
@@ -15,13 +15,25 @@ export const severityConfig = {
>;
export const statusConfig = {
- open: { label: "Open", variant: "destructive" },
- mitigated: { label: "Mitigated", variant: "warning" },
- resolved: { label: "Resolved", variant: "success" },
- canceled: { label: "Canceled", variant: "default" },
+ open: { label: "Open", color: "text-destructive/80", variant: "destructive" },
+ mitigated: {
+ label: "Mitigated",
+ color: "text-warning/80",
+ variant: "warning",
+ },
+ resolved: {
+ label: "Resolved",
+ color: "text-success/80",
+ variant: "success",
+ },
+ canceled: {
+ label: "Canceled",
+ color: "text-muted-foreground",
+ variant: "default",
+ },
} as const satisfies Record<
IncidentStatus,
- { label: string; variant: StatusVariant }
+ { label: string; color: string; variant: StatusVariant }
>;
/** When the incident stopped being ongoing; `null` while it still is. */
diff --git a/apps/dashboard/src/data/overview-events.client.ts b/apps/dashboard/src/data/overview-events.client.ts
index a4c896148..7974b57cf 100644
--- a/apps/dashboard/src/data/overview-events.client.ts
+++ b/apps/dashboard/src/data/overview-events.client.ts
@@ -1,5 +1,6 @@
import type { RouterOutputs } from "@openstatus/api";
import {
+ CloudOff,
Monitor,
type IconType,
Report,
@@ -9,22 +10,26 @@ import {
} from "@openstatus/icons";
import type { StatusVariant } from "@/components/common/status-dot";
+import { incidentEndedAt } from "@/data/managed-incidents.client";
import {
reportResolvedAt,
reportStartedAt,
} from "@/data/status-reports.client";
-type Incident = RouterOutputs["monitorIncident"]["list"][number];
+type MonitorIncident = RouterOutputs["monitorIncident"]["list"][number];
+type ManagedIncident = NonNullable<RouterOutputs["incident"]["list"]>[number];
type StatusReport = RouterOutputs["statusReport"]["list"][number];
type Maintenance = RouterOutputs["maintenance"]["list"][number];
export type OverviewEvent =
- | { type: "incident"; incident: Incident }
+ | { type: "incident"; incident: MonitorIncident }
+ | { type: "managedIncident"; incident: ManagedIncident }
| { type: "report"; report: StatusReport }
| { type: "maintenance"; maintenance: Maintenance };
export const eventTypeConfig = {
- incident: { label: "Downtime", icon: IncidentIcon },
+ incident: { label: "Downtime", icon: CloudOff },
+ managedIncident: { label: "Incident", icon: IncidentIcon },
report: { label: "Status Report", icon: Report },
maintenance: { label: "Maintenance", icon: MaintenanceIcon },
} as const;
@@ -79,6 +84,7 @@ export function getMaintenanceStatus(
export function getStartedAt(event: OverviewEvent): Date {
switch (event.type) {
case "incident":
+ case "managedIncident":
return event.incident.startedAt;
case "report":
return reportStartedAt(event.report);
@@ -91,6 +97,8 @@ export function getResolvedAt(event: OverviewEvent): Date | null {
switch (event.type) {
case "incident":
return event.incident.resolvedAt;
+ case "managedIncident":
+ return incidentEndedAt(event.incident);
case "report":
return reportResolvedAt(event.report);
case "maintenance":
@@ -102,6 +110,11 @@ function isOpen(event: OverviewEvent, now: Date): boolean {
switch (event.type) {
case "incident":
return !event.incident.resolvedAt;
+ case "managedIncident":
+ return (
+ event.incident.status === "open" ||
+ event.incident.status === "mitigated"
+ );
case "report":
return event.report.status !== "resolved";
case "maintenance":
@@ -121,13 +134,19 @@ export function buildOverviewData(
{
monitors,
pages,
- incidents,
+ monitorIncidents,
statusReports,
maintenances,
+ managedIncidents,
+ endedIncidents,
}: {
monitors: RouterOutputs["monitor"]["list"];
pages: RouterOutputs["page"]["list"];
- incidents: Incident[];
+ monitorIncidents: MonitorIncident[];
+ // replaces the downtime count; undefined while loading or on a failed query
+ managedIncidents?: RouterOutputs["incident"]["list"];
+ // resolved/canceled managed incidents — feed Recent Activity
+ endedIncidents?: RouterOutputs["incident"]["list"];
statusReports: StatusReport[];
maintenances: Maintenance[];
},
@@ -136,7 +155,13 @@ export function buildOverviewData(
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
const events: OverviewEvent[] = [
- ...incidents.map((incident) => ({ type: "incident" as const, incident })),
+ ...monitorIncidents.map((incident) => ({
+ type: "incident" as const,
+ incident,
+ })),
+ ...[...(managedIncidents ?? []), ...(endedIncidents ?? [])].map(
+ (incident) => ({ type: "managedIncident" as const, incident }),
+ ),
...statusReports.map((report) => ({ type: "report" as const, report })),
...maintenances.map((maintenance) => ({
type: "maintenance" as const,
@@ -157,7 +182,9 @@ export function buildOverviewData(
return resolvedAt !== null && resolvedAt >= sevenDaysAgo;
});
- const openIncidents = incidents.filter((i) => !i.resolvedAt);
+ const openIncidentsCount = managedIncidents
+ ? managedIncidents.length
+ : monitorIncidents.filter((i) => !i.resolvedAt).length;
const openReports = statusReports.filter((r) => r.status !== "resolved");
const activeMaintenances = maintenances.filter((m) => m.to >= now);
@@ -178,9 +205,10 @@ export function buildOverviewData(
},
{
title: "Open Incidents",
- value: openIncidents.length,
- variant: openIncidents.length > 0 ? "destructive" : "default",
- icon: eventTypeConfig.incident.icon,
+ value: openIncidentsCount,
+ href: managedIncidents ? "/incidents" : undefined,
+ variant: openIncidentsCount > 0 ? "destructive" : "default",
+ icon: IncidentIcon,
},
{
title: "Open Reports",
diff --git a/apps/server/src/routes/slack/agent.ts b/apps/server/src/routes/slack/agent.ts
index 5a3425d38..a255501cf 100644
--- a/apps/server/src/routes/slack/agent.ts
+++ b/apps/server/src/routes/slack/agent.ts
@@ -1,5 +1,5 @@
import type { Workspace } from "@openstatus/db/src/schema/workspaces/validation";
-import { isFeatureEnabled, type ServiceContext } from "@openstatus/services";
+import type { ServiceContext } from "@openstatus/services";
import { stepCountIs, streamText } from "ai";
import type { ModelMessage, Tool } from "ai";
@@ -105,9 +105,7 @@ export async function runAgent(
const result = streamText({
model: SLACK_AGENT_MODEL,
- system: buildSystemPrompt(workspace.name ?? "Unknown", contextNote, {
- incidentManagement: isFeatureEnabled(workspace, "incident-management"),
- }),
+ system: buildSystemPrompt(workspace.name ?? "Unknown", contextNote),
messages,
tools,
stopWhen: stepCountIs(MAX_STEPS),
diff --git a/apps/server/src/routes/slack/handler.ts b/apps/server/src/routes/slack/handler.ts
index 0e989cea7..919798fcc 100644
--- a/apps/server/src/routes/slack/handler.ts
+++ b/apps/server/src/routes/slack/handler.ts
@@ -1,5 +1,4 @@
import { getLogger } from "@logtape/logtape";
-import { isFeatureEnabled } from "@openstatus/services";
import { getIncidentBySlackChannel } from "@openstatus/services/incident";
import {
missingSlackScopes,
@@ -426,9 +425,7 @@ async function processEvent(body: SlackEvent, config: SlackConfig) {
slackUserId: userId,
});
if (actor) {
- const needsReconnect =
- isFeatureEnabled(resolved.workspace, "incident-management") &&
- missingSlackScopes(resolved.scopes).length > 0;
+ const needsReconnect = missingSlackScopes(resolved.scopes).length > 0;
await publishHomeView(slack, userId, {
reconnectUrl: needsReconnect
? `${config.dashboardUrl}/settings/integrations`
diff --git a/apps/server/src/routes/slack/home.test.ts b/apps/server/src/routes/slack/home.test.ts
index 0450a2e01..acd3b1117 100644
--- a/apps/server/src/routes/slack/home.test.ts
+++ b/apps/server/src/routes/slack/home.test.ts
@@ -4,7 +4,7 @@ import { describe, test } from "@std/testing/bdd";
import { buildHomeBlocks, OPEN_DECLARE_INCIDENT_ACTION } from "./home";
describe("buildHomeBlocks", () => {
- test("hides incidents when the feature is off", () => {
+ test("hides incidents without a list", () => {
const text = JSON.stringify(buildHomeBlocks());
expect(text).not.toContain(OPEN_DECLARE_INCIDENT_ACTION);
expect(text).not.toContain("incident declare");
diff --git a/apps/server/src/routes/slack/home.ts b/apps/server/src/routes/slack/home.ts
index be7fa2f86..e70959bb9 100644
--- a/apps/server/src/routes/slack/home.ts
+++ b/apps/server/src/routes/slack/home.ts
@@ -1,4 +1,4 @@
-import { isFeatureEnabled, type ServiceContext } from "@openstatus/services";
+import type { ServiceContext } from "@openstatus/services";
import { escapeMrkdwn, listIncidents } from "@openstatus/services/incident";
import type { WebClient } from "@slack/web-api";
import type { KnownBlock } from "@slack/web-api";
@@ -80,11 +80,9 @@ function incidentBlocks(openIncidents: HomeIncident[]): KnownBlock[] {
];
}
-/** `undefined` hides the incidents section: the feature is off here. */
export async function homeIncidents(
ctx: ServiceContext,
-): Promise<HomeIncident[] | undefined> {
- if (!isFeatureEnabled(ctx.workspace, "incident-management")) return;
+): Promise<HomeIncident[]> {
const rows = await listIncidents({
ctx,
input: { status: ["open", "mitigated"], limit: 10 },
diff --git a/apps/server/src/routes/slack/incident-commands.ts b/apps/server/src/routes/slack/incident-commands.ts
index 67b6a3d9b..1a07d4b04 100644
--- a/apps/server/src/routes/slack/incident-commands.ts
+++ b/apps/server/src/routes/slack/incident-commands.ts
@@ -1,7 +1,6 @@
import { getLogger } from "@logtape/logtape";
import {
type IncidentStatus,
- isFeatureEnabled,
type ServiceContext,
ServiceError,
} from "@openstatus/services";
@@ -118,9 +117,6 @@ export async function runIncidentCommand(args: {
}): Promise<string> {
const { words, teamId, channelId, resolved, actor } = args;
const ctx: ServiceContext = { workspace: resolved.workspace, actor };
- if (!isFeatureEnabled(resolved.workspace, "incident-management")) {
- return "Incident management isn't available for this workspace yet.";
- }
const slack = new WebClient(resolved.botToken);
const [verb = "help", ...rest] = words;
const bound = await getIncidentBySlackChannel({
diff --git a/apps/server/src/routes/slack/incident-modal.ts b/apps/server/src/routes/slack/incident-modal.ts
index 729921533..c9771dc14 100644
--- a/apps/server/src/routes/slack/incident-modal.ts
+++ b/apps/server/src/routes/slack/incident-modal.ts
@@ -1,9 +1,5 @@
import { getLogger } from "@logtape/logtape";
-import {
- isFeatureEnabled,
- type ServiceContext,
- ServiceError,
-} from "@openstatus/services";
+import { type ServiceContext, ServiceError } from "@openstatus/services";
import { escapeMrkdwn } from "@openstatus/services/incident";
import { type ModalView, WebClient } from "@slack/web-api";
import { z } from "zod";
@@ -183,15 +179,6 @@ async function gate(
botToken: resolved.botToken,
};
}
- if (!isFeatureEnabled(resolved.workspace, "incident-management")) {
- return {
- ok: false,
- view: noticeModal(
- "Incident management isn't available for this workspace yet.",
- ),
- botToken: resolved.botToken,
- };
- }
const actor = await requireSlackMember({
workspace: resolved.workspace,
teamId,
diff --git a/apps/server/src/routes/slack/registry-runner.test.ts b/apps/server/src/routes/slack/registry-runner.test.ts
index bd1c0a573..d0854fad9 100644
--- a/apps/server/src/routes/slack/registry-runner.test.ts
+++ b/apps/server/src/routes/slack/registry-runner.test.ts
@@ -379,16 +379,10 @@ describe("buildSystemPrompt coverage", () => {
// buildSlackTools hands the model every registry tool; a tool the prompt
// never mentions is one the model won't reach for (or will misuse).
test("mentions every tool the Slack agent is given", () => {
- const prompt = buildSystemPrompt("Acme Corp", undefined, {
- incidentManagement: true,
- });
+ const prompt = buildSystemPrompt("Acme Corp");
const missing = Object.keys(agentTools).filter(
(name) => !new RegExp(`\\b${name}\\b`).test(prompt),
);
expect(missing).toEqual([]);
});
-
- test("leaves incident tools out when the feature is off", () => {
- expect(buildSystemPrompt("Acme Corp")).not.toContain("declare_incident");
- });
});
diff --git a/apps/server/src/routes/slack/system-prompt.ts b/apps/server/src/routes/slack/system-prompt.ts
index 440429bbb..3b3cf9dbb 100644
--- a/apps/server/src/routes/slack/system-prompt.ts
+++ b/apps/server/src/routes/slack/system-prompt.ts
@@ -16,7 +16,6 @@ Managed incidents (internal, never published):
export function buildSystemPrompt(
workspaceName: string,
contextNote?: string,
- options: { incidentManagement?: boolean } = {},
): string {
// Intentional: a per-call ISO timestamp defeats Anthropic/Gateway
// prompt caching, but the agent needs minute-level precision to parse
@@ -135,5 +134,5 @@ Maintenance scheduling:
- Parse natural language dates into ISO 8601 format. Convert relative dates like "next Friday from 2-3 PM" into proper ISO 8601 timestamps.
- If the user doesn't specify a timezone, default to UTC and mention that in your response.
- The "from" time must be before the "to" time.
-- Write a professional maintenance message describing what will happen during the window.${options.incidentManagement ? INCIDENT_SECTION : ""}${contextNote ? `\n\n${contextNote.trim()}` : ""}`;
+- Write a professional maintenance message describing what will happen during the window.${INCIDENT_SECTION}${contextNote ? `\n\n${contextNote.trim()}` : ""}`;
}
diff --git a/apps/web/src/content/docs.config.ts b/apps/web/src/content/docs.config.ts
index efd216b7b..1a374f60a 100644
--- a/apps/web/src/content/docs.config.ts
+++ b/apps/web/src/content/docs.config.ts
@@ -261,6 +261,10 @@ export const docsNav: DocsNavSection[] = [
label: "Notification Channels Reference",
},
{ slug: "reference/incident", label: "Incident Reference" },
+ {
+ slug: "reference/incident-management",
+ label: "Incident Management Reference",
+ },
{ slug: "reference/location", label: "Location Reference" },
{
slug: "reference/private-location",
diff --git a/apps/web/src/content/mdx-components/demo/incident-slack.tsx b/apps/web/src/content/mdx-components/demo/incident-slack.tsx
new file mode 100644
index 000000000..88a6cc685
--- /dev/null
+++ b/apps/web/src/content/mdx-components/demo/incident-slack.tsx
@@ -0,0 +1,261 @@
+import { Button } from "@openstatus/ui/components/ui/button";
+
+import {
+ auditRow,
+ capitalize,
+ demo,
+ formatNumber,
+ getResponseChannel,
+ hhmm,
+} from "@/data/demo-data";
+
+import {
+ Cell,
+ CellBody,
+ CellDescription,
+ CellFooter,
+ CellHeader,
+ CellKey,
+ CellKeyValues,
+ CellRow,
+ CellSubheader,
+ CellTitle,
+ CellValue,
+ toneClass,
+} from "./cell";
+import {
+ SlackAppBadge,
+ SlackAttachment,
+ SlackAttachmentTitle,
+ SlackAuthor,
+ SlackAvatar,
+ SlackCode,
+ SlackField,
+ SlackFieldLabel,
+ SlackFields,
+ SlackFieldValue,
+ SlackLink,
+ SlackMessage,
+ SlackMessageBody,
+ SlackMessageContent,
+ SlackMessageMeta,
+ SlackReaction,
+ SlackReactions,
+ SlackTime,
+} from "./slack";
+
+const { response, company } = demo;
+const severity = capitalize(response.severity);
+const declaredAt = hhmm(auditRow("incident.create").time);
+const notedAt = hhmm(auditRow("incident_event.create").time);
+const mitigatedAt = hhmm(auditRow("incident.update", "→ mitigated").time);
+const monitoring = demo.incident.updates.find((u) => u.status === "monitoring");
+
+/** One slash command, one approval, and the incident has a channel. */
+export function IncidentDeclareDemo() {
+ return (
+ <Cell>
+ <CellHeader>
+ <CellTitle>{company.slackChannel}</CellTitle>
+ <CellDescription>slash command</CellDescription>
+ </CellHeader>
+ <CellBody className="space-y-4">
+ <SlackMessage>
+ <SlackAvatar>{company.oncall.initials}</SlackAvatar>
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>{company.oncall.name}</SlackAuthor>
+ <SlackTime>{declaredAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ <SlackCode>
+ /openstatus incident declare {response.title} --sev{" "}
+ {response.severity}
+ </SlackCode>
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ <SlackMessage>
+ <SlackAvatar variant="app" />
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>openstatus</SlackAuthor>
+ <SlackAppBadge />
+ <SlackTime>{declaredAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ <Cell className="mt-1">
+ <CellHeader>
+ <CellTitle>Declare incident</CellTitle>
+ </CellHeader>
+ <CellKeyValues>
+ <CellKey>Title</CellKey>
+ <CellValue>{response.title}</CellValue>
+ <CellKey>Severity</CellKey>
+ <CellValue className={toneClass.warning}>
+ {severity}
+ </CellValue>
+ </CellKeyValues>
+ <CellRow className="flex-wrap justify-start gap-2">
+ <Button type="button" size="sm">
+ Approve
+ </Button>
+ <Button type="button" size="sm" variant="ghost">
+ Cancel
+ </Button>
+ </CellRow>
+ </Cell>
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ <SlackMessage>
+ <SlackAvatar variant="app" />
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>openstatus</SlackAuthor>
+ <SlackAppBadge />
+ <SlackTime>{declaredAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ Incident{" "}
+ <span className="text-foreground font-medium">
+ {response.title}
+ </span>{" "}
+ declared ({response.severity}).{" "}
+ <SlackLink>Open in openstatus</SlackLink>
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ </CellBody>
+ <CellFooter>
+ <span>
+ Channel <SlackLink>{getResponseChannel()}</SlackLink> opened
+ </span>
+ <span>{company.oncall.name} invited</span>
+ </CellFooter>
+ </Cell>
+ );
+}
+
+/** The incident's own channel: pinned card on top, a pinned message becomes a timeline note. */
+export function IncidentChannelDemo() {
+ return (
+ <Cell>
+ <CellHeader>
+ <CellTitle>{getResponseChannel()}</CellTitle>
+ <CellDescription>
+ {response.severity.toUpperCase()} · open
+ </CellDescription>
+ </CellHeader>
+ <CellBody className="space-y-4">
+ <SlackMessage>
+ <SlackAvatar variant="app" />
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>openstatus</SlackAuthor>
+ <SlackAppBadge />
+ <SlackTime>{declaredAt} · pinned</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ <SlackAttachment tone="warning">
+ <SlackAttachmentTitle>{response.title}</SlackAttachmentTitle>
+ <SlackFields>
+ <SlackField>
+ <SlackFieldLabel>Severity</SlackFieldLabel>
+ <SlackFieldValue>{severity}</SlackFieldValue>
+ </SlackField>
+ <SlackField>
+ <SlackFieldLabel>Status</SlackFieldLabel>
+ <SlackFieldValue>Open</SlackFieldValue>
+ </SlackField>
+ </SlackFields>
+ <div className="text-muted-foreground text-xs">
+ <SlackLink>Open in openstatus</SlackLink> · Pin a message with
+ 📌 to add it to the timeline.
+ </div>
+ </SlackAttachment>
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ <SlackMessage>
+ <SlackAvatar>{company.oncall.initials}</SlackAvatar>
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>{company.oncall.name}</SlackAuthor>
+ <SlackTime>{notedAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>{response.note}</SlackMessageBody>
+ <SlackReactions>
+ <SlackReaction>📌 1</SlackReaction>
+ <SlackReaction>✅ 1</SlackReaction>
+ </SlackReactions>
+ </SlackMessageContent>
+ </SlackMessage>
+ </CellBody>
+ <CellFooter>
+ <span>Pinned messages land on the timeline</span>
+ <span>
+ Reminder after {response.staleAfterHours}h without an update
+ </span>
+ </CellFooter>
+ </Cell>
+ );
+}
+
+/** Internal status from the channel; the public report keeps its own wording. */
+export function IncidentStatusDemo() {
+ if (!monitoring) throw new Error("No monitoring update");
+ return (
+ <Cell>
+ <CellHeader>
+ <CellTitle>{getResponseChannel()}</CellTitle>
+ <CellDescription>slash command</CellDescription>
+ </CellHeader>
+ <CellBody className="space-y-4">
+ <SlackMessage>
+ <SlackAvatar>{company.oncall.initials}</SlackAvatar>
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>{company.oncall.name}</SlackAuthor>
+ <SlackTime>{mitigatedAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ <SlackCode>
+ /openstatus incident mitigate {response.mitigation}
+ </SlackCode>
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ <SlackMessage>
+ <SlackAvatar variant="app" />
+ <SlackMessageContent>
+ <SlackMessageMeta>
+ <SlackAuthor>openstatus</SlackAuthor>
+ <SlackAppBadge />
+ <SlackTime>{mitigatedAt}</SlackTime>
+ </SlackMessageMeta>
+ <SlackMessageBody>
+ Incident{" "}
+ <span className="text-foreground font-medium">
+ {response.title}
+ </span>{" "}
+ is now <span className={toneClass.warning}>mitigated</span>.
+ </SlackMessageBody>
+ </SlackMessageContent>
+ </SlackMessage>
+ </CellBody>
+ <CellSubheader>Linked status report</CellSubheader>
+ <CellRow>
+ <span className="truncate">{demo.incident.title}</span>
+ <span className={toneClass.info}>{capitalize(monitoring.status)}</span>
+ </CellRow>
+ <CellBody className="text-muted-foreground text-xs text-pretty">
+ {monitoring.message}
+ </CellBody>
+ <CellFooter>
+ <span>Internal status and public update move separately</span>
+ <span>{formatNumber(demo.subscribers.email)} subscribers notified</span>
+ </CellFooter>
+ </Cell>
+ );
+}
diff --git a/apps/web/src/content/mdx-components/demo/incident.tsx b/apps/web/src/content/mdx-components/demo/incident.tsx
new file mode 100644
index 000000000..27628e2a0
--- /dev/null
+++ b/apps/web/src/content/mdx-components/demo/incident.tsx
@@ -0,0 +1,163 @@
+import { Button } from "@openstatus/ui/components/ui/button";
+
+import {
+ auditRow,
+ capitalize,
+ demo,
+ formatMinutes,
+ getResponseEvents,
+ hhmm,
+ minutesBetween,
+} from "@/data/demo-data";
+
+import {
+ Cell,
+ CellBody,
+ CellDescription,
+ CellFooter,
+ CellGrid,
+ CellGridItem,
+ CellHeader,
+ CellLabel,
+ CellMetric,
+ CellRow,
+ CellSubheader,
+ CellTitle,
+} from "./cell";
+
+const { response } = demo;
+const startedAt = auditRow("monitor.alert").time;
+const resolvedAt = auditRow("incident.update", "→ resolved").time;
+const duration = formatMinutes(minutesBetween(startedAt, resolvedAt));
+
+/** The incident page in the dashboard: properties on top, the timeline below. */
+export function IncidentDemo() {
+ const events = getResponseEvents();
+ return (
+ <Cell>
+ <CellHeader>
+ <CellTitle>{response.title}</CellTitle>
+ <CellDescription>Incident #{response.id}</CellDescription>
+ </CellHeader>
+ <CellGrid cols={2} sm={4}>
+ <CellGridItem>
+ <CellLabel>Severity</CellLabel>
+ <CellMetric tone="warning">
+ {capitalize(response.severity)}
+ </CellMetric>
+ </CellGridItem>
+ <CellGridItem>
+ <CellLabel>Status</CellLabel>
+ <CellMetric tone="success">Resolved</CellMetric>
+ </CellGridItem>
+ <CellGridItem>
+ <CellLabel>Commander</CellLabel>
+ <CellMetric>{response.commander}</CellMetric>
+ </CellGridItem>
+ <CellGridItem>
+ <CellLabel>Duration</CellLabel>
+ <CellMetric>{duration}</CellMetric>
+ </CellGridItem>
+ </CellGrid>
+ <CellSubheader>Timeline</CellSubheader>
+ {events.map((event) => (
+ <CellRow
+ key={event.time}
+ className="grid grid-cols-[48px_minmax(0,1fr)_auto] gap-x-3 gap-y-0 py-1.5 text-xs"
+ >
+ <span className="text-muted-foreground">{hhmm(event.time)}</span>
+ <span className="truncate">{event.label}</span>
+ <span className="text-muted-foreground truncate text-right">
+ {event.by}
+ </span>
+ {event.message ? (
+ <span className="text-muted-foreground col-span-2 col-start-2 truncate">
+ {event.message}
+ </span>
+ ) : null}
+ </CellRow>
+ ))}
+ <CellFooter>
+ <span>Started {hhmm(startedAt)} UTC, when the monitor alerted</span>
+ <span>{events.length} events</span>
+ </CellFooter>
+ </Cell>
+ );
+}
+
+/** The agent's draft, in the seven sections every postmortem gets. */
+export function PostmortemDemo() {
+ const { postmortem } = response;
+ const timeline = [...getResponseEvents()]
+ .reverse()
+ .filter((event) => !event.label.startsWith("Postmortem"));
+ const sections = [
+ { label: "Summary", text: postmortem.summary },
+ {
+ label: "Impact",
+ text: `Checkout requests routed through Europe failed for ${duration}, from ${hhmm(startedAt)} to ${hhmm(resolvedAt)} UTC. Payments outside Europe were not affected.`,
+ },
+ ];
+ const lessons = [
+ { label: "Root cause", text: postmortem.rootCause },
+ { label: "What went well", text: postmortem.wentWell },
+ { label: "What went wrong", text: postmortem.wentWrong },
+ ];
+ return (
+ <Cell>
+ <CellHeader>
+ <CellTitle>Postmortem</CellTitle>
+ <CellDescription>Draft · drafted by the agent</CellDescription>
+ </CellHeader>
+ {sections.map((section) => (
+ <CellBody key={section.label} className="space-y-1 py-2 text-xs">
+ <CellLabel>{section.label}</CellLabel>
+ <p className="text-pretty">{section.text}</p>
+ </CellBody>
+ ))}
+ <CellBody className="space-y-1 py-2 text-xs">
+ <CellLabel>Timeline</CellLabel>
+ <ul>
+ {timeline.map((event) => (
+ <li key={event.time} className="truncate">
+ <span className="text-muted-foreground">
+ {hhmm(event.time)} UTC
+ </span>{" "}
+ {event.label}
+ </li>
+ ))}
+ </ul>
+ </CellBody>
+ {lessons.map((section) => (
+ <CellBody key={section.label} className="space-y-1 py-2 text-xs">
+ <CellLabel>{section.label}</CellLabel>
+ <p className="text-pretty">{section.text}</p>
+ </CellBody>
+ ))}
+ <CellBody className="space-y-1 py-2 text-xs">
+ <CellLabel>Action items</CellLabel>
+ <ul>
+ {postmortem.actionItems.map((item) => (
+ <li key={item}>
+ <span className="text-muted-foreground">[ ]</span> {item}
+ </li>
+ ))}
+ </ul>
+ </CellBody>
+ <CellRow className="flex-wrap justify-start gap-2">
+ <Button type="button" size="sm">
+ Approve
+ </Button>
+ <Button type="button" size="sm" variant="outline">
+ Draft with agent
+ </Button>
+ </CellRow>
+ <CellFooter>
+ <span>
+ Built from the timeline, public updates and the Slack channel
+ </span>
+ <span>Approve, then close the incident</span>
+ </CellFooter>
+ </Cell>
+ );
+}
diff --git a/apps/web/src/content/mdx-components/demo/index.tsx b/apps/web/src/content/mdx-components/demo/index.tsx
index 96163fafc..7f87e84de 100644
--- a/apps/web/src/content/mdx-components/demo/index.tsx
+++ b/apps/web/src/content/mdx-components/demo/index.tsx
@@ -4,6 +4,12 @@ import { AssertionsDemo } from "./assertions";
import { AuditDemo, StatusReportDemo } from "./audit";
import { ComponentsDemo } from "./components";
import { ImportDemo } from "./import";
+import { IncidentDemo, PostmortemDemo } from "./incident";
+import {
+ IncidentChannelDemo,
+ IncidentDeclareDemo,
+ IncidentStatusDemo,
+} from "./incident-slack";
import { LogsDemo } from "./logs";
import { MaintenanceDemo } from "./maintenance";
import { MonitorDemo } from "./monitor";
@@ -39,6 +45,11 @@ const demos = {
"private-location": PrivateLocationDemo,
timing: TimingDemo,
logs: LogsDemo,
+ incident: IncidentDemo,
+ "incident-declare": IncidentDeclareDemo,
+ "incident-channel": IncidentChannelDemo,
+ "incident-status": IncidentStatusDemo,
+ postmortem: PostmortemDemo,
} as const;
export type DemoType = keyof typeof demos;
diff --git a/apps/web/src/content/mdx-components/demo/slack.tsx b/apps/web/src/content/mdx-components/demo/slack.tsx
index 4757a6480..ec9ab52c7 100644
--- a/apps/web/src/content/mdx-components/demo/slack.tsx
+++ b/apps/web/src/content/mdx-components/demo/slack.tsx
@@ -216,6 +216,36 @@ export function SlackFieldValue({
);
}
+/** Reaction row under a message; each `SlackReaction` is an emoji and its count. */
+export function SlackReactions({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="slack-reactions"
+ className={cn("flex flex-wrap gap-1 pt-1", className)}
+ {...props}
+ />
+ );
+}
+
+export function SlackReaction({
+ className,
+ ...props
+}: React.ComponentProps<"span">) {
+ return (
+ <span
+ data-slot="slack-reaction"
+ className={cn(
+ "border-border bg-muted text-foreground border px-1.5 py-0.5 text-xs",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
/** Inline link or @mention. */
export function SlackLink({
className,
diff --git a/apps/web/src/content/pages/docs/concept/status-reports-and-incidents.mdx b/apps/web/src/content/pages/docs/concept/status-reports-and-incidents.mdx
index a3668ecfe..bd8c07f78 100644
--- a/apps/web/src/content/pages/docs/concept/status-reports-and-incidents.mdx
+++ b/apps/web/src/content/pages/docs/concept/status-reports-and-incidents.mdx
@@ -23,7 +23,7 @@ The word "incident" is overloaded. Colloquially it means the whole event — the
## Incidents: detection
-An incident is created **automatically** when at least half of a monitor's configured regions report an `error` — requiring agreement across regions is what filters out a single flaky probe. You never create an incident by hand.
+An incident is created **automatically** when at least half of a monitor's configured regions report an `error` — requiring agreement across regions is what filters out a single flaky probe. You never create this kind of incident by hand.
An incident is scoped to a single **monitor** and is primarily an internal object:
@@ -37,7 +37,7 @@ Think of an incident as the smoke detector going off. It tells *you* something i
A status report is what your users actually read. It is created **manually** (dashboard, CLI, or API), belongs to a single **status page**, and is attached to one or more of that page's [components](/docs/reference/page-components) — the services your users recognize, not your internal monitors.
-Crucially, a status report is **not linked to an incident** in the data model. They are independent:
+Crucially, a status report is **not linked to a monitor's incident** in the data model. They are independent:
- A monitor can fail (incident) without you publishing anything — say, a flapping internal service.
- You can publish a report with no incident behind it — a third-party provider is down, or you spot a problem your monitors can't see.
@@ -64,6 +64,12 @@ Each update can declare a per-component impact — `degraded_performance`, `part
The [Status report reference](/docs/reference/status-report) covers the exact impact semantics and weights.
+## Declared incidents: coordination
+
+Detection and communication leave a gap: the team's own record of the event. With incident management, someone **declares** an incident by hand, from the dashboard or Slack. It carries a severity, a commander, an internal timeline and, once resolved, a postmortem.
+
+A declared incident is internal. It can link to a status report, and each keeps its own status: the team can mark the incident `mitigated` while the public report still says `monitoring`. See the [Incident management reference](/docs/reference/incident-management).
+
## Maintenance windows: planned disruption
A maintenance window is for disruption you know about **in advance** — a database upgrade, a migration, a deploy with expected downtime. Like a status report, it belongs to one status page and targets that page's components. Unlike a status report, it is scheduled: it has a `from` and a `to`, and during that window the affected components display **Under Maintenance**.
@@ -101,4 +107,4 @@ On the status page itself, when several apply to one component, the worst wins:
- **[Publish your first status report](/docs/tutorial/your-first-status-report)** — the hands-on version of this page.
- **[Building trust with status pages](/docs/concept/best-practices-status-page)** — what to write in those updates.
-- **[Incident](/docs/reference/incident)**, **[Status report](/docs/reference/status-report)**, and **[Maintenance](/docs/reference/maintenance)** references — the field-level specifications.
+- **[Incident](/docs/reference/incident)**, **[Incident management](/docs/reference/incident-management)**, **[Status report](/docs/reference/status-report)**, and **[Maintenance](/docs/reference/maintenance)** references — the field-level specifications.
diff --git a/apps/web/src/content/pages/docs/guides/how-to-setup-slack-agent.mdx b/apps/web/src/content/pages/docs/guides/how-to-setup-slack-agent.mdx
index 59baf9c46..2aefa95a5 100644
--- a/apps/web/src/content/pages/docs/guides/how-to-setup-slack-agent.mdx
+++ b/apps/web/src/content/pages/docs/guides/how-to-setup-slack-agent.mdx
@@ -44,6 +44,7 @@ The available slash commands are:
- `/openstatus subscribe <status-page-url>` — subscribe this channel to a status page
- `/openstatus unsubscribe [status-page-url]` — unsubscribe. The URL is optional when the channel is subscribed to exactly one page; with several, the command lists them and asks you to name one.
- `/openstatus subscriptions` — show this channel's subscriptions
+- `/openstatus incident …` — declare and run incidents, see [step 6](#6-run-an-incident-from-slack)
- `/openstatus help` — show this list (also the response to any unrecognised subcommand)
A channel subscribed this way receives updates for the whole page. For component scoping, and for the other ways a status page can be followed (email, feeds, webhooks), see the [subscriber reference](/docs/reference/subscriber).
@@ -96,11 +97,53 @@ Plan downtime so subscribers are informed in advance.
@openstatus schedule a maintenance window for my database next Friday from 2–3 PM.
```
+### 6. Run an incident from Slack
+
+The examples above publish to your status page. An incident is the internal side: a severity, a commander, a timeline and a postmortem, in a Slack channel of its own.
+
+<Aside>Incident management is rolling out workspace by workspace. If the commands below answer that it isn't available yet, it is not enabled for your workspace. If you installed the Slack app before incident management, go to **Settings** > **Integrations** and click **Reconnect** to grant the new permissions.</Aside>
+
+#### Declare
+
+```
+/openstatus incident declare Checkout API 503s in EU --sev major
+```
+
+Approve the card and the incident exists. openstatus opens a channel named `inc-YYYY-MM-DD-<title>`, invites you, sets the severity and status as the topic and pins the incident card. Run `/openstatus incident declare` without a title to get a form instead.
+
+#### Keep the timeline
+
+In the incident's channel, react to any message with 📌 and it becomes a note on the incident's timeline. Or write one directly:
+
+```
+/openstatus incident note Rolling back the 09:38 edge config deploy.
+```
+
+#### Change the status
+
+```
+/openstatus incident mitigate Rollback complete in eu-west-1 and eu-west-2.
+/openstatus incident resolve
+```
+
+`cancel` and `reopen` work the same way. Outside the incident's channel, name the incident: `/openstatus incident resolve #12`. The status report on your status page is not touched; update it separately.
+
+#### Draft the postmortem
+
+```
+/openstatus incident postmortem
+```
+
+Once the incident is resolved, the agent drafts a postmortem from the timeline, the public updates and the channel history, then posts a card to approve it and close the incident. Closing archives the channel.
+
+`/openstatus incident status` shows where an incident stands and `/openstatus incident list` shows the open ones. The [Incident management reference](/docs/reference/incident-management) has every command, the status rules and the reminder thresholds.
+
## What you've accomplished
- Installed the openstatus Slack agent in your workspace
- Connected your openstatus account to Slack
- Learned how to manage incidents directly from Slack
+- Declared an incident and ran it in its own channel
## Troubleshooting
@@ -118,7 +161,12 @@ Your Slack workspace admin may need to approve the app. Ask your workspace admin
Make sure you have at least one monitor and one status page created in your openstatus workspace before using incident commands.
+### No channel was created for an incident
+
+The incident is declared either way. A missing channel means the Slack app lacks the permissions added for incident channels: go to **Settings** > **Integrations** and click **Reconnect**.
+
## What's next
+- **[Incident management reference](/docs/reference/incident-management)** — severities, statuses, the timeline and the postmortem.
- **[Create a status page](/docs/tutorial/create-your-first-status-page)** — share your service status publicly with users.
- **[Create a monitor](/docs/tutorial/create-your-first-monitor)** — set up uptime monitoring for your endpoints.
diff --git a/apps/web/src/content/pages/docs/reference/incident-management.mdx b/apps/web/src/content/pages/docs/reference/incident-management.mdx
new file mode 100644
index 000000000..f9cd62e97
--- /dev/null
+++ b/apps/web/src/content/pages/docs/reference/incident-management.mdx
@@ -0,0 +1,115 @@
+---
+category: Reference
+title: Incident Management Reference
+description: Technical specification for declared incidents - severity, status, timeline, postmortem and the Slack channel
+---
+
+A managed incident is your team's internal record of an outage: who declared it, how severe it is, who is in command, what happened when, and the postmortem that follows. Someone on the team declares it. Nothing about it is published.
+
+It is a different object from the two things it sits between:
+
+- A **[monitor incident](/docs/reference/incident)** is created automatically when a monitor fails. It is a downtime record for one monitor.
+- A **[status report](/docs/reference/status-report)** is what your users read on the status page.
+
+## Declaring an incident
+
+- **Dashboard**: from **Incidents**, or from a monitor's downtime row or a status report, which pre-fills the start time.
+- **Slack**: `/openstatus incident declare`, see [Slack](#slack).
+- **Agents**: the `declare_incident` tool, see the [MCP server reference](/docs/reference/mcp-server#incidents).
+
+## Properties
+
+| Property | Description |
+|---|---|
+| Title | Required, up to 256 characters. |
+| Severity | `critical`, `major` or `minor`. |
+| Status | `open`, `mitigated`, `resolved` or `canceled`. |
+| Summary | Optional, up to 4,000 characters. |
+| Commander | Optional workspace member in charge of the incident. |
+| Started at | When the impact began. Defaults to the declare time, or to the start of the monitor incident or status report it was declared from. Can be set in the past. |
+| Status report | Optional link to one status report. |
+| Slack channel | The incident's channel, when Slack is connected. |
+
+## Severity
+
+| Severity | Use for | Stale reminder after |
+|---|---|---|
+| `critical` | Major outage or data loss | 1 hour |
+| `major` | Significant degradation | 4 hours |
+| `minor` | Limited impact | 24 hours |
+
+## Status
+
+| Status | Meaning | Can move to |
+|---|---|---|
+| `open` | Declared, impact ongoing | `mitigated`, `resolved`, `canceled` |
+| `mitigated` | Impact stopped, cause not yet fixed | `resolved`, `open`, `canceled` |
+| `resolved` | Fixed | `open` (reopen) |
+| `canceled` | False alarm | Nothing. Canceling closes the incident. |
+
+A status change can carry a note, which lands on the timeline.
+
+### Closing
+
+Closing ends the incident's life. Only a resolved incident can be closed, by an owner, an admin or the incident's commander, and it needs an approved postmortem unless you explicitly skip it. A closed incident is frozen: status, severity, commander and notes can no longer change.
+
+## Timeline
+
+Every change is appended to the incident's timeline with its time and the member behind it: declared, severity, status, commander and start-time changes, notes, status report links, Slack channel binding, postmortem drafted and approved, closed.
+
+Notes are internal and append-only, up to 10,000 characters each.
+
+## Status report link
+
+An incident can link to one status report. The two keep their own status: marking the incident `mitigated` or `resolved` does not post a public update or resolve the report. Resolve the report separately, with its own public message.
+
+## Postmortem
+
+A postmortem is a markdown document attached to a resolved incident. It is either a `draft` or `approved`.
+
+- The agent drafts it from the incident's fields, its timeline, the linked status report's updates and the history of the incident's Slack channel. Where it has no facts it says what is unknown.
+- The draft has seven sections: Summary, Impact, Timeline, Root cause, What went well, What went wrong, Action items.
+- Drafting again replaces the draft. Once approved, the agent can no longer redraft it; a person can still edit it.
+- An owner, an admin or the incident's commander approves it. Approving closes the incident by default.
+
+## Slack
+
+Requires the [Slack agent](/docs/guides/how-to-setup-slack-agent), which is available on paid plans.
+
+### Channel per incident
+
+Declaring an incident, from Slack or the dashboard, opens a channel named `inc-YYYY-MM-DD-<title-slug>` (UTC date). The declarer is invited, the topic shows severity, status and a link to the incident, and the incident card is pinned.
+
+- React to a message with 📌 (`:pushpin:`) and it becomes a timeline note, attributed to its author and linked back to Slack. The bot confirms with ✅.
+- Status changes are announced in the channel and the topic is kept in sync.
+- The channel is archived when the incident is closed or canceled.
+
+A failure on Slack's side never loses the incident: it is declared first, the channel is opened after.
+
+### Commands
+
+| Command | What it does |
+|---|---|
+| `/openstatus incident declare` | Opens the declare form. |
+| `/openstatus incident declare <title> [--sev critical\|major\|minor]` | Declares an incident. Severity defaults to `major`. |
+| `/openstatus incident note <text>` | Adds a note to the timeline. Incident channel only. |
+| `/openstatus incident mitigate\|resolve\|cancel\|reopen [#id] [note]` | Changes the status. |
+| `/openstatus incident status [#id]` | Shows where the incident stands. |
+| `/openstatus incident postmortem [#id]` | Drafts the postmortem and posts a card to approve and close. |
+| `/openstatus incident list` | Lists open incidents. |
+
+`#id` is optional inside an incident's channel. Commands that change something post an approval card first; nothing happens until someone approves it.
+
+### Stale reminders
+
+An `open` or `mitigated` incident with no activity gets a reminder after the threshold for its [severity](#severity). If it stays quiet, the next reminders follow at twice, four times and eight times that threshold, and so on. The reminder goes to the incident's channel. Without a channel it is sent as a direct message to the commander, or else to the person who declared it.
+
+## Audit log
+
+Every change to an incident or its postmortem is written to the audit log with the member behind it, whether it came from the dashboard, Slack or an agent.
+
+## Related resources
+
+- **[Understanding status reports and incidents](/docs/concept/status-reports-and-incidents)**: how the objects fit together.
+- **[Set up the Slack agent](/docs/guides/how-to-setup-slack-agent)**: install Slack and run your first incident from it.
+- **[MCP server reference](/docs/reference/mcp-server#incidents)**: the incident tools for agents.
diff --git a/apps/web/src/content/pages/docs/reference/incident.mdx b/apps/web/src/content/pages/docs/reference/incident.mdx
index 45c261741..d90c08daa 100644
--- a/apps/web/src/content/pages/docs/reference/incident.mdx
+++ b/apps/web/src/content/pages/docs/reference/incident.mdx
@@ -37,7 +37,9 @@ new state — a recovery alert for `active`, a degraded alert for `degraded`.
The stored `status` field accepts `triage` (the default), `investigating`, `identified`, `monitoring`, `resolved`, and `duplicated`.
-Incidents are distinct from status reports. Status reports are the manual, public communication channel on your status page and are not linked to an incident record — see the [Status report reference](/docs/reference/status-report).
+Incidents are distinct from status reports. Status reports are the manual, public communication channel on your status page and are not linked to a monitor's incident record — see the [Status report reference](/docs/reference/status-report).
+
+This page covers the incident a monitor opens on its own. The incident your team declares, with a severity, a commander, a timeline and a postmortem, is a separate object: see the [Incident management reference](/docs/reference/incident-management).
## Properties
@@ -53,3 +55,4 @@ While an incident is active, it collects and displays key information related to
## Related resources
- **[Status report reference](/docs/reference/status-report)** — how to communicate an incident publicly on your status page.
+- **[Incident management reference](/docs/reference/incident-management)** — declared incidents, their timeline and postmortem.
diff --git a/apps/web/src/content/pages/docs/reference/mcp-server.mdx b/apps/web/src/content/pages/docs/reference/mcp-server.mdx
index 1a1fc3795..e3e1ec2bc 100644
--- a/apps/web/src/content/pages/docs/reference/mcp-server.mdx
+++ b/apps/web/src/content/pages/docs/reference/mcp-server.mdx
@@ -53,7 +53,7 @@ Get a key from the dashboard's **Settings > General**, in the **API Keys** card.
Both credentials carry a scope that controls what tools the MCP server exposes:
-- **Read-only** — the server only registers read tools (`list_*` and `get_*`). Mutation tools (`create_*`, `update_*`, `add_*`, `resolve_*`) are not advertised in `tools/list` and cannot be called.
+- **Read-only** — the server only registers read tools (`list_*` and `get_*`). Mutation tools (`create_*`, `update_*`, `add_*`, `resolve_*`, and the incident tools `declare_*`, `set_*`, `draft_*`, `approve_*`) are not advertised in `tools/list` and cannot be called.
- **Read & write** — every tool is available.
With OAuth you choose the scope on the consent screen; a client may request read & write and you can still downgrade it to read-only. On an API key the scope is set at creation time and is **immutable**: to change it, revoke the key and issue a new one.
@@ -62,7 +62,7 @@ For AI agents that should only observe state — health summaries, paging on-cal
## Tools
-The server exposes 23 tools (21 on plans without the `audit-log` feature), grouped by resource: 19 scoped to the workspace tied to your credential, plus 4 public content tools that read openstatus.dev pages on any credential and any scope (see [Content](#content)). Mutations write to the audit log with `actor_type = "mcp"` (see [Audit log](#audit-log)).
+The server exposes 23 tools (21 on plans without the `audit-log` feature), grouped by resource: 19 scoped to the workspace tied to your credential, plus 4 public content tools that read openstatus.dev pages on any credential and any scope (see [Content](#content)). Workspaces with incident management enabled get 10 more (see [Incidents](#incidents)). Mutations write to the audit log with `actor_type = "mcp"` (see [Audit log](#audit-log)).
### Pages
@@ -88,6 +88,23 @@ The server exposes 23 tools (21 on plans without the `audit-log` feature), group
| `list_maintenances` | read | List maintenance windows newest-first. Paginated via `page` (1-indexed) and `perPage`; response carries a `pagination` object with `page`, `perPage`, `totalSize`, and `totalPages`. |
| `create_maintenance` | mutation | Schedule a maintenance window (`from` / `to` are ISO 8601 strings). |
+### Incidents
+
+Registered only when incident management is enabled for the workspace — otherwise these tools are absent from `tools/list`. They act on declared incidents, not on monitor downtime, and are internal: none of them publishes to a status page or notifies subscribers. See the [Incident management reference](/docs/reference/incident-management).
+
+| Tool | Type | Purpose |
+|-----------------------|----------|---------|
+| `list_incidents` | read | List declared incidents, open ones first. Optional `status` filter; `limit` ≤ 100 and `offset`. |
+| `get_incident` | read | One incident with its timeline (newest first, up to 50 events) and linked status report. |
+| `declare_incident` | mutation | Declare an incident with a `title` and `severity` (`critical` / `major` / `minor`), optionally a summary, commander, start time and status report to link. |
+| `update_incident` | mutation | Change the title, severity, summary, commander or start time. |
+| `set_incident_status` | mutation | Move to `mitigated`, `resolved`, `canceled` or back to `open`, with an optional timeline note. Canceling closes the incident for good. |
+| `resolve_incident` | mutation | Mark an incident resolved. Does not resolve its status report; use `resolve_status_report` for that. |
+| `add_incident_note` | mutation | Append a note to the timeline. Append-only. |
+| `get_postmortem` | read | Read the incident's postmortem (markdown), if one was drafted. |
+| `draft_postmortem` | mutation | Save a postmortem draft for a resolved incident. Replaces an existing draft; an approved postmortem can't be redrafted. |
+| `approve_postmortem` | mutation | Approve the draft and, by default, close the incident. Only an owner, an admin or the incident's commander can approve. |
+
### Monitors
| Tool | Type | Purpose |
diff --git a/apps/web/src/content/pages/home.mdx b/apps/web/src/content/pages/home.mdx
index 58229390d..65b8acecf 100644
--- a/apps/web/src/content/pages/home.mdx
+++ b/apps/web/src/content/pages/home.mdx
@@ -2,7 +2,7 @@
title: "Free & Open Source Status Page and Uptime Monitoring"
hero: "The status page that just works."
publishedAt: "2026-04-07"
-updatedAt: "2026-09-26"
+updatedAt: "2026-10-05"
author: "openstatus"
description: "Open source status page and uptime monitoring. Your monitors update it, your subscribers hear it first, your auditor gets the trail. Live in five minutes."
category: "product"
@@ -97,57 +97,83 @@ Open the failing checks. The European regions spend four seconds waiting on the
</div>
</Grid>
-<Eyebrow>09:44</Eyebrow>
+<Eyebrow>09:43</Eyebrow>
-## Declare it in Slack, or with your favorite agent
+## Declare the incident, get a channel
<Grid variant="borderless">
<div>
-Ask the openstatus agent in the incident thread. It drafts the status report, you approve it, and it goes live without anyone opening the dashboard. The same agent runs wherever you work: connect the MCP server to Claude, ChatGPT or Cursor and declare it from there.
+One slash command declares the incident with a title and a severity. Openstatus opens a dedicated Slack channel, invites you and pins the incident card, so the response has one place to happen.
+- [Incident management](/incident-management)
- [Slack agent](/docs/guides/how-to-setup-slack-agent)
-- [MCP server](/tooling/mcp-server)
-- [CLI](/tooling/cli)
-- [API](/tooling/api)
</div>
<div>
-<Demo type="slack-agent" />
+<Demo type="incident-declare" />
<SrOnly>
-An engineer asks @openstatus in the incident thread to open a status report. The agent drafts "Elevated errors on Checkout API", the engineer approves, and 1,337 subscribers are notified.
+Gilfoyle runs `/openstatus incident declare Checkout API 503s in EU --sev major` in #incidents at 09:43. The openstatus app posts an approval card, confirms the incident is declared and opens a dedicated incident channel.
</SrOnly>
</div>
</Grid>
-<Eyebrow>09:52</Eyebrow>
+<Eyebrow>09:44</Eyebrow>
-## Everyone hears it from you first
+## Tell customers from Slack, or with your favorite agent
<Grid variant="borderless">
<div>
-<Demo type="notify" />
+<Demo type="slack-agent" />
<SrOnly>
-The 09:52 Identified update as it lands in a customer's Slack Connect channel, with the delivery summary: 1,337 emails sent, RSS and Atom updated, 3 Slack Connect workspaces notified.
+An engineer asks @openstatus in the incident thread to open a status report. The agent drafts "Elevated errors on Checkout API", the engineer approves, and 1,337 subscribers are notified.
</SrOnly>
</div>
<div>
+Ask the openstatus agent in the incident thread. It drafts the status report, you approve it, and it goes live without anyone opening the dashboard. The same agent runs wherever you work: connect the MCP server to Claude, ChatGPT or Cursor and publish it from there.
+
+- [Slack agent](/docs/guides/how-to-setup-slack-agent)
+- [MCP server](/tooling/mcp-server)
+- [CLI](/tooling/cli)
+- [API](/tooling/api)
+
+</div>
+</Grid>
+
+<Eyebrow>09:52</Eyebrow>
+
+## Everyone hears it from you first
+
+<Grid variant="borderless">
+<div>
+
Subscribers get the update by email, RSS and Slack Connect the moment it is approved. Support stops answering "is it down?" because the answer is already in the inbox.
- [Subscriptions](/docs/reference/subscriber)
- [Reducing support tickets](/use-case/reduce-support-tickets)
+</div>
+<div>
+
+<Demo type="notify" />
+
+<SrOnly>
+
+The 09:52 Identified update as it lands in a customer's Slack Connect channel, with the delivery summary: 1,337 emails sent, RSS and Atom updated, 3 Slack Connect workspaces notified.
+
+</SrOnly>
+
</div>
</Grid>
@@ -158,6 +184,17 @@ Subscribers get the update by email, RSS and Slack Connect the moment it is appr
<Grid variant="borderless">
<div>
+<Demo type="access" />
+
+<SrOnly>
+
+Two pages side by side: the public status.piedpiper.dev shows Checkout API degraded, while internal.piedpiper.dev asks for a password and only admits the 203.0.113.0/24 range.
+
+</SrOnly>
+
+</div>
+<div>
+
The public page shows the Checkout API as degraded. The internal page, behind a password and the office IP range, shows the failing regions and the rollback progress.
- [Status page](/status-page)
@@ -165,19 +202,60 @@ The public page shows the Checkout API as degraded. The internal page, behind a
- [Status pages for enterprise sales](/use-case/enterprise-sales)
</div>
+</Grid>
+
+<Eyebrow>10:14</Eyebrow>
+
+## Update the status where the work happens
+
+<Grid variant="borderless">
<div>
-<Demo type="access" />
+When the rollback lands, mark the incident mitigated from its channel. The internal status and the public status report move separately, so the team says "mitigated" while customers read "monitoring".
+
+- [Incident management](/incident-management#internal-status-public-update)
+- [Status report reference](/docs/reference/status-report)
+
+</div>
+<div>
+
+<Demo type="incident-status" />
<SrOnly>
-Two pages side by side: the public status.piedpiper.dev shows Checkout API degraded, while internal.piedpiper.dev asks for a password and only admits the 203.0.113.0/24 range.
+At 10:14 Gilfoyle runs `/openstatus incident mitigate Rollback complete in eu-west-1 and eu-west-2.` in the incident channel and the app confirms the incident is now mitigated. The linked status report "Elevated errors on Checkout API" reads Monitoring, with 1,337 subscribers notified.
</SrOnly>
</div>
</Grid>
+<Eyebrow>11:02</Eyebrow>
+
+## The postmortem arrives as a draft
+
+<Grid variant="borderless">
+<div>
+
+<Demo type="postmortem" />
+
+<SrOnly>
+
+The postmortem draft, written by the agent at 11:02: summary, impact (55m, from 09:41 to 10:36 UTC, Europe only), a UTC timeline, root cause (the 09:38 edge config deploy), what went well, what went wrong and two action items, with buttons to approve it or draft again.
+
+</SrOnly>
+
+</div>
+<div>
+
+Once the incident is resolved, the agent drafts a blameless postmortem from the timeline, the public updates and the channel history. You edit it, approve it and close the incident while everyone still remembers what happened.
+
+- [Incident management](/incident-management#a-postmortem-with-a-first-draft)
+- [MCP server](/tooling/mcp-server)
+
+</div>
+</Grid>
+
<Eyebrow>+6 months</Eyebrow>
## The trail exists when the auditor asks
@@ -193,7 +271,7 @@ Every step is logged: who declared it, from where, when each update shipped. Whe
<SrOnly>
-The incident's audit log, newest first: monitor.alert at 09:41:12, status_report.create at 09:44:30 by [email protected] via Slack, notification.send a second later, then the identified, monitoring and resolved updates. It exports as CSV or JSON.
+The incident's audit log, with the newest entry at the top. From oldest to newest: monitor.alert at 09:41:12, incident.create at 09:43:08 and status_report.create at 09:44:30 by [email protected] via Slack, notification.send a second later, then the identified, monitoring and resolved updates, the incident mitigated and resolved, and the postmortem approved at 11:20:48. It exports as CSV or JSON.
</SrOnly>
diff --git a/apps/web/src/content/pages/product/incident-management.mdx b/apps/web/src/content/pages/product/incident-management.mdx
new file mode 100644
index 000000000..54e1d0317
--- /dev/null
+++ b/apps/web/src/content/pages/product/incident-management.mdx
@@ -0,0 +1,268 @@
+---
+title: "Incident Management"
+seo:
+ title: "Incident Management — Slack Channels, Timeline, Postmortems"
+ description: "Open source incident management next to your monitors and status page. Declare from Slack, get a channel per incident, keep a timeline and draft the postmortem."
+hero: "Incident management for small teams"
+publishedAt: "2026-10-05"
+updatedAt: "2026-10-05"
+author: "Maximilian Kaske"
+description: "Declare an incident from Slack or the dashboard, run it in its own channel, keep one timeline and leave with a postmortem. Next to the monitors and the status page it belongs to."
+category: "Product"
+faq:
+ - question: "What is incident management?"
+ answer: "Incident management is how a team responds when something breaks: someone declares the incident, one person takes command, the team works the problem in one place, customers are kept informed, and afterwards a postmortem records what happened and what changes. Openstatus keeps the declaration, the timeline, the public status report and the postmortem in one record."
+ - question: "What is the difference between an incident and a status report?"
+ answer: "An incident is internal: severity, commander, timeline notes and the postmortem are for your team. A status report is public: it is what customers read on your status page and receive as a subscriber. You link the two, and each keeps its own status, so the team can mark an incident mitigated while the status report still says monitoring."
+ - question: "Do I need Slack to manage incidents?"
+ answer: "No. You can declare, update, resolve and write the postmortem from the dashboard. Connecting Slack adds the channel per incident, slash commands, pinning messages to the timeline, stale-incident reminders and agent drafting."
+ - question: "How does the postmortem draft work?"
+ answer: "Once an incident is resolved, the agent drafts a blameless postmortem from the incident's fields, its timeline, the public status report updates and the history of the incident's Slack channel. The draft has seven sections: summary, impact, timeline, root cause, what went well, what went wrong and action items. Where it has no facts it says what is unknown. You edit the draft, approve it and close the incident."
+ - question: "Which severities and statuses are there?"
+ answer: "Three severities: critical for a major outage or data loss, major for significant degradation, and minor for limited impact. An incident is open, mitigated, resolved or canceled. Closing an incident freezes it: status, severity, commander and notes can no longer change."
+ - question: "Can an AI agent run an incident?"
+ answer: "Yes. The MCP server and the Slack agent share the same incident tools: declare, update, change status, add a note, draft and approve the postmortem. Every action that changes something asks for approval first and is written to the audit log with the person behind it."
+---
+
+<Actions source="incident-management-hero">
+ <ButtonLink href="https://app.openstatus.dev" variant="default">Declare your first incident</ButtonLink>
+ <ButtonLink href="/docs/guides/how-to-setup-slack-agent" variant="ghost">Set up the Slack agent</ButtonLink>
+</Actions>
+
+<p>
+<Subtle>Free to start, with a 14-day Starter trial and no card needed. Paid plans from $30/mo.</Subtle>
+</p>
+
+<Demo type="incident" />
+
+<SrOnly>
+
+The incident page for "Checkout API 503s in EU" at the fictional Pied Piper: severity Major, status Resolved, commander Gilfoyle, duration 55m, and a timeline from Declared at 09:43 through a note pinned in Slack, the linked status report, Mitigated at 10:14 and Resolved at 10:36 to the approved postmortem at 11:20.
+
+</SrOnly>
+
+## Trusted by teams who ship transparency
+
+<LogoCloud />
+
+## Why run incidents here
+
+<Grid cols={3}>
+<div>
+
+**It starts where the alert lands**
+
+The monitor that caught the failure, the incident and the status page live in one workspace. Nothing is copied between tools while the Checkout API is down.
+
+</div>
+<div>
+
+**Internal and public stay apart**
+
+The team works with severities, notes and a commander. Customers read a [status report](/status-page) in your words. The two are linked, never mixed.
+
+</div>
+<div>
+
+**The record writes itself**
+
+Every status change, note and public update is timestamped as it happens. The postmortem and the [audit trail](/use-case/compliance) are built from it, not from memory.
+
+</div>
+</Grid>
+
+## Declare from Slack or the dashboard
+
+<Grid variant="borderless">
+<div>
+
+Run `/openstatus incident declare` with a title and a severity, approve the card, and the incident exists. The dashboard has the same form, with a commander, a start time you can set in the past and an open status report to link.
+
+- [Set up the Slack agent](/docs/guides/how-to-setup-slack-agent)
+- [Status report reference](/docs/reference/status-report)
+
+</div>
+<div>
+
+<Demo type="incident-declare" />
+
+<SrOnly>
+
+Gilfoyle runs `/openstatus incident declare Checkout API 503s in EU --sev major` in #incidents at 09:43. The openstatus app posts an approval card with the title and severity, then confirms the incident is declared and that a dedicated channel was opened with Gilfoyle invited.
+
+</SrOnly>
+
+</div>
+</Grid>
+
+## A Slack channel per incident
+
+<Grid variant="borderless">
+<div>
+
+<Demo type="incident-channel" />
+
+<SrOnly>
+
+The incident's own Slack channel, named inc-, the date and checkout-api-503s-in-eu. The pinned card shows severity Major and status Open. Gilfoyle's 09:49 message, "Edge config deploy at 09:38 changed EU routing. Rolling back.", carries a pin reaction and a check mark from the app: it is now a note on the timeline. A reminder follows after 4 hours without an update.
+
+</SrOnly>
+
+</div>
+<div>
+
+Every incident gets a channel with the severity and status in its topic and the incident card pinned on top. React to any message with 📌 and it becomes a timeline note, with a link back to Slack.
+
+If the incident goes quiet, the channel gets a reminder: after one hour for critical, four for major and a day for minor.
+
+- [Slack agent](/docs/guides/how-to-setup-slack-agent)
+- [Notification channels](/docs/reference/notification)
+
+</div>
+</Grid>
+
+## From the monitor that caught it
+
+<Grid variant="borderless">
+<div>
+
+When a monitor goes down, declare the incident from its downtime row and the start time is already filled in. The duration counts from when the impact began, not from when someone got around to declaring it.
+
+- [Uptime monitoring](/uptime-monitoring)
+- [Response logs and retention](/docs/concept/response-logs-and-retention)
+
+</div>
+<div>
+
+<Demo type="alert" />
+
+<SrOnly>
+
+The Slack alert that started it at 09:41: Checkout API returned 503 from lhr, ams, cdg and koyeb_fra at 4,388 ms, with 4 of 6 regions failing the status-code assertion.
+
+</SrOnly>
+
+</div>
+</Grid>
+
+## Internal status, public update
+
+<Grid variant="borderless">
+<div>
+
+<Demo type="incident-status" />
+
+<SrOnly>
+
+At 10:14 Gilfoyle runs `/openstatus incident mitigate Rollback complete in eu-west-1 and eu-west-2.` in the incident channel and the app confirms the incident is now mitigated. Below it, the linked status report "Elevated errors on Checkout API" reads Monitoring, with its own public message and 1,337 subscribers notified.
+
+</SrOnly>
+
+</div>
+<div>
+
+Mitigate, resolve, cancel or reopen from the channel or the dashboard, with a note that lands on the timeline. The linked status report keeps its own status and wording, and you post the public update from the same page.
+
+- [Status page](/status-page)
+- [Subscriptions](/docs/reference/subscriber)
+
+</div>
+</Grid>
+
+## A postmortem with a first draft
+
+<Grid variant="borderless">
+<div>
+
+Once the incident is resolved, the agent drafts a blameless postmortem from the timeline, the public updates and the channel history. Where it has no facts it says so instead of guessing.
+
+Edit it in markdown, approve it, and close the incident.
+
+- [Slack agent](/docs/guides/how-to-setup-slack-agent)
+- [Status pages for compliance](/use-case/compliance)
+
+</div>
+<div>
+
+<Demo type="postmortem" />
+
+<SrOnly>
+
+The postmortem draft, written by the agent, in seven sections: summary, impact (55m, from 09:41 to 10:36 UTC, Europe only), a UTC timeline from Declared to Resolved, root cause (the 09:38 edge config deploy), what went well, what went wrong, and two action items as a checklist. Buttons to approve it or draft again with the agent.
+
+</SrOnly>
+
+</div>
+</Grid>
+
+## For agents, with a paper trail
+
+<Grid variant="borderless">
+<div>
+
+<Demo type="audit" />
+
+<SrOnly>
+
+The audit log for the same incident, with the newest entry at the top. From oldest to newest: monitor.alert at 09:41:12, incident.create at 09:43:08 by [email protected] via Slack, the status report and its updates, incident.update to mitigated and resolved, and the postmortem created by the agent and approved at 11:20:48.
+
+</SrOnly>
+
+</div>
+<div>
+
+The MCP server and the Slack agent share the incident tools: declare, update, change status, add a note, draft the postmortem. Anything that changes state asks for approval first.
+
+Every one of those steps is in the audit log with the person behind it, whichever surface they used.
+
+- [MCP server](/tooling/mcp-server)
+- [Connect openstatus to your agent](/docs/guides/how-to-connect-openstatus-to-your-agent)
+
+</div>
+</Grid>
+
+## Get started
+
+<Actions source="incident-management-bottom">
+ <ButtonLink href="https://app.openstatus.dev" variant="default">Declare your first incident</ButtonLink>
+</Actions>
+
+<Subtle>Free to start, with a 14-day Starter trial and no card needed. Paid plans from $30/mo.</Subtle>
+
+## Frequently asked questions
+
+<Details summary="What is incident management?" headingLevel={3}>
+
+Incident management is how a team responds when something breaks: someone declares the incident, one person takes command, the team works the problem in one place, customers are kept informed, and afterwards a postmortem records what happened and what changes. Openstatus keeps the declaration, the timeline, the public status report and the postmortem in one record.
+
+</Details>
+
+<Details summary="What is the difference between an incident and a status report?" headingLevel={3}>
+
+An incident is internal: severity, commander, timeline notes and the postmortem are for your team. A status report is public: it is what customers read on your status page and receive as a subscriber. You link the two, and each keeps its own status, so the team can mark an incident mitigated while the status report still says monitoring.
+
+</Details>
+
+<Details summary="Do I need Slack to manage incidents?" headingLevel={3}>
+
+No. You can declare, update, resolve and write the postmortem from the dashboard. Connecting Slack adds the channel per incident, slash commands, pinning messages to the timeline, stale-incident reminders and agent drafting.
+
+</Details>
+
+<Details summary="How does the postmortem draft work?" headingLevel={3}>
+
+Once an incident is resolved, the agent drafts a blameless postmortem from the incident's fields, its timeline, the public status report updates and the history of the incident's Slack channel. The draft has seven sections: summary, impact, timeline, root cause, what went well, what went wrong and action items. Where it has no facts it says what is unknown. You edit the draft, approve it and close the incident.
+
+</Details>
+
+<Details summary="Which severities and statuses are there?" headingLevel={3}>
+
+Three severities: critical for a major outage or data loss, major for significant degradation, and minor for limited impact. An incident is open, mitigated, resolved or canceled. Closing an incident freezes it: status, severity, commander and notes can no longer change.
+
+</Details>
+
+<Details summary="Can an AI agent run an incident?" headingLevel={3}>
+
+Yes. The MCP server and the Slack agent share the same incident tools: declare, update, change status, add a note, draft and approve the postmortem. Every action that changes something asks for approval first and is written to the audit log with the person behind it.
+
+</Details>
diff --git a/apps/web/src/content/pages/product/tooling/mcp-server.mdx b/apps/web/src/content/pages/product/tooling/mcp-server.mdx
index 618e1cf89..69c74003d 100644
--- a/apps/web/src/content/pages/product/tooling/mcp-server.mdx
+++ b/apps/web/src/content/pages/product/tooling/mcp-server.mdx
@@ -5,13 +5,13 @@ seo:
title: "openstatus MCP Server for Claude, ChatGPT and Cursor"
description: "Connect Claude, ChatGPT, Cursor or any MCP client to your openstatus workspace. OAuth sign-in, audit-logged changes, explicit control over notifications."
publishedAt: "2026-04-29"
-updatedAt: "2026-09-27"
+updatedAt: "2026-10-05"
author: "Maximilian Kaske"
description: "Connect Claude, ChatGPT, Cursor, and any other Model Context Protocol client to your workspace — sign in with OAuth, pick a workspace, and get audit-logged mutations with explicit notify semantics."
category: "Product"
faq:
- question: "What does the MCP server let an assistant do?"
- answer: "The MCP server exposes 19 read and write tools scoped to your workspace: list status pages, monitors, response logs, notifications, private locations, and audit logs; inspect a single monitor or response log; create, update, and resolve status reports; schedule maintenance windows. Every mutation writes to the audit log, and publishing tools require an explicit notify decision."
+ answer: "The MCP server exposes 19 read and write tools scoped to your workspace: list status pages, monitors, response logs, notifications, private locations, and audit logs; inspect a single monitor or response log; create, update, and resolve status reports; schedule maintenance windows. Workspaces with incident management enabled get 10 more to declare incidents, change their status, add timeline notes, and draft and approve the postmortem. Every mutation writes to the audit log, and publishing tools require an explicit notify decision."
- question: "Are skills different from the MCP server?"
answer: "Skills are prompt and command bundles installed into your local agent (Claude Code, etc.) that wrap the openstatus CLI. The MCP server is a remote endpoint that any MCP-compatible client can connect to. Skills are great for terminal-shaped workflows; MCP is great for chat-shaped workflows."
- question: "Do I need an API key to connect an MCP client?"
@@ -37,6 +37,7 @@ The server exposes **23 tools**, grouped by entity:
- **Status pages** — `list_status_pages` · `list_page_components`
- **Status reports** — `list_status_reports` · `create_status_report` · `add_status_report_update` · `update_status_report` · `resolve_status_report`
- **Maintenance** — `list_maintenances` · `create_maintenance`
+- **Incidents** *(10 more, on workspaces with [incident management](/incident-management) enabled)* — `list_incidents` · `get_incident` · `declare_incident` · `update_incident` · `set_incident_status` · `resolve_incident` · `add_incident_note` · `get_postmortem` · `draft_postmortem` · `approve_postmortem`
- **Monitors** — `list_monitors` · `get_monitor` · `get_monitor_status` · `get_monitor_summary`
- **Response logs** — `list_response_logs` · `get_response_log`
- **Notifications** — `list_notifications`
@@ -79,7 +80,7 @@ Full tool schema, error codes, and per-client config in the [MCP reference](/doc
<Details summary="What does the MCP server let an assistant do?" headingLevel={3}>
-The MCP server exposes 19 read and write tools scoped to your workspace: list status pages, monitors, response logs, notifications, private locations, and audit logs; inspect a single monitor or response log; create, update, and resolve status reports; schedule maintenance windows. Every mutation writes to the audit log, and publishing tools require an explicit notify decision.
+The MCP server exposes 19 read and write tools scoped to your workspace: list status pages, monitors, response logs, notifications, private locations, and audit logs; inspect a single monitor or response log; create, update, and resolve status reports; schedule maintenance windows. Workspaces with incident management enabled get 10 more to declare incidents, change their status, add timeline notes, and draft and approve the postmortem. Every mutation writes to the audit log, and publishing tools require an explicit notify decision.
</Details>
diff --git a/apps/web/src/content/pages/unrelated/kitchen-sink.mdx b/apps/web/src/content/pages/unrelated/kitchen-sink.mdx
index 263877da8..03d0a9f41 100644
--- a/apps/web/src/content/pages/unrelated/kitchen-sink.mdx
+++ b/apps/web/src/content/pages/unrelated/kitchen-sink.mdx
@@ -170,6 +170,41 @@ A demo renders nothing in the markdown representation. The `SrOnly` block next t
<Demo type="logs" />
+</div>
+<div>
+
+**incident**
+
+<Demo type="incident" />
+
+</div>
+<div>
+
+**incident-declare**
+
+<Demo type="incident-declare" />
+
+</div>
+<div>
+
+**incident-channel**
+
+<Demo type="incident-channel" />
+
+</div>
+<div>
+
+**incident-status**
+
+<Demo type="incident-status" />
+
+</div>
+<div>
+
+**postmortem**
+
+<Demo type="postmortem" />
+
</div>
</Grid>
diff --git a/apps/web/src/data/demo-data.ts b/apps/web/src/data/demo-data.ts
index 8f14af3d0..b368e968b 100644
--- a/apps/web/src/data/demo-data.ts
+++ b/apps/web/src/data/demo-data.ts
@@ -153,6 +153,32 @@ export const demo = {
message: string;
}[],
},
+ // The internal incident behind the public report: the team's side of the story.
+ response: {
+ id: 42,
+ title: "Checkout API 503s in EU",
+ channelSlug: "checkout-api-503s-in-eu",
+ severity: "major",
+ commander: company.oncall.name,
+ note: "Edge config deploy at 09:38 changed EU routing. Rolling back.",
+ mitigation: "Rollback complete in eu-west-1 and eu-west-2.",
+ // Hours without an update before a major incident gets a reminder.
+ staleAfterHours: 4,
+ postmortem: {
+ summary:
+ "A configuration change in the European edge made the Checkout API return 503 for requests routed through Europe.",
+ rootCause:
+ "The 09:38 edge config deploy changed EU routing and was not validated against a European region before rollout.",
+ wentWell:
+ "The monitor alerted within a minute and the first public update went out three minutes later.",
+ wentWrong:
+ "The deploy had no canary, so every European region failed at once.",
+ actionItems: [
+ "Canary edge config changes in one EU region first",
+ "Add a pre-deploy check from lhr and koyeb_fra",
+ ],
+ },
+ },
maintenance: {
title: "Database upgrade",
affected: ["Checkout API", "Webhooks"],
@@ -202,12 +228,36 @@ export const demo = {
],
subscribers,
audit: [
+ {
+ time: "11:20:48",
+ action: "incident_postmortem.update",
+ detail: "→ approved",
+ actor,
+ },
+ {
+ time: "11:02:14",
+ action: "incident_postmortem.create",
+ detail: "draft · agent",
+ actor,
+ },
+ {
+ time: "10:36:20",
+ action: "incident.update",
+ detail: "→ resolved",
+ actor,
+ },
{
time: "10:36:00",
action: "status_report.update",
detail: "→ resolved",
actor,
},
+ {
+ time: "10:14:25",
+ action: "incident.update",
+ detail: "→ mitigated",
+ actor,
+ },
{
time: "10:14:03",
action: "status_report.update",
@@ -226,6 +276,12 @@ export const demo = {
detail: "→ identified",
actor,
},
+ {
+ time: "09:49:17",
+ action: "incident_event.create",
+ detail: "note · pinned in slack",
+ actor,
+ },
{
time: "09:44:31",
action: "notification.send",
@@ -238,6 +294,12 @@ export const demo = {
detail: "investigating · Checkout API",
actor,
},
+ {
+ time: "09:43:08",
+ action: "incident.create",
+ detail: "major · Checkout API 503s in EU",
+ actor,
+ },
{
time: "09:41:12",
action: "monitor.alert",
@@ -361,6 +423,67 @@ export function hhmm(time: string) {
return time.slice(0, 5);
}
+/** Whole minutes between two `HH:MM:SS` audit times on the same day. */
+export function minutesBetween(from: string, to: string) {
+ const day = new Date(0);
+ return Math.floor(
+ (atTime(day, to).getTime() - atTime(day, from).getTime()) / 60_000,
+ );
+}
+
+/** `#inc-<date>-<slug>`, the name openstatus gives the incident's Slack channel. */
+export function getResponseChannel(now = new Date()) {
+ const date = getIncidentDay(now).toISOString().slice(0, 10);
+ return `#inc-${date}-${demo.response.channelSlug}`;
+}
+
+/** The internal incident's timeline, newest first, as the dashboard lists it. */
+export function getResponseEvents() {
+ const { response, incident } = demo;
+ const by = company.oncall.name;
+ return [
+ {
+ label: "Postmortem approved",
+ time: auditRow("incident_postmortem.update", "→ approved").time,
+ by,
+ },
+ {
+ label: "Postmortem drafted",
+ time: auditRow("incident_postmortem.create").time,
+ by: "Agent",
+ },
+ {
+ label: "Resolved",
+ time: auditRow("incident.update", "→ resolved").time,
+ by,
+ },
+ {
+ label: "Mitigated",
+ time: auditRow("incident.update", "→ mitigated").time,
+ by,
+ message: response.mitigation,
+ },
+ {
+ label: "Note",
+ time: auditRow("incident_event.create").time,
+ by: `${by} · via Slack`,
+ message: response.note,
+ },
+ {
+ label: "Status report linked",
+ time: auditRow("status_report.create").time,
+ by,
+ message: incident.title,
+ },
+ {
+ label: "Declared",
+ time: auditRow("incident.create").time,
+ by,
+ message: `${capitalize(response.severity)} · ${response.title}`,
+ },
+ ];
+}
+
const DAYS = 45;
/** Anchor the incident on the most recent day where its whole timeline is in the past. */
diff --git a/packages/icons/src/lucide/index.ts b/packages/icons/src/lucide/index.ts
index 590470b96..d2a0008c3 100644
--- a/packages/icons/src/lucide/index.ts
+++ b/packages/icons/src/lucide/index.ts
@@ -28,6 +28,7 @@ export {
ChevronUp,
Clock,
X as Close,
+ CloudOff,
Code,
ChevronsDownUp as Collapse,
Command,
diff --git a/packages/icons/src/nucleo/cloud-off.tsx b/packages/icons/src/nucleo/cloud-off.tsx
new file mode 100644
index 000000000..b4ab2183a
--- /dev/null
+++ b/packages/icons/src/nucleo/cloud-off.tsx
@@ -0,0 +1,45 @@
+import { forwardRef } from "react";
+
+import type { IconProps } from "../types";
+
+// from nucleo-ui-outline-18 (CloudSlash); 18px grid, so the 1.5 stroke renders as 2px at size 24
+export const CloudOff = forwardRef<SVGSVGElement, IconProps>(
+ ({ size = 24, strokeWidth = 1.5, ...props }, ref) => (
+ <svg
+ ref={ref}
+ xmlns="http://www.w3.org/2000/svg"
+ width={size}
+ height={size}
+ viewBox="0 0 18 18"
+ style={{ flexShrink: 0 }}
+ {...props}
+ >
+ <path
+ d="M12.922 5.078C12.161 3.691 10.696 2.75 9 2.75C6.515 2.75 4.5 4.765 4.5 7.25C4.5 7.6 4.54899 7.936 4.62399 8.263C3.02699 8.33 1.75 9.637 1.75 11.25C1.75 12.604 2.647 13.748 3.879 14.121"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={strokeWidth}
+ ></path>
+ <path
+ d="M2 16L16 2"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={strokeWidth}
+ data-color="color-2"
+ ></path>
+ <path
+ d="M7.99219 14.25H12.5C14.571 14.25 16.25 12.571 16.25 10.5C16.25 9.26881 15.6525 8.18681 14.7351 7.50711"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={strokeWidth}
+ ></path>
+ </svg>
+ ),
+);
+CloudOff.displayName = "CloudOff";
diff --git a/packages/icons/src/nucleo/index.ts b/packages/icons/src/nucleo/index.ts
index 992960f43..6e8dd660a 100644
--- a/packages/icons/src/nucleo/index.ts
+++ b/packages/icons/src/nucleo/index.ts
@@ -27,6 +27,7 @@ export { ChevronRight } from "./chevron-right";
export { ChevronUp } from "./chevron-up";
export { Clock } from "./clock";
export { Close } from "./close";
+export { CloudOff } from "./cloud-off";
export { Code } from "./code";
export { Collapse } from "./collapse";
export { Command } from "./command";
diff --git a/packages/services/package.json b/packages/services/package.json
index db5cd30a1..acbc1917b 100644
--- a/packages/services/package.json
+++ b/packages/services/package.json
@@ -160,7 +160,7 @@
},
"scripts": {
"check": "deno check --sloppy-imports .",
- "test": "NODE_ENV=test RESEND_API_KEY=test-key OPENSTATUS_FEATURES=incident-management deno test --parallel -A --no-check --sloppy-imports",
+ "test": "NODE_ENV=test RESEND_API_KEY=test-key deno test --parallel -A --no-check --sloppy-imports",
"tsc": "tsc --noEmit"
},
"dependencies": {
diff --git a/packages/services/src/__tests__/features.test.ts b/packages/services/src/__tests__/features.test.ts
index 8b06f2612..334971a8c 100644
--- a/packages/services/src/__tests__/features.test.ts
+++ b/packages/services/src/__tests__/features.test.ts
@@ -2,36 +2,27 @@ import { expect } from "@std/expect";
import { describe, test } from "@std/testing/bdd";
import { ForbiddenError } from "../errors";
-import { isFeatureEnabled, requireFeature } from "../features";
+import { type Feature, isFeatureEnabled, requireFeature } from "../features";
import type { Workspace } from "../types";
const none = new Set<string>();
+// No feature is registered right now; cast a placeholder to exercise the logic.
+const feature = "test-feature" as Feature;
describe("isFeatureEnabled", () => {
- test("allowlisted workspace", () => {
- expect(isFeatureEnabled({ id: 1 }, "incident-management", none)).toBe(true);
- });
-
- test("other workspace", () => {
- expect(
- isFeatureEnabled({ id: 987654321 }, "incident-management", none),
- ).toBe(false);
+ test("workspace off the allowlist", () => {
+ expect(isFeatureEnabled({ id: 987654321 }, feature, none)).toBe(false);
});
test("env override enables it for every workspace", () => {
expect(
- isFeatureEnabled(
- { id: 987654321 },
- "incident-management",
- new Set(["incident-management"]),
- ),
+ isFeatureEnabled({ id: 987654321 }, feature, new Set([feature])),
).toBe(true);
});
});
describe("requireFeature", () => {
test("throws ForbiddenError when disabled", () => {
- // The package test script enables the feature globally; clear it here.
const processEnv: Record<string, string | undefined> = process.env;
const saved = processEnv.OPENSTATUS_FEATURES;
delete processEnv.OPENSTATUS_FEATURES;
@@ -40,7 +31,7 @@ describe("requireFeature", () => {
expect(() =>
requireFeature(
{ workspace, actor: { type: "system", job: "test" } },
- "incident-management",
+ feature,
),
).toThrow(ForbiddenError);
} finally {
diff --git a/packages/services/src/agent-tools/__tests__/incident.test.ts b/packages/services/src/agent-tools/__tests__/incident.test.ts
index 95db28d06..2e0506b6c 100644
--- a/packages/services/src/agent-tools/__tests__/incident.test.ts
+++ b/packages/services/src/agent-tools/__tests__/incident.test.ts
@@ -9,10 +9,8 @@ import {
import type { Workspace } from "../../types";
import {
addIncidentNoteTool,
- agentTools,
declareIncidentTool,
getIncidentTool,
- isAgentToolAvailable,
listIncidentsTool,
resolveIncidentTool,
updateIncidentTool,
@@ -73,13 +71,4 @@ describe("incident agent tools", () => {
expect(getIncidentTool.outputSchema.parse(detail)).toBeDefined();
});
});
-
- test("every incident tool is feature-gated, the rest are not", () => {
- for (const tool of Object.values(agentTools)) {
- const isIncident =
- tool.name.includes("incident") || tool.name.includes("postmortem");
- expect(tool.feature === "incident-management").toBe(isIncident);
- }
- expect(isAgentToolAvailable(listIncidentsTool, { id: 1 })).toBe(true);
- });
});
diff --git a/packages/services/src/agent-tools/incident.ts b/packages/services/src/agent-tools/incident.ts
index 0370361ee..1f7c144b6 100644
--- a/packages/services/src/agent-tools/incident.ts
+++ b/packages/services/src/agent-tools/incident.ts
@@ -21,8 +21,6 @@ import {
} from "../incident";
import type { AgentTool, SummaryLine } from "./types";
-const FEATURE = "incident-management";
-
const title = z.string().trim().min(1).max(256);
const summary = z.string().trim().min(1).max(4000);
const note = z.string().trim().min(1).max(10_000);
@@ -59,7 +57,6 @@ export const listIncidentsTool: AgentTool<
"List managed incidents in this workspace (declared by the team, not monitor downtime), open ones first.",
scope: "read",
destructive: false,
- feature: FEATURE,
inputSchema: ListIncidentsInput,
outputSchema: ListIncidentsOutput,
async run({ ctx, input }) {
@@ -113,7 +110,6 @@ export const getIncidentTool: AgentTool<
"Get one managed incident with its timeline (newest first, up to 50 events) and linked status report.",
scope: "read",
destructive: false,
- feature: FEATURE,
inputSchema: GetIncidentInput,
outputSchema: GetIncidentOutput,
async run({ ctx, input }) {
@@ -209,7 +205,6 @@ export const declareIncidentTool: AgentTool<
"Declare a managed incident: the team's internal record of an outage, with a timeline and a commander. Internal only — nothing is published; use create_status_report for public communication.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: DeclareIncidentInput,
outputSchema: IncidentWriteOutput,
approval: {
@@ -272,7 +267,6 @@ export const updateIncidentTool: AgentTool<
"Change a managed incident's title, severity, summary, commander or start time. Internal only.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: UpdateIncidentInput,
outputSchema: IncidentWriteOutput,
approval: {
@@ -325,7 +319,6 @@ export const resolveIncidentTool: AgentTool<
"Mark a managed incident resolved. Does not touch its status report: resolve that separately with resolve_status_report if it is still open.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: ResolveIncidentInput,
outputSchema: IncidentWriteOutput,
approval: {
@@ -367,7 +360,6 @@ export const setIncidentStatusTool: AgentTool<
"Move a managed incident to mitigated, resolved, canceled (false alarm) or back to open. Canceling closes it for good. Does not touch its status report.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: SetIncidentStatusInput,
outputSchema: IncidentWriteOutput,
approval: {
@@ -409,7 +401,6 @@ export const addIncidentNoteTool: AgentTool<
"Append a note to a managed incident's timeline. Internal and append-only.",
scope: "write",
destructive: false,
- feature: FEATURE,
inputSchema: AddIncidentNoteInput,
outputSchema: AddIncidentNoteOutput,
async run({ ctx, input }) {
@@ -439,7 +430,6 @@ export const getPostmortemTool: AgentTool<
"Read a managed incident's postmortem (markdown), if one was drafted.",
scope: "read",
destructive: false,
- feature: FEATURE,
inputSchema: PostmortemInput,
outputSchema: GetPostmortemOutput,
async run({ ctx, input }) {
@@ -478,7 +468,6 @@ export const draftPostmortemTool: AgentTool<
"Save a postmortem draft for a resolved managed incident. Build it from get_incident (timeline, linked status report) and the conversation; never invent facts. Replaces an existing draft; an approved postmortem can't be redrafted.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: DraftPostmortemToolInput,
outputSchema: DraftPostmortemOutput,
approval: {
@@ -527,7 +516,6 @@ export const approvePostmortemTool: AgentTool<
"Approve a managed incident's postmortem draft and, by default, close the incident. Only an admin, owner or the incident's commander can approve.",
scope: "write",
destructive: true,
- feature: FEATURE,
inputSchema: ApprovePostmortemToolInput,
outputSchema: ApprovePostmortemOutput,
approval: {
diff --git a/packages/services/src/agent-tools/prompt.ts b/packages/services/src/agent-tools/prompt.ts
index bdcbb018e..025dd0d1b 100644
--- a/packages/services/src/agent-tools/prompt.ts
+++ b/packages/services/src/agent-tools/prompt.ts
@@ -16,8 +16,6 @@ export type AgentSystemPromptOptions = {
* false the model passes `notify: false` and skips the yes/no prompt.
*/
canNotifySubscribers: boolean;
- /** Whether managed-incident tools are offered in this workspace. */
- incidentManagement?: boolean;
};
export function buildAgentSystemPrompt(opts: AgentSystemPromptOptions): string {
@@ -41,8 +39,7 @@ Exception: after get_doc_page or get_content_page, DO synthesize an answer from
const preamble = opts.preamble ? `${opts.preamble}\n\n` : "";
- const incidentSection = opts.incidentManagement
- ? `
+ const incidentSection = `
Managed incidents (internal):
- Three different things are called "incident". A managed incident (list_incidents, get_incident, declare_incident, update_incident, resolve_incident, set_incident_status, add_incident_note) is the team's INTERNAL record: severity, commander, timeline. A status report is PUBLIC communication on a status page. Monitor downtime (activeIncidentCount on monitors) is detected automatically.
@@ -52,8 +49,7 @@ Managed incidents (internal):
- "the incident is fixed/resolved" with a managed incident in play → resolve_incident; if its linked status report is still open, ask whether to resolve that too (resolve_status_report).
- "mitigated", "the bleeding stopped" → set_incident_status mitigated; "false alarm", "declared by mistake" → set_incident_status canceled (this closes it).
- Postmortems: get_postmortem reads it; draft_postmortem saves a draft you wrote from get_incident and the conversation (resolved incidents only, never invent facts); approve_postmortem signs it off and by default closes the incident.
-- severity: critical = major outage or data loss, major = significant degradation, minor = limited impact. Ask when unclear.`
- : "";
+- severity: critical = major outage or data loss, major = significant degradation, minor = limited impact. Ask when unclear.`;
// Workspaces without subscriber notify get a different rubric — asking
// is wasted friction when the field is a server-side no-op anyway.
@@ -118,7 +114,7 @@ Component impact:
- Recovery counts as a change: when a component is back to normal before the incident is resolved ("API is back up"), set it to operational in that update.
- resolve_status_report clears every remaining impact back to operational automatically — never publish a manual "everything operational" update for that.
-Draft → Ask → Confirm rubric (MANDATORY for every write tool${opts.incidentManagement ? " except add_incident_note, which logs immediately" : ""}):
+Draft → Ask → Confirm rubric (MANDATORY for every write tool except add_incident_note, which logs immediately):
1. Draft the proposed change (title, status, message, time window, affected components and their impact levels).
2. Show the draft to the user before calling the tool.
${notifyStep}
diff --git a/packages/services/src/features.ts b/packages/services/src/features.ts
index faedc1ac2..facd68f66 100644
--- a/packages/services/src/features.ts
+++ b/packages/services/src/features.ts
@@ -2,9 +2,7 @@ import type { ServiceContext } from "./context";
import { ForbiddenError } from "./errors";
import type { Workspace } from "./types";
-const featureWorkspaces = {
- "incident-management": [1, 6850],
-} satisfies Record<string, ReadonlyArray<number>>;
+const featureWorkspaces = {} satisfies Record<string, ReadonlyArray<number>>;
export type Feature = keyof typeof featureWorkspaces;
@@ -28,8 +26,12 @@ export function isFeatureEnabled(
feature: Feature,
envFeatures: Set<string> = featuresFromEnv(),
): boolean {
- const ids: ReadonlyArray<number> = featureWorkspaces[feature];
- return ids.includes(workspace.id) || envFeatures.has(feature);
+ // widened so an empty registry (`Feature` = never) still typechecks
+ const allowlist: Record<string, ReadonlyArray<number>> = featureWorkspaces;
+ return (
+ (allowlist[feature]?.includes(workspace.id) ?? false) ||
+ envFeatures.has(feature)
+ );
}
export function enabledFeatures(workspace: Pick<Workspace, "id">): Feature[] {
diff --git a/packages/services/src/incident/add-note.ts b/packages/services/src/incident/add-note.ts
index cec546940..c362bd31b 100644
--- a/packages/services/src/incident/add-note.ts
+++ b/packages/services/src/incident/add-note.ts
@@ -7,7 +7,6 @@ import {
assertMember,
assertNotClosed,
getIncidentInWorkspace,
- requireIncidentFeature,
} from "./internal";
import { AddIncidentNoteInput } from "./schemas";
@@ -19,7 +18,6 @@ export async function addIncidentNote(args: {
}): Promise<IncidentEvent> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = AddIncidentNoteInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/close.ts b/packages/services/src/incident/close.ts
index c943302e1..9842492e2 100644
--- a/packages/services/src/incident/close.ts
+++ b/packages/services/src/incident/close.ts
@@ -14,7 +14,6 @@ import {
appendIncidentEvent,
assertNotClosed,
getIncidentInWorkspace,
- requireIncidentFeature,
} from "./internal";
import { CloseIncidentInput } from "./schemas";
@@ -73,7 +72,6 @@ export async function closeIncident(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = CloseIncidentInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/declare.ts b/packages/services/src/incident/declare.ts
index 52770e9f0..9cd9a0953 100644
--- a/packages/services/src/incident/declare.ts
+++ b/packages/services/src/incident/declare.ts
@@ -15,11 +15,7 @@ import {
withTransaction,
} from "../context";
import { NotFoundError } from "../errors";
-import {
- appendIncidentEvent,
- assertMember,
- requireIncidentFeature,
-} from "./internal";
+import { appendIncidentEvent, assertMember } from "./internal";
import { assertStatusReportLinkable } from "./link-status-report";
import { DeclareIncidentInput } from "./schemas";
@@ -63,7 +59,6 @@ export async function declareIncident(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = DeclareIncidentInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/delete.ts b/packages/services/src/incident/delete.ts
index 830f9c714..bf6af9682 100644
--- a/packages/services/src/incident/delete.ts
+++ b/packages/services/src/incident/delete.ts
@@ -6,7 +6,7 @@ import { requireScope } from "../auth";
import { requireRole } from "../auth/require-role";
import { type ServiceContext, withTransaction } from "../context";
import { ConflictError } from "../errors";
-import { getIncidentInWorkspace, requireIncidentFeature } from "./internal";
+import { getIncidentInWorkspace } from "./internal";
import { IncidentIdInput } from "./schemas";
/**
@@ -20,7 +20,6 @@ export async function deleteIncident(args: {
}): Promise<void> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = IncidentIdInput.parse(args.input);
await withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/internal.ts b/packages/services/src/incident/internal.ts
index 294f53c24..f3519e7a6 100644
--- a/packages/services/src/incident/internal.ts
+++ b/packages/services/src/incident/internal.ts
@@ -13,15 +13,8 @@ import { displayName } from "../attribution";
import { emitAudit } from "../audit";
import { type DB, type ServiceContext, tryGetActorUserId } from "../context";
import { ConflictError, NotFoundError, ValidationError } from "../errors";
-import { requireFeature } from "../features";
import { getMembership } from "../member/membership";
-export const INCIDENT_FEATURE = "incident-management";
-
-export function requireIncidentFeature(ctx: ServiceContext): void {
- requireFeature(ctx, INCIDENT_FEATURE);
-}
-
export async function getIncidentInWorkspace(
tx: DB,
workspaceId: number,
diff --git a/packages/services/src/incident/link-status-report.ts b/packages/services/src/incident/link-status-report.ts
index 633d3b2da..5db220923 100644
--- a/packages/services/src/incident/link-status-report.ts
+++ b/packages/services/src/incident/link-status-report.ts
@@ -13,7 +13,6 @@ import {
appendIncidentEvent,
assertNotClosed,
getIncidentInWorkspace,
- requireIncidentFeature,
} from "./internal";
import { IncidentIdInput, LinkIncidentStatusReportInput } from "./schemas";
@@ -94,7 +93,6 @@ export async function linkIncidentStatusReport(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = LinkIncidentStatusReportInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
@@ -126,7 +124,6 @@ export async function unlinkIncidentStatusReport(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = IncidentIdInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/list-events.ts b/packages/services/src/incident/list-events.ts
index 97f4a21bf..05674322c 100644
--- a/packages/services/src/incident/list-events.ts
+++ b/packages/services/src/incident/list-events.ts
@@ -2,7 +2,7 @@ import { desc, eq } from "@openstatus/db";
import { incidentEvent } from "@openstatus/db/src/schema";
import { type ServiceContext, getReadDb } from "../context";
-import { getIncidentInWorkspace, requireIncidentFeature } from "./internal";
+import { getIncidentInWorkspace } from "./internal";
import { ListIncidentEventsInput } from "./schemas";
/** The incident's timeline, newest first. */
@@ -11,7 +11,6 @@ export async function listIncidentEvents(args: {
input: ListIncidentEventsInput;
}) {
const { ctx } = args;
- requireIncidentFeature(ctx);
const input = ListIncidentEventsInput.parse(args.input);
const db = getReadDb(ctx);
const existing = await getIncidentInWorkspace(db, ctx.workspace.id, input.id);
diff --git a/packages/services/src/incident/list.ts b/packages/services/src/incident/list.ts
index 1160038e8..d9ead4fef 100644
--- a/packages/services/src/incident/list.ts
+++ b/packages/services/src/incident/list.ts
@@ -2,8 +2,6 @@ import { and, desc, eq, inArray, sql } from "@openstatus/db";
import { incident } from "@openstatus/db/src/schema";
import { type ServiceContext, getReadDb } from "../context";
-import { isFeatureEnabled } from "../features";
-import { INCIDENT_FEATURE, requireIncidentFeature } from "./internal";
import { IncidentIdInput, ListIncidentsInput } from "./schemas";
const userColumns = {
@@ -24,7 +22,6 @@ export async function listIncidents(args: {
input?: ListIncidentsInput;
}) {
const { ctx } = args;
- requireIncidentFeature(ctx);
const input = ListIncidentsInput.parse(args.input ?? {});
const where = and(
@@ -48,7 +45,6 @@ export async function getIncident(args: {
input: IncidentIdInput;
}) {
const { ctx } = args;
- requireIncidentFeature(ctx);
const input = IncidentIdInput.parse(args.input);
return getReadDb(ctx).query.incident.findFirst({
where: and(
@@ -72,7 +68,6 @@ export async function getIncidentForStatusReport(args: {
input: { statusReportId: number };
}) {
const { ctx } = args;
- requireIncidentFeature(ctx);
return getReadDb(ctx)
.select({ id: incident.id, title: incident.title, status: incident.status })
.from(incident)
@@ -85,13 +80,12 @@ export async function getIncidentForStatusReport(args: {
.get();
}
-/** The incident bound to a Slack channel, or `undefined`. Never throws on the gate. */
+/** The incident bound to a Slack channel, or `undefined`. */
export async function getIncidentBySlackChannel(args: {
ctx: ServiceContext;
input: { teamId: string; channelId: string };
}) {
const { ctx } = args;
- if (!isFeatureEnabled(ctx.workspace, INCIDENT_FEATURE)) return undefined;
return getReadDb(ctx).query.incident.findFirst({
where: and(
eq(incident.workspaceId, ctx.workspace.id),
diff --git a/packages/services/src/incident/postmortem.ts b/packages/services/src/incident/postmortem.ts
index 6459b1e92..c826cf57c 100644
--- a/packages/services/src/incident/postmortem.ts
+++ b/packages/services/src/incident/postmortem.ts
@@ -16,11 +16,7 @@ import {
} from "../context";
import { ConflictError, NotFoundError } from "../errors";
import { closeIncidentInTx } from "./close";
-import {
- appendIncidentEvent,
- getIncidentInWorkspace,
- requireIncidentFeature,
-} from "./internal";
+import { appendIncidentEvent, getIncidentInWorkspace } from "./internal";
import {
ApprovePostmortemInput,
DraftPostmortemInput,
@@ -49,7 +45,6 @@ export async function draftPostmortem(args: {
}): Promise<IncidentPostmortem> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = DraftPostmortemInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
@@ -145,7 +140,6 @@ export async function approvePostmortem(args: {
}): Promise<IncidentPostmortem> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = ApprovePostmortemInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
@@ -204,7 +198,6 @@ export async function getPostmortem(args: {
input: IncidentIdInput;
}): Promise<IncidentPostmortem | undefined> {
const { ctx } = args;
- requireIncidentFeature(ctx);
const input = IncidentIdInput.parse(args.input);
const db = getReadDb(ctx);
const row = await getIncidentInWorkspace(db, ctx.workspace.id, input.id);
diff --git a/packages/services/src/incident/reminders.ts b/packages/services/src/incident/reminders.ts
index f97fc50bb..f966c534f 100644
--- a/packages/services/src/incident/reminders.ts
+++ b/packages/services/src/incident/reminders.ts
@@ -10,12 +10,10 @@ import {
} from "@openstatus/db/src/schema";
import type { DB, ServiceContext } from "../context";
-import { isFeatureEnabled } from "../features";
import {
type SlackConnection,
getSlackConnection,
} from "../integration/slack-connection";
-import { INCIDENT_FEATURE } from "./internal";
import type { SlackClientFactory } from "./slack-flow";
const HOUR = 60 * 60 * 1000;
@@ -80,7 +78,6 @@ async function reminderConnection(
);
if (!parsed.success) return null;
const ws = parsed.data;
- if (!isFeatureEnabled(ws, INCIDENT_FEATURE)) return null;
if (!ws.limits["slack-agent"]) return null;
const ctx: ServiceContext = {
workspace: ws,
diff --git a/packages/services/src/incident/set-status.ts b/packages/services/src/incident/set-status.ts
index 0d9066089..7c838e359 100644
--- a/packages/services/src/incident/set-status.ts
+++ b/packages/services/src/incident/set-status.ts
@@ -18,7 +18,6 @@ import {
appendIncidentEvent,
assertTransition,
getIncidentInWorkspace,
- requireIncidentFeature,
} from "./internal";
import { SetIncidentStatusInput } from "./schemas";
@@ -50,7 +49,6 @@ export async function setIncidentStatus(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = SetIncidentStatusInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/incident/slack-channel.ts b/packages/services/src/incident/slack-channel.ts
index a6be2f856..0c4a6915c 100644
--- a/packages/services/src/incident/slack-channel.ts
+++ b/packages/services/src/incident/slack-channel.ts
@@ -9,7 +9,6 @@ import {
appendIncidentEvent,
assertNotClosed,
getIncidentInWorkspace,
- requireIncidentFeature,
} from "./internal";
import { BindIncidentSlackChannelInput, IncidentIdInput } from "./schemas";
@@ -19,7 +18,6 @@ export async function bindIncidentSlackChannel(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = BindIncidentSlackChannelInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
@@ -83,18 +81,6 @@ export async function bindIncidentSlackChannel(args: {
export async function unbindIncidentSlackChannel(args: {
ctx: ServiceContext;
input: IncidentIdInput;
-}): Promise<Incident> {
- requireIncidentFeature(args.ctx);
- return clearIncidentSlackChannel(args);
-}
-
-/**
- * Unbind without the feature gate: Slack uninstall cleanup must drop every
- * binding whatever the workspace's rollout state.
- */
-export async function clearIncidentSlackChannel(args: {
- ctx: ServiceContext;
- input: IncidentIdInput;
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
diff --git a/packages/services/src/incident/slack-flow.ts b/packages/services/src/incident/slack-flow.ts
index 51a3ad66d..dd3d0a3c7 100644
--- a/packages/services/src/incident/slack-flow.ts
+++ b/packages/services/src/incident/slack-flow.ts
@@ -2,13 +2,12 @@ import { and, eq, isNull } from "@openstatus/db";
import { type Incident, slackUser, user } from "@openstatus/db/src/schema";
import { type ServiceContext, getReadDb } from "../context";
-import { isFeatureEnabled } from "../features";
import {
type SlackConnection,
getSlackConnection,
} from "../integration/slack-connection";
import { createSlackUserMapping } from "../slack-user/create";
-import { getIncidentInWorkspace, INCIDENT_FEATURE } from "./internal";
+import { getIncidentInWorkspace } from "./internal";
import { bindIncidentSlackChannel } from "./slack-channel";
type SlackText = { type: "mrkdwn" | "plain_text"; text: string };
@@ -121,11 +120,10 @@ function errorCode(err: Error | string): string {
return err.message;
}
-/** Channel automation needs the feature, the plan, and a fully-scoped install. */
+/** Channel automation needs the plan and a fully-scoped install. */
export async function incidentSlackReady(
ctx: ServiceContext,
): Promise<SlackConnection | null> {
- if (!isFeatureEnabled(ctx.workspace, INCIDENT_FEATURE)) return null;
if (!ctx.workspace.limits["slack-agent"]) return null;
const connection = await getSlackConnection({ ctx });
if (!connection || connection.missingScopes.length > 0) return null;
diff --git a/packages/services/src/incident/update.ts b/packages/services/src/incident/update.ts
index 0d64b863f..d897237bf 100644
--- a/packages/services/src/incident/update.ts
+++ b/packages/services/src/incident/update.ts
@@ -9,7 +9,6 @@ import {
assertMember,
assertNotClosed,
getIncidentInWorkspace,
- requireIncidentFeature,
userDisplayName,
} from "./internal";
import { UpdateIncidentInput } from "./schemas";
@@ -21,7 +20,6 @@ export async function updateIncident(args: {
}): Promise<Incident> {
const { ctx } = args;
requireScope(ctx, "write");
- requireIncidentFeature(ctx);
const input = UpdateIncidentInput.parse(args.input);
return withTransaction(ctx, async (tx) => {
diff --git a/packages/services/src/integration/uninstall-slack-agent.ts b/packages/services/src/integration/uninstall-slack-agent.ts
index 1119b6fdb..2d2bd24f4 100644
--- a/packages/services/src/integration/uninstall-slack-agent.ts
+++ b/packages/services/src/integration/uninstall-slack-agent.ts
@@ -4,7 +4,7 @@ import { incident, integration, workspace } from "@openstatus/db/src/schema";
import { emitAudit } from "../audit";
import { requireScope } from "../auth";
import { type DB, type ServiceContext, withTransaction } from "../context";
-import { clearIncidentSlackChannel } from "../incident/slack-channel";
+import { unbindIncidentSlackChannel } from "../incident/slack-channel";
import { parseWorkspaceForContext } from "../page-subscriber/internal";
import { removeSlackTeamSubscribers } from "../page-subscriber/slack";
import { deleteSlackUserMappings } from "../slack-user/internal";
@@ -60,7 +60,7 @@ export async function uninstallSlackAgent(args: {
)
.all();
for (const row of bound) {
- await clearIncidentSlackChannel({
+ await unbindIncidentSlackChannel({
ctx: { ...ctx, db: tx },
input: { id: row.id },
});