Skip to content

Conversation

vbarda
Copy link
Contributor

@vbarda vbarda commented Apr 7, 2025

Fixes #30708

@vbarda vbarda requested a review from eyurtsev April 7, 2025 15:00
Copy link

vercel bot commented Apr 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
langchain Ready Ready Preview Comment Sep 11, 2025 1:41am

@dosubot dosubot bot added the size:M label Apr 7, 2025
@deershark
Copy link
Contributor

@vbarda @eyurtsev Because of this problem, some functions of our project cannot be implemented at present :( ..... May I ask if there are any problems with this PR? It has been two weeks.

@ben-gineer
Copy link

@vbarda - I'm also keen to use this to help handling tool errors.

@eyurtsev eyurtsev self-assigned this May 16, 2025
@eyurtsev
Copy link
Collaborator

@ben-gineer and @deershark we'll try to get this in soon sorry the delay.

But you should also be favoring the .stream() or .astream() APIs and orchestrating using langgraph. astream_events API should largely be unnecessary these days for development

@ben-gineer
Copy link

Thanks. The only reason I’m using it is to allow me to stream events within a Streamlit app using LangGraph MCP tools without introducing a FastAPI intermediate service.

If you know of alternative solutions, I’d be happy to switch.

@mdrxy mdrxy removed the size:M label Jul 14, 2025
@mdrxy mdrxy changed the title core[patch]: add on_tool_error to _AstreamEventsCallbackHandler fix(core): add on_tool_error to _AstreamEventsCallbackHandler Jul 16, 2025
Copy link

codspeed-hq bot commented Jul 16, 2025

CodSpeed WallTime Performance Report

Merging #30709 will not alter performance

Comparing vb/add-on-tool-error (1a09da7) with wip-v1.0 (ced9fc2)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Jul 16, 2025

CodSpeed Instrumentation Performance Report

Merging #30709 will not alter performance

Comparing vb/add-on-tool-error (1a09da7) with wip-v1.0 (311aa94)1

Summary

✅ 14 untouched benchmarks

Footnotes

  1. No successful run was found on wip-v1.0 (ced9fc2) during the generation of this report, so d1c5ff1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mdrxy mdrxy added this to the v1 milestone Jul 22, 2025
@mdrxy mdrxy removed the 0.4 release label Jul 22, 2025
@mdrxy mdrxy added the core Related to the package `langchain-core` label Aug 7, 2025
@mdrxy mdrxy requested a review from Copilot September 9, 2025 23:47
Copy link
Contributor

@Copilot Copilot AI 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 adds the missing on_tool_error callback handler to the _AstreamEventsCallbackHandler class to fix issue #30708. The change ensures that tool error events are properly captured and emitted in the streaming events API.

Key Changes

  • Added on_tool_error method implementation to the event stream callback handler
  • Added error field to the EventData schema to support error information in streaming events

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
libs/core/langchain_core/tracers/event_stream.py Implements the missing on_tool_error callback method to handle tool errors in the streaming events
libs/core/langchain_core/runnables/schema.py Adds the error field to EventData TypedDict to support error information in streaming events

@mdrxy mdrxy changed the base branch from master to wip-v1.0 September 11, 2025 00:47
@mdrxy mdrxy merged commit 8b1e254 into wip-v1.0 Sep 11, 2025
70 of 73 checks passed
@mdrxy mdrxy deleted the vb/add-on-tool-error branch September 11, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the package `langchain-core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug caused by create_react_agent method and runnable astream_events
5 participants