Skip to content

Python: Bug: AgentThreadActions get_messages #12435

Closed
@mjnong

Description

@mjnong

Describe the bug
Not able to fetch messages for an AzureAIAgentThread with a thread where the agent no longer exists. Reason for this is that each message inside a thread seems to have the field agent_id associated to it. This in itself causes the issue when calling get_messages on a thread since the message object has an id of an agent which no longer exists causing this method to fail. The reason why this should not fail is because if a thread exists we should still be able to fetch the messages in order to either continue the conversation with an other agent (doable in the playground) or to just retrieve the messages in the thread for any arbitrary reason when the original assistant to those messages no longer exists.

To Reproduce
Steps to reproduce the behavior:

  1. Create AzureAIAgent
  2. Create AzureAIAgentThread
  3. Save the thread id
  4. Invoke chat with agent
  5. Delete agent
  6. Create AzureAIAgentThread with the original thread id saved from step (3)
  7. Try to retrieve the messages for the thread

Expected behavior
Messages from that thread to be returned even if assistant_id for those messages are no longer present. If thread id itself is non-existent then it should return error.

Platform

  • Language: Python
  • AI model: OpenAI:GPT-4o-mini(2024-07-18)
  • IDE: Visual Studio, VS Code
  • OS: Mac

Metadata

Metadata

Assignees

Labels

agentsbugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions