feat(js): mark interrupt tools as non-restartable and preserve tool metadata#5414
Open
pavelgj wants to merge 2 commits into
Open
feat(js): mark interrupt tools as non-restartable and preserve tool metadata#5414pavelgj wants to merge 2 commits into
pavelgj wants to merge 2 commits into
Conversation
- Set `restartable: false` in interrupt tool metadata so consumers can distinguish interrupts from regular tools - Spread existing `config.metadata.tool` in multipart tools to avoid overwriting prior tool metadata properties (e.g. `restartable`) - Add tests covering metadata preservation for interrupts, multipart, and non-multipart tools
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces changes to preserve existing metadata properties on tools, specifically ensuring that metadata.tool properties are not overwritten for multipart and non-multipart tools, and marks interrupts as non-restartable. The review feedback highlights an issue where custom metadata on interrupts could still be discarded because metadata is overwritten directly rather than merged. A code suggestion is provided to correctly spread and preserve existing metadata, along with a recommendation to update the test suite to verify this behavior.
Previously, the interrupt function was overwriting all existing metadata
with only `{ tool: { restartable: false } }`. This change spreads the
existing metadata and tool properties before setting restartable, ensuring
custom metadata and other tool properties are preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
restartable: falsein interrupt tool metadata so consumers can distinguish interrupts from regular toolsconfig.metadata.toolin multipart tools to avoid overwriting prior tool metadata properties (e.g.restartable)