Skip to content

Session terminates prematurely at step N-1, causing infinite retry loop at step N #23

@EHernandez-dev

Description

@EHernandez-dev

Summary

When running a multi-step plan (e.g., 10 steps), the session terminates at the end of step N-1, but the control loop still attempts to execute step N. This causes a 'NoneType' object has no attribute 'name' error, which triggers an infinite retry loop with no retry limit. I have had this error twice.

Steps to reproduce:

  1. Create a plan with 10 steps using planning_and_control_context_carryover()
  2. Execute the plan - steps 1-9 complete successfully
  3. At the end of step 9, observe that step 10 is marked as "completed ✅" before it runs
  4. Session terminates
  5. Step 10 still tries to execute on the terminated session
  6. Error occurs, retries indefinitely

The logs:

End of step 9 (chat_output_researcher_step_9.json):

{
  "content": "**Step number:** 10 out of 10... **Status:** completed ✅"
},
{
  "name": "terminator",
  "content": null
},
{
  "name": "_Group_Tool_Executor",
  "content": "Session terminated."
}

Step 10 (chat_output_researcher_step_10.json):
{
  "name": "control_starter",
  "content": null
},
{
  "name": "_Group_Tool_Executor",
  "content": "Error: 'NoneType' object has no attribute 'name'"
}
// Repeats 50+ times








### Expected Behavior:

1. Session should not terminate until ALL steps have actually executed, OR
2. Control loop should not attempt to run step N after session termination, OR
3. A retry limit should prevent infinite loops on unrecoverable errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions