Skip to content

Conversation

@stephentoub
Copy link
Contributor

The check is overly strict; it assumes all of the provided messages are in response to a previous conversation with this service, but the messages could be the history from a conversation with another service, as can happen in agent-based scenarios. In such cases, there may be function tool calls and results in the history; the rest of the implementation will properly ignore them, as the service doesn't provide any way to send those calls into the service, but this check was blowing up before then.

The check is overly strict; it assumes all of the provided messages are in response to a previous conversation with this service, but the messages could be the history from a conversation with another service, as can happen in agent-based scenarios. In such cases, there may be function tool calls and results in the history; the rest of the implementation will properly ignore them, as the service doesn't provide any way to send those calls into the service, but this check was blowing up before then.
@stephentoub stephentoub requested a review from trangevi as a code owner October 6, 2025 01:07
Copilot AI review requested due to automatic review settings October 6, 2025 01:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes an overly strict validation check in the PersistentAgentsChatClient that was preventing legitimate agent-based conversation scenarios. The removed check incorrectly assumed all messages were from conversations with the same service, but in agent scenarios, message history may include function tool calls from other services that should be allowed and properly ignored by the implementation.

  • Removed validation that threw an exception when no thread ID was provided but messages contained tool results
  • Updated a comment to be more precise about when tool results are submitted to a run

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Thank you for your contribution @stephentoub! We will review the pull request and get back to you soon.

@stephentoub
Copy link
Contributor Author

@stephentoub
Copy link
Contributor Author

@nick863, would you mind reviewing this?

@stephentoub stephentoub enabled auto-merge (squash) October 16, 2025 19:42
@stephentoub stephentoub merged commit a0347e2 into Azure:main Oct 24, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Model Inference AI Projects Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants