You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: retrying the agent runs here means if the agent did half of the work, the next agent would come up and continue those changes which is not correct.
355
+
// the agent should start from a clean state again and do the work. so the whole loop should be restarted.
355
356
constresult=awaitwithRetries(
356
357
async()=>{
358
+
conststartedAt=Date.now();
357
359
constresult=awaitagent.definition.run(
358
360
model,
359
361
task.prompt,
@@ -365,6 +367,7 @@ async function runEpisode(
365
367
logPrefix,
366
368
},
367
369
);
370
+
successfulRunDuration=Date.now()-startedAt;
368
371
returnresult;
369
372
},
370
373
{
@@ -386,10 +389,12 @@ async function runEpisode(
386
389
},
387
390
},
388
391
);
392
+
episodeDuration+=successfulRunDuration;
389
393
390
394
// Only accumulate usage from the successful result
391
395
usage.input+=result.usage.input;
392
396
usage.output+=result.usage.output;
397
+
usage.cost+=result.usage.cost;
393
398
394
399
// Collect actions from this task
395
400
episodeActions.push(...result.actions);
@@ -447,6 +452,7 @@ async function runEpisode(
447
452
logs: [],
448
453
actions: episodeActions,
449
454
usage,
455
+
duration: episodeDuration,
450
456
};
451
457
}finally{
452
458
if(cwd){
@@ -633,8 +639,7 @@ function summarizeAggregation(
0 commit comments