fix(mindspace): fail closed on invalid page data delivery
This commit is contained in:
@@ -817,12 +817,19 @@ export function createAgentRunGateway({
|
||||
let deliverables = null;
|
||||
if (requiresPageDeliverable || typeof validateRunDeliverables === 'function') {
|
||||
const latest = await getRunById(runId);
|
||||
// `[]` is a strict allowlist meaning no workspace page may be examined.
|
||||
// Static page runs commonly have no Page Data artifact list, so use
|
||||
// `null` to discover the current run's newly synced workspace output.
|
||||
const workspaceRelativePaths = Array.isArray(deliveryResult?.pageDataRelativePaths)
|
||||
&& deliveryResult.pageDataRelativePaths.length > 0
|
||||
? deliveryResult.pageDataRelativePaths
|
||||
: null;
|
||||
deliverables = await prepareAndDetectSessionDeliverables({
|
||||
pool,
|
||||
userId: row.user_id,
|
||||
sessionId,
|
||||
runStartedAtMs: latest?.started_at ?? row.started_at ?? null,
|
||||
workspaceRelativePaths: deliveryResult?.pageDataRelativePaths ?? [],
|
||||
workspaceRelativePaths,
|
||||
});
|
||||
if (requiresPageDeliverable && deliverables.pageCount < 1) {
|
||||
const error = new Error(
|
||||
|
||||
Reference in New Issue
Block a user