diff --git a/scripts/ingest-recovery/agent-migration-runtime.ts b/scripts/ingest-recovery/agent-migration-runtime.ts index 24420c9b..307e2c71 100644 --- a/scripts/ingest-recovery/agent-migration-runtime.ts +++ b/scripts/ingest-recovery/agent-migration-runtime.ts @@ -249,7 +249,8 @@ export async function controlPlaneMigrationLock( throw new Error( `Control-plane migration lock failed (${code}, ${diagnostic.length} diagnostic bytes)`, ); - const result: unknown = JSON.parse(output); + // `convex run` prints nothing when a function returns null, which is the `complete` contract. + const result: unknown = output.trim() === '' ? null : JSON.parse(output); if ( (phase === 'begin' && typeof result !== 'boolean') || (phase === 'complete' && result !== null)