Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Assistants IChatClient handling of unrelated tool calls in history#6891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stephentoub merged 1 commit intodotnet:mainfromstephentoub:fixassistantshistory
Oct 6, 2025

Conversation

@stephentoub
Copy link
Member

@stephentoubstephentoub commentedOct 5, 2025
edited by dotnet-policy-servicebot
Loading

The implementation is assuming that any tool results in the incoming message history mean a thread ID is required, which would be necessary if those tool results were for an active run. But that's not the case if the history just contains historical function calls/responses, as is the case in agent scenarios where the message history from one agent is passed to another. The fix is to just stop throwing based on this incorrect assumption.

Microsoft Reviewers:Open in CodeFlow

@stephentoubstephentoub requested a review froma team as acode ownerOctober 5, 2025 15:07
CopilotAI review requested due to automatic review settingsOctober 5, 2025 15:07
@github-actionsgithub-actionsbot added the area-aiMicrosoft.Extensions.AI libraries labelOct 5, 2025
Copy link
Contributor

CopilotAI 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 fixes a bug in the OpenAI Assistants IChatClient implementation where it incorrectly assumed that any tool results in message history required a thread ID. The fix addresses scenarios where message history contains historical function calls/responses (like in agent scenarios) rather than active tool calls requiring a thread.

Key changes:

  • Removes validation that incorrectly throws when tool results are present without a thread ID
  • Updates logic to only process function results when the message role is Tool
  • Improves comments to clarify the distinction between active and historical tool results

The implementation is assuming that any tool results in the incoming message history mean a thread ID is required, which would be necessary if those tool results were for an active run. But that's not the case if the history just contains historical function calls/responses, as is the case in agent scenarios where the message history from one agent is passed to another.  The fix is to just stop throwing based on this incorrect assumption.
@stephentoubstephentoub merged commit22cbbb7 intodotnet:mainOct 6, 2025
6 checks passed
@stephentoubstephentoub deleted the fixassistantshistory branchOctober 6, 2025 21:05
This was referencedOct 15, 2025
This was referencedNov 5, 2025
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 6, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@eiriktsarpaliseiriktsarpaliseiriktsarpalis approved these changes

@jeffhandleyjeffhandleyAwaiting requested review from jeffhandley

Assignees

@stephentoubstephentoub

Labels

area-aiMicrosoft.Extensions.AI libraries

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@stephentoub@eiriktsarpalis

[8]ページ先頭

©2009-2025 Movatter.jp