File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed
packages/agent-runtime/src Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -406,19 +406,6 @@ export const runAgentStep = async (
406406 ( result ) => ! TOOLS_WHICH_WONT_FORCE_NEXT_STEP . includes ( result . toolName ) ,
407407 ) . length === 0
408408
409- // Exception: if the only tool call is write_todos and all todos are completed, then end turn.
410- let hasOnlyFinishedTodos = false
411- if (
412- toolCalls . every ( ( call ) => call . toolName === 'write_todos' ) &&
413- toolCalls . some ( ( call ) =>
414- ( call . input . todos as { task : string ; completed : boolean } [ ] ) . every (
415- ( todo ) => todo . completed ,
416- ) ,
417- )
418- ) {
419- hasOnlyFinishedTodos = true
420- }
421-
422409 const hasTaskCompleted = toolCalls . some (
423410 ( call ) =>
424411 call . toolName === 'task_completed' || call . toolName === 'end_turn' ,
@@ -435,8 +422,8 @@ export const runAgentStep = async (
435422 // - end_turn is called (backward compatibility)
436423 shouldEndTurn = hasTaskCompleted
437424 } else {
438- // For other models, also end turn when there are no tool calls or only a call to finished todos
439- shouldEndTurn = hasTaskCompleted || hasNoToolResults || hasOnlyFinishedTodos
425+ // For other models, also end turn when there are no tool calls
426+ shouldEndTurn = hasTaskCompleted || hasNoToolResults
440427 }
441428
442429 agentState = {
You can’t perform that action at this time.
0 commit comments