Skip to content

fix: incorrect history when user aborts in-progress toolUse #1542

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

jguoamz
Copy link
Contributor

@jguoamz jguoamz commented Jun 5, 2025

Problem

  • incorrect history when user aborts in-progress toolUse, this leads to incorrect history which confuses LLM and takes long time to recover

Solution

  • Populating the previous toolResult back when user aborts instead of simply dropping it
  • Fix a bug where modelId can be empty string which causes 400

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jguoamz jguoamz marked this pull request as ready for review June 5, 2025 22:59
@jguoamz jguoamz requested a review from a team as a code owner June 5, 2025 22:59
Copy link
Contributor

@tsmithsz tsmithsz left a comment

Choose a reason for hiding this comment

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

nit: Could we add a unit test for this case?

@jguoamz
Copy link
Contributor Author

jguoamz commented Jun 5, 2025

nit: Could we add a unit test for this case?

normally yes, but since we have a new refactoring soon, will skip to deploy the fix first

@jguoamz jguoamz merged commit 0288d85 into aws:main Jun 5, 2025
6 checks passed
@jguoamz jguoamz deleted the fixHistory branch June 5, 2025 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants