We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4691ec5 commit 1a6f2fcCopy full SHA for 1a6f2fc
packages/agent-runtime/src/run-agent-step.ts
@@ -480,14 +480,15 @@ export async function loopAgentSteps(
480
throw new Error(`Agent template not found for type: ${agentType}`)
481
}
482
483
- const runId = crypto.randomUUID()
484
- agentState.runId = runId
485
- await startAgentRun({
+ const runId = await startAgentRun({
486
...params,
487
- runId,
488
agentId: agentTemplate.id,
489
ancestorRunIds: agentState.ancestorRunIds,
490
})
+ if (!runId) {
+ throw new Error('Failed to start agent run')
+ }
491
+ agentState.runId = runId
492
493
// Initialize message history with user prompt and instructions on first iteration
494
const instructionsPrompt = await getAgentPrompt({
0 commit comments