fix(report): persist longform appendix on self-hosted upsert (BUG-576)
Engine calls already returned markdown; the worker failed because local postgres upsert required onConflict and the appendix write omitted it. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,7 +32,7 @@ export type ReportLoadState =
|
||||
| { phase: "not-found" }
|
||||
| { phase: "generating"; progressPercent?: number; progressPhase?: string }
|
||||
| { phase: "timed-out" }
|
||||
| { phase: "failed"; failureCode: string | null; failureSummary?: string | null }
|
||||
| { phase: "failed"; failureCode: string | null; failureSummary?: string | null; appendixLastErrorCode?: string | null }
|
||||
| { phase: "invalid"; message: string }
|
||||
| { phase: "network-error" }
|
||||
| { phase: "markdown-ready"; markdown: string; reportId: string; createdAt: string }
|
||||
@@ -47,6 +47,7 @@ export interface ReportEnvelopeView {
|
||||
status: string;
|
||||
failureCode: string | null;
|
||||
failureSummary?: string | null;
|
||||
appendixLastErrorCode?: string | null;
|
||||
createdAt: string;
|
||||
completedAt: string | null;
|
||||
progressPercent?: number;
|
||||
@@ -108,10 +109,15 @@ export function classifyReportEnvelope(statusCode: number, json: unknown): Repor
|
||||
const summary = typeof view.failureSummary === "string" && view.failureSummary.length > 0
|
||||
? view.failureSummary
|
||||
: null;
|
||||
const appendixLastErrorCode = typeof view.appendixLastErrorCode === "string"
|
||||
&& view.appendixLastErrorCode.length > 0
|
||||
? view.appendixLastErrorCode
|
||||
: null;
|
||||
return {
|
||||
phase: "failed",
|
||||
failureCode: code,
|
||||
failureCode: appendixLastErrorCode ?? code,
|
||||
...(summary ? { failureSummary: summary } : {}),
|
||||
...(appendixLastErrorCode ? { appendixLastErrorCode } : {}),
|
||||
};
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user