test(langchain): Add tool execution test#5739
test(langchain): Add tool execution test#5739alexander-alderman-webb wants to merge 6 commits intowebb/langchain/add-basic-testfrom
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Other
Documentation 📚
Internal Changes 🔧Langchain
Other
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 98 passed | ⏭️ 1 skipped | Total: 99 | Pass Rate: 98.99% | Execution Time: 43.68s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 14087 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 27.22% 31.67% +4.45%
==========================================
Files 189 189 —
Lines 20616 20616 —
Branches 6738 6738 —
==========================================
+ Hits 5611 6529 +918
- Misses 15005 14087 -918
- Partials 491 534 +43Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Redundant assertion contradicts comment and prior assertion
- I removed the contradictory comment and the redundant weaker assertion because the existing exact-count assertion already covers this condition.
Or push these changes by commenting:
@cursor push f520920c95
Preview (f520920c95)
diff --git a/tests/integrations/langchain/test_langchain.py b/tests/integrations/langchain/test_langchain.py
--- a/tests/integrations/langchain/test_langchain.py
+++ b/tests/integrations/langchain/test_langchain.py
@@ -336,9 +336,6 @@
assert chat_spans[1]["origin"] == "auto.ai.langchain"
assert tool_exec_span["origin"] == "auto.ai.langchain"
- # We can't guarantee anything about the "shape" of the langchain execution graph
- assert len(list(x for x in tx["spans"] if x["op"] == "gen_ai.chat")) > 0
-
# Token usage is only available in newer versions of langchain (v0.2+)
# where usage_metadata is supported on AIMessageChunk
if "gen_ai.usage.input_tokens" in chat_spans[0]["data"]:This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.


Description
Add a test that uses
langchainfunctionality introduced in v1.0 of the library.Re-use Responses API response with a tool call request from
openai-agentstest.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)