@@ -977,7 +977,7 @@ export class ProvisioningJobService {
977977 await agentSandboxesRepository . update ( data . agentId , {
978978 status : "error" ,
979979 error_message : `Provisioning permanently failed after ${ job . max_attempts } attempts: ${ errorMsg } ` ,
980- } as Parameters < typeof agentSandboxesRepository . update > [ 1 ] ) ;
980+ } ) ;
981981 logger . warn ( "[provisioning-jobs] Marked sandbox as error after permanent failure" , {
982982 jobId : job . id ,
983983 agentId : data . agentId ,
@@ -1001,7 +1001,7 @@ export class ProvisioningJobService {
10011001 await agentSandboxesRepository . update ( data . agentId , {
10021002 status : "deletion_failed" ,
10031003 error_message : `Deletion permanently failed after ${ job . max_attempts } attempts: ${ errorMsg } ` ,
1004- } as Parameters < typeof agentSandboxesRepository . update > [ 1 ] ) ;
1004+ } ) ;
10051005 logger . warn (
10061006 "[provisioning-jobs] Marked sandbox as deletion_failed after permanent failure" ,
10071007 { jobId : job . id , agentId : data . agentId } ,
@@ -1387,18 +1387,16 @@ export class ProvisioningJobService {
13871387 const provResult = await elizaSandboxService . provision ( data . agentId , data . organizationId ) ;
13881388
13891389 if ( ! provResult . success ) {
1390- // Store partial result for debugging
13911390 await jobsRepository . update ( job . id , {
1392- result : {
1391+ result : agentProvisionJobResultToRecord ( {
13931392 cloudAgentId : data . agentId ,
13941393 status : provResult . sandboxRecord ?. status ?? "error" ,
13951394 error : provResult . error ,
1396- } ,
1395+ } ) ,
13971396 } ) ;
13981397 throw new Error ( provResult . error ) ;
13991398 }
14001399
1401- // Mark completed with result
14021400 const jobResult : AgentProvisionJobResult = {
14031401 cloudAgentId : data . agentId ,
14041402 status : provResult . sandboxRecord . status ,
@@ -1411,7 +1409,6 @@ export class ProvisioningJobService {
14111409 completed_at : new Date ( ) ,
14121410 } ) ;
14131411
1414- // Fire webhook if configured
14151412 if ( job . webhook_url ) {
14161413 await this . fireWebhook ( job , jobResult ) ;
14171414 }
@@ -1508,7 +1505,7 @@ export class ProvisioningJobService {
15081505
15091506 await jobsRepository . update ( job . id , {
15101507 webhook_status : response . ok ? "delivered" : `failed_${ response . status } ` ,
1511- } as Partial < Job > ) ;
1508+ } ) ;
15121509
15131510 if ( ! response . ok ) {
15141511 logger . warn ( "[provisioning-jobs] Webhook delivery failed" , {
@@ -1525,7 +1522,7 @@ export class ProvisioningJobService {
15251522
15261523 await jobsRepository . update ( job . id , {
15271524 webhook_status : "error" ,
1528- } as Partial < Job > ) ;
1525+ } ) ;
15291526 }
15301527 }
15311528}
0 commit comments