Skip to content

feat(errors): add ignore_tool_parameter_parse_errors#859

Open
manucorporat wants to merge 1 commit intoanthropics:mainfrom
manucorporat:fix-ignore-parse-tool-errors
Open

feat(errors): add ignore_tool_parameter_parse_errors#859
manucorporat wants to merge 1 commit intoanthropics:mainfrom
manucorporat:fix-ignore-parse-tool-errors

Conversation

@manucorporat
Copy link
Copy Markdown

…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.

…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.
@manucorporat manucorporat requested a review from a team as a code owner December 9, 2025 13:16
Copy link
Copy Markdown
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

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

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 👍.

@manucorporat
Copy link
Copy Markdown
Author

i can make this change!

@localden localden added code-change Hand-written SDK code — fix directly in this repo spec-change Stainless-generated code — fix in OpenAPI spec / Stainless config labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-change Hand-written SDK code — fix directly in this repo spec-change Stainless-generated code — fix in OpenAPI spec / Stainless config

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants