Skip to content

Session add_items gets cancelled before state is saved #1658

@dhruv-wrk

Description

@dhruv-wrk

Describe the bug

From what i have been able to see is when using the session the agent calls add_items and it is prematurely having the async cancellation before everything is recorded.

I was able to see that ‎RunResultStreaming calls cleanup_tasks as soon the stream finishes. As a result the session add_items gets cancelled before the full state has been recorded for the run

self._cleanup_tasks()

Debug information

  • Agents SDK version: 0.2.11
  • Python version 3.11

Expected behavior

The session should be allowed to complete and save the state

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions