Skip to content

fix(langgraph): Ignore GraphBubbleUp exceptions#6608

Open
alexander-alderman-webb wants to merge 2 commits into
masterfrom
webb/langgraph/ignore-graph-bubble-up
Open

fix(langgraph): Ignore GraphBubbleUp exceptions#6608
alexander-alderman-webb wants to merge 2 commits into
masterfrom
webb/langgraph/ignore-graph-bubble-up

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Close the active span without setting an error status and do not capture an exception if GraphBubbleUp is handled. The exception is a LangGraph control-flow type.

Since the error hooks live on the LangChain layer, add a private set that the LangGraph integration uses to inform the LangChain integration that GraphBubbleUp should be ignored. This prevents semantics from the LangGraph library leaking into the LangChain integration.

Issues

Closes #6384

Reminders

Comment thread sentry_sdk/integrations/langchain.py
Comment thread tests/integrations/langgraph/test_langgraph.py
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

90832 passed | ⏭️ 6129 skipped | Total: 96961 | Pass Rate: 93.68% | Execution Time: 331m 52s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +6
Passed Tests 📈 +6
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2404 uncovered lines.
✅ Project coverage is 89.88%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.85%    89.88%    +0.03%
==========================================
  Files          192       192         —
  Lines        23745     23752        +7
  Branches      8198      8200        +2
==========================================
+ Hits         21334     21348       +14
- Misses        2411      2404        -7
- Partials      1344      1344         —

Generated by Codecov Action

@ericapisani ericapisani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

self._exit_span(span, run_id)

def _handle_error(self, run_id: "UUID", error: "Any") -> None:
is_ignored = isinstance(error, tuple(LangchainIntegration._ignored_exceptions))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While this achieves what we want, a more concise way that this can be written is:

Suggested change
is_ignored = isinstance(error, tuple(LangchainIntegration._ignored_exceptions))
is_ignored = type(error) in LangchainIntegration._ignored_exceptions

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.

LangchainIntegration reports GraphInterrupt / GraphBubbleUp as errors via on_tool_error

2 participants