Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(support): Team/Enterprise urgent (Sev-1) support requests (#14094)

Jannik Maierhöfer633c603a91d3
diff --git a/web/src/__tests__/supportCaseSeverity.clienttest.ts b/web/src/__tests__/supportCaseSeverity.clienttest.ts
new file mode 100644
index 0000000000..4b59626249
--- /dev/null
+++ b/web/src/__tests__/supportCaseSeverity.clienttest.ts
@@ -0,0 +1,65 @@
+// pylonClient imports the shared server logger at module load; stub it so this
+// stays a lightweight client-side unit test of the pure mapping function.
+vi.mock("@langfuse/shared/src/server", () => ({
+ logger: { error: vi.fn(), warn: vi.fn(), info: vi.fn() },
+}));
+
+import { mapToPylonCaseSeverity } from "@/src/features/support-chat/pylon/pylonClient";
+
+describe("mapToPylonCaseSeverity", () => {
+ const HIGH_TIER = "cloud:enterprise";
+ const LOW_TIER = "cloud:pro";
+
+ it("returns Sev-1 for outages on high-tier plans", () => {
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Outage, data loss, or data breach",
+ plan: HIGH_TIER,
+ }),
+ ).toBe("Sev-1");
+ });
+
+ it("honors a manual high-priority request on high-tier plans", () => {
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Question or feature request",
+ plan: HIGH_TIER,
+ isHighPriority: true,
+ }),
+ ).toBe("Sev-1");
+ });
+
+ it("ignores the high-priority flag for non-high-tier plans", () => {
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Question or feature request",
+ plan: LOW_TIER,
+ isHighPriority: true,
+ }),
+ ).toBe("Sev-3");
+ });
+
+ it("ignores the high-priority flag when no plan is known", () => {
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Question or feature request",
+ isHighPriority: true,
+ }),
+ ).toBe("Sev-3");
+ });
+
+ it("keeps existing mapping when high-priority is not set", () => {
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Feature is not working at all",
+ plan: HIGH_TIER,
+ }),
+ ).toBe("Sev-2");
+ expect(
+ mapToPylonCaseSeverity({
+ severity: "Question or feature request",
+ plan: HIGH_TIER,
+ }),
+ ).toBe("Sev-3");
+ });
+});
diff --git a/web/src/features/support-chat/SupportFormSection.tsx b/web/src/features/support-chat/SupportFormSection.tsx
index fcc58b89e9..7c7cbb2102 100644
--- a/web/src/features/support-chat/SupportFormSection.tsx
+++ b/web/src/features/support-chat/SupportFormSection.tsx
@@ -10,6 +10,7 @@ import {
TopicGroups,
type MessageType,
SupportFormSchema,
+ isHighTierSupportPlan,
} from "./formConstants";
import { api } from "@/src/utils/api";
@@ -24,7 +25,13 @@ import {
FormLabel,
FormMessage,
} from "@/src/components/ui/form";
+import { Checkbox } from "@/src/components/ui/checkbox";
import { RadioGroup } from "@/src/components/ui/radio-group";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/src/components/ui/tooltip";
import {
Select,
SelectContent,
@@ -41,7 +48,7 @@ import {
DropzoneContent,
DropzoneEmptyState,
} from "@/src/components/ui/shadcn-io/dropzone";
-import { Paperclip, Trash2 } from "lucide-react";
+import { Info, Paperclip, Trash2 } from "lucide-react";
import { showErrorToast } from "@/src/features/notifications/showErrorToast";
import { PYLON_MAX_FILE_SIZE_BYTES } from "./pylon/pylonConstants";
import Spinner from "@/src/components/design-system/Spinner/Spinner";
@@ -162,6 +169,12 @@ export function SupportFormSection({
}) {
const { organization, project } = useQueryProjectOrOrganization();
+ // Team / Enterprise customers may manually escalate a request to Sev-1.
+ const canRequestHighPriority = isHighTierSupportPlan(organization?.plan);
+
+ // Controlled so the high-priority info tooltip opens on hover and on click.
+ const [highPriorityInfoOpen, setHighPriorityInfoOpen] = useState(false);
+
// Tracks whether we've already warned about a short message
const [warnedShortOnce, setWarnedShortOnce] = useState(false);
@@ -180,6 +193,7 @@ export function SupportFormSection({
defaultValues: {
messageType: "Question" as MessageType,
severity: "Question or feature request",
+ isHighPriority: false,
topic: "",
message: "",
integrationType: "",
@@ -208,6 +222,7 @@ export function SupportFormSection({
form.reset({
messageType: "Question",
severity: "Question or feature request",
+ isHighPriority: false,
topic: "",
message: "",
});
@@ -282,6 +297,7 @@ export function SupportFormSection({
await createSupportThread.mutateAsync({
messageType: parsed.messageType,
severity: parsed.severity,
+ isHighPriority: parsed.isHighPriority,
topic: parsed.topic as any,
integrationType: parsed.integrationType,
message: parsed.message,
@@ -376,20 +392,64 @@ export function SupportFormSection({
render={({ field }) => (
<FormItem>
<FormLabel>Severity</FormLabel>
- <FormControl>
- <Select value={field.value} onValueChange={field.onChange}>
- <SelectTrigger>
- <SelectValue placeholder="Select severity" />
- </SelectTrigger>
- <SelectContent>
- {SEVERITIES.map((s) => (
- <SelectItem key={s} value={s}>
- {s}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </FormControl>
+ <div className="flex items-center gap-3">
+ <FormControl>
+ <Select value={field.value} onValueChange={field.onChange}>
+ <SelectTrigger className="flex-1">
+ <SelectValue placeholder="Select severity" />
+ </SelectTrigger>
+ <SelectContent>
+ {SEVERITIES.map((s) => (
+ <SelectItem key={s} value={s}>
+ {s}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </FormControl>
+
+ {/* High priority (Sev-1) — only for Team / Enterprise plans */}
+ {canRequestHighPriority && (
+ <FormField
+ control={form.control}
+ name="isHighPriority"
+ render={({ field: priorityField }) => (
+ <FormItem className="flex shrink-0 flex-row items-center gap-1.5 space-y-0">
+ <FormControl>
+ <Checkbox
+ checked={priorityField.value ?? false}
+ onCheckedChange={priorityField.onChange}
+ />
+ </FormControl>
+ <FormLabel className="cursor-pointer text-sm font-normal whitespace-nowrap">
+ Urgent (Sev-1)
+ </FormLabel>
+ <Tooltip
+ open={highPriorityInfoOpen}
+ onOpenChange={setHighPriorityInfoOpen}
+ >
+ <TooltipTrigger asChild>
+ <button
+ type="button"
+ onClick={() =>
+ setHighPriorityInfoOpen((open) => !open)
+ }
+ className="text-muted-foreground hover:text-foreground"
+ aria-label="High priority info"
+ >
+ <Info className="h-3.5 w-3.5" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ Mark as high priority only for time-critical
+ issues such as production outages.
+ </TooltipContent>
+ </Tooltip>
+ </FormItem>
+ )}
+ />
+ )}
+ </div>
<FormMessage />
</FormItem>
)}
diff --git a/web/src/features/support-chat/formConstants.ts b/web/src/features/support-chat/formConstants.ts
index 906ce1265a..c577a17f8b 100644
--- a/web/src/features/support-chat/formConstants.ts
+++ b/web/src/features/support-chat/formConstants.ts
@@ -46,6 +46,20 @@ export const SeveritySchema = z.enum([
]);
export type Severity = z.infer<typeof SeveritySchema>;
+/**
+ * Plans that may manually flag a support request as high priority (Sev-1).
+ * Mirrors the high-tier check in `mapToPylonCaseSeverity`.
+ */
+export const HIGH_TIER_SUPPORT_PLANS = [
+ "cloud:team",
+ "cloud:enterprise",
+ "self-hosted:enterprise",
+] as const;
+
+/** Whether the given plan may manually escalate a support request to Sev-1. */
+export const isHighTierSupportPlan = (plan?: string): boolean =>
+ !!plan && (HIGH_TIER_SUPPORT_PLANS as readonly string[]).includes(plan);
+
export const IntegrationTypeSchema = z.enum([
"Python SDK",
"TypeScript SDK",
@@ -65,6 +79,11 @@ export type IntegrationType = z.infer<typeof IntegrationTypeSchema>;
export const SupportFormSchema = z.object({
messageType: MessageTypeSchema.default("Question"),
severity: SeveritySchema,
+ /**
+ * Manual high-priority (Sev-1) escalation. Only honored server-side for
+ * high-tier plans (see {@link isHighTierSupportPlan}).
+ */
+ isHighPriority: z.boolean().default(false),
integrationType: z.string().optional(),
topic: z
.union([TopicSchema, z.literal("")])
diff --git a/web/src/features/support-chat/pylon/pylonClient.ts b/web/src/features/support-chat/pylon/pylonClient.ts
index 2ca008b17f..feae19d32c 100644
--- a/web/src/features/support-chat/pylon/pylonClient.ts
+++ b/web/src/features/support-chat/pylon/pylonClient.ts
@@ -1,4 +1,5 @@
import { logger } from "@langfuse/shared/src/server";
+import { isHighTierSupportPlan } from "../formConstants";
const PYLON_API_BASE = "https://api.usepylon.com";
@@ -256,14 +257,18 @@ export function mapMessageTypeToPylonQuestionType(messageType: string): string {
export function mapToPylonCaseSeverity(params: {
severity: string;
plan?: string;
+ /** Customer manually requested high priority via the support form. */
+ isHighPriority?: boolean;
}): "Sev-1" | "Sev-2" | "Sev-3" {
- const { severity, plan } = params;
- const isHighTierPlan =
- plan === "cloud:team" ||
- plan === "cloud:enterprise" ||
- plan === "self-hosted:enterprise";
+ const { severity, plan, isHighPriority } = params;
+ const isHighTierPlan = isHighTierSupportPlan(plan);
- if (severity === "Outage, data loss, or data breach" && isHighTierPlan) {
+ // High-tier customers (Team/Enterprise) get Sev-1 either automatically for
+ // outages, or when they manually flag a time-critical request as urgent.
+ if (
+ isHighTierPlan &&
+ (isHighPriority || severity === "Outage, data loss, or data breach")
+ ) {
return "Sev-1";
}
diff --git a/web/src/features/support-chat/trpc/supportRouter.ts b/web/src/features/support-chat/trpc/supportRouter.ts
index f9f8ccd86f..d96fcdfed9 100644
--- a/web/src/features/support-chat/trpc/supportRouter.ts
+++ b/web/src/features/support-chat/trpc/supportRouter.ts
@@ -15,6 +15,7 @@ import {
SeveritySchema,
TopicSchema,
TopicGroups,
+ isHighTierSupportPlan,
} from "../formConstants";
import {
@@ -34,6 +35,8 @@ import {
const CreateSupportThreadInput = z.object({
messageType: MessageTypeSchema,
severity: SeveritySchema,
+ /** Manual Sev-1 escalation; only honored for high-tier plans (enforced below). */
+ isHighPriority: z.boolean().optional(),
topic: TopicSchema,
message: z.string().trim().min(1),
url: z.url().optional(),
@@ -148,6 +151,12 @@ export const supportRouter = createTRPCRouter({
currentSupportRequestContext.organizationId = organization.id;
}
+ // Only honor a manual high-priority request for high-tier plans; ignore
+ // the client-supplied flag otherwise so it cannot be used to force Sev-1.
+ const honorHighPriority =
+ input.isHighPriority === true &&
+ isHighTierSupportPlan(currentSupportRequestContext.plan);
+
const { topLevel, subtype } = splitTopic(input.topic);
// Generate a short unique identifier to prevent Gmail from merging threads
@@ -190,7 +199,9 @@ export const supportRouter = createTRPCRouter({
requesterEmail: email,
requesterName: fullName,
tags: ["Langfuse"],
- priority: mapSeverityToPylonPriority(input.severity),
+ priority: honorHighPriority
+ ? "urgent"
+ : mapSeverityToPylonPriority(input.severity),
attachmentUrls: input.pylonAttachmentUrls,
customFields: [
...(input.url
@@ -215,6 +226,7 @@ export const supportRouter = createTRPCRouter({
value: mapToPylonCaseSeverity({
severity: input.severity,
plan: currentSupportRequestContext.plan,
+ isHighPriority: honorHighPriority,
}),
},
],