fix(agents): preserve sessions fallback errors

This commit is contained in:
Vincent Koc
2026-05-27 07:38:15 +02:00
parent e7214efbb7
commit 798691779b

View File

@@ -231,7 +231,9 @@ async function startAgentRun(params: {
} catch (err) {
const queueSummary =
formatEmbeddedPiQueueFailureSummary(queueOutcome) ?? "active run queue rejected";
throw new Error(`${queueSummary}; fallback_failed error=${formatErrorMessage(err)}`);
throw new Error(`${queueSummary}; fallback_failed error=${formatErrorMessage(err)}`, {
cause: err,
});
}
}
const response = await params.callGateway<{ runId: string }>({