feat(errors): add ignore_tool_parameter_parse_errors#859
Open
manucorporat wants to merge 1 commit intoanthropics:mainfrom
Open
feat(errors): add ignore_tool_parameter_parse_errors#859manucorporat wants to merge 1 commit intoanthropics:mainfrom
manucorporat wants to merge 1 commit intoanthropics:mainfrom
Conversation
…ageStream to handle parse errors - Introduced UnableToParseToolParameterError for better error handling. - Updated BetaMessageStream to conditionally ignore tool parameter parse errors based on new ignore_tool_parameter_parse_errors flag in MessageCreateParamsBase. - Enhanced error handling during JSON parsing in BetaMessageStream.
sanyamkamat
approved these changes
Dec 9, 2025
pabloelisseo
approved these changes
Dec 9, 2025
Collaborator
RobertCraigie
left a comment
There was a problem hiding this comment.
I don't think we should ship a ignore_tool_parameter_parse_errors parameter.
Instead it would be a much better API if the error callback handler could somehow tell the stream to keep going.
e.g. something like this
stream.on('error', (error) => {
if (error instanceof UnableToParseToolParameterError) {
return { continue: true };
}
});The separate UnableToParseToolParameterError error class is a good change 👍.
Author
|
i can make this change! |
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.
…ageStream to handle parse errors