Skip to content

Python: [Bug]: Handoff_with_tool_approval_checkpoint_resume sample is failing #3859

@dantelmomsft

Description

@dantelmomsft

Description

the following sample https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/workflows/checkpoint/handoff_with_tool_approval_checkpoint_resume.py is failing with 1.0.0b260210 version

Code Sample

Error Messages / Stack Traces

HANDOFF WORKFLOW CHECKPOINT DEMO
============================================================

Starting workflow with: Hi, my order 12345 arrived damaged. I need a refund.

[Status] WorkflowRunState.IN_PROGRESS
[INFO] httpx: HTTP Request: POST https://fdy-zava-agent-wks-yv9l.openai.azure.com/openai/deployments/gpt-4.1/chat/completions?api-version=2024-10-21 "HTTP/1.1 200 OK"
[INFO] agent_framework._workflows._runner: Yielding pre-loop events

[Workflow Completed]
Traceback (most recent call last):
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 405, in <module>
    asyncio.run(main())
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
[Workflow Completed]
Traceback (most recent call last):
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 405, in <module>
    asyncio.run(main())
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
Traceback (most recent call last):
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 405, in <module>
    asyncio.run(main())
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
odule>
    asyncio.run(main())
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
    asyncio.run(main())
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 339, in main
           ^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 339, in main
    pending_requests, _ = await run_until_user_input_needed(
    pending_requests, _ = await run_until_user_input_needed(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dantelmo\code\azure\ai\agent-framework-fork\agent-framework\python\samples\getting_started\workflows\checkpoint\handoff_with_tool_approval_checkpoint_resume.py", line 216, in run_until_user_input_needed
    print(f"Final conversation length: {len(event.data)} messages")
                                        ^^^^^^^^^^^^^^^
TypeError: object of type 'AgentResponseUpdate' has no len()

Package Versions

agent-framework-orchestrations==1.0.0b260210

Python Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

agent orchestrationIssues related to agent orchestrationbugSomething isn't workingpythonworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions