diff --git a/server/src/__tests__/issue-wake-diagnostics-routes.test.ts b/server/src/__tests__/issue-wake-diagnostics-routes.test.ts index 1de34cb0300..d45f722851c 100644 --- a/server/src/__tests__/issue-wake-diagnostics-routes.test.ts +++ b/server/src/__tests__/issue-wake-diagnostics-routes.test.ts @@ -267,7 +267,11 @@ describeEmbeddedPostgres("issue wake diagnostics route", () => { expect(serialized).not.toContain("\"error\""); }); - it.each(["chat_task_completed", "issue_execution_deferred"])("preserves the known %s reason without exposing completion payloads", async reason => { + it.each([ + "chat_task_completed", + "issue_execution_deferred", + "execution_reconciliation_required", + ])("preserves the known %s reason without exposing completion payloads", async reason => { const company = await seedCompany(db); const agent = await seedAgent(db, company.id); const issue = await seedIssue(db, { companyId: company.id, title: "Completion target", assigneeAgentId: agent.id }); diff --git a/server/src/routes/issues-wake-diagnostics.test.ts b/server/src/routes/issues-wake-diagnostics.test.ts new file mode 100644 index 00000000000..05fe48698f1 --- /dev/null +++ b/server/src/routes/issues-wake-diagnostics.test.ts @@ -0,0 +1,14 @@ +import { describe, expect, it } from "vitest"; +import { projectWakeDiagnosticReason } from "./issues.js"; + +describe("issue wake diagnostics", () => { + it("preserves the reconciliation-required reason", () => { + expect(projectWakeDiagnosticReason("execution_reconciliation_required")).toBe( + "execution_reconciliation_required", + ); + }); + + it("continues to redact unrecognized reasons", () => { + expect(projectWakeDiagnosticReason("private-provider-detail")).toBe("other"); + }); +}); diff --git a/server/src/routes/issues.ts b/server/src/routes/issues.ts index a2cd8346850..cc09510deab 100644 --- a/server/src/routes/issues.ts +++ b/server/src/routes/issues.ts @@ -1468,6 +1468,7 @@ const ISSUE_WAKE_DIAGNOSTIC_KNOWN_REASONS = new Set([ "missing_issue_comment", "process_lost_retry", "run_liveness_continuation", + "execution_reconciliation_required", "heartbeat.disabled", "heartbeat.timer.no_actionable_work", "heartbeat.wakeOnDemand.disabled", @@ -1496,7 +1497,7 @@ function projectWakeDiagnosticSource(value: string | null) { return ISSUE_WAKE_DIAGNOSTIC_KNOWN_SOURCES.has(value) ? value : "other"; } -function projectWakeDiagnosticReason(value: string | null) { +export function projectWakeDiagnosticReason(value: string | null) { if (!value) return null; return ISSUE_WAKE_DIAGNOSTIC_KNOWN_REASONS.has(value) ? value : "other"; }