feat(image): complete reviewed generation delivery
Memind CI / Test, build, and release guards (pull_request) Successful in 2m47s

This commit is contained in:
john
2026-07-20 20:04:44 +08:00
parent fc3d27aae0
commit 4b15610aa8
42 changed files with 1764 additions and 97 deletions
+10 -5
View File
@@ -864,13 +864,18 @@ export function createAgentRunGateway({
{ routing = null, toolEvidence = null } = {},
) {
assertRequiredImageGenerationCompleted(row, routing, toolEvidence);
// `row` was loaded before this worker claimed the run, so its started_at
// can still be null. Refresh it before scoping workspace files to the
// current execution window.
const claimedRun = await getRunById(runId);
const runStartedAtMs = claimedRun?.started_at ?? row.started_at ?? null;
let deliveryResult = null;
if (typeof syncUserPagesOnSuccess === 'function') {
deliveryResult = await syncUserPagesOnSuccess({
userId: row.user_id,
sessionId,
runId,
runStartedAtMs: row.started_at ?? null,
runStartedAtMs,
});
}
const pageDataErrors = Array.isArray(deliveryResult?.pageDataBind?.errors)
@@ -892,17 +897,17 @@ export function createAgentRunGateway({
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.
// Preserve it so a run with no current artifact cannot fall back to
// historical workspace pages; `null` is reserved for legacy callers
// that provide no scoping information at all.
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,
runStartedAtMs: latest?.started_at ?? runStartedAtMs,
workspaceRelativePaths,
});
if (requiresPageDeliverable && deliverables.pageCount < 1) {