fix: Support 'args' key in response tool call argument extraction#138
Conversation
Some frameworks (e.g. LangGraph Python) return tool calls with an 'args' key instead of 'arguments'. Add 'args' as a fallback in checkResponseToolCalls so these tool calls are validated correctly. Refs PY-2281 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🔴 AI SDK Integration Test ResultsStatus: 8 regressions detected Summary
🔴 RegressionsThese tests were passing on main but are now failing: cloudflare/langchain :: Basic LLM Test (blocking)Error: Test execution failed: Wrangler exited with code 1 cloudflare/langchain :: Multi-Turn LLM Test (blocking)Error: Test execution failed: Wrangler exited with code 1 cloudflare/langchain :: Basic Error LLM Test (blocking)Error: Test execution failed: Wrangler exited with code 1 cloudflare/langchain :: Vision LLM Test (blocking)Error: Test execution failed: Wrangler exited with code 1 python/google-genai :: Basic LLM Test (sync, blocking)Error: 2 check(s) failed: python/fastmcp :: MCP Resource Read Test (async, blocking, sse)Error: Test execution failed: Command failed: /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/fastmcp-mcp-2.3.4-sentry-latest/.venv/bin/python /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/fastmcp-mcp-2.3.4-sentry-latest/test-mcp-resource-read-test-async-blocking-sse.py python/mcp :: MCP Multiple Tool Calls Test (async, blocking, sse, highlevel)Error: Test execution failed: Command failed: /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/mcp-mcp-1.9.4-sentry-latest/.venv/bin/python /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/mcp-mcp-1.9.4-sentry-latest/test-mcp-multiple-tool-calls-test-async-blocking-sse-highlevel.py python/mcp :: MCP Resource Read Test (async, blocking, sse, highlevel)Error: Test execution failed: Command failed: /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/mcp-mcp-1.9.4-sentry-latest/.venv/bin/python /home/runner/work/testing-ai-sdk-integrations/testing-ai-sdk-integrations/runs/python/mcp-mcp-1.9.4-sentry-latest/test-mcp-resource-read-test-async-blocking-sse-highlevel.py ✅ FixedThese tests were failing on main but are now passing:
Test MatrixAgent Tests
Embedding Tests
LLM Tests
MCP Tests
Legend: ✅ Pass | ❌ Fail | ✅🔧 Fixed | ❌📉 Regressed | ✅🆕 New (pass) | ❌🆕 New (fail) | 🗑️ Removed | str=streaming blk=blocking a=async s=sync io=stdio sse=sse hi=highlevel lo=lowlevel Generated by AI SDK Integration Tests |
|
We the same issue for JS langgraph. My suggestion would have been to align in the SDK. EDIT: we decided to do this anyways |
Add
foundCall.argsas a fallback when extracting arguments from toolcall response data in
checkResponseToolCalls.Some frameworks (e.g. LangGraph Python) return tool calls with an
argskey rather than
arguments:{"name": "read_file", "args": {"path": "/nonexistent/file.txt"}, "id": "call_...", "type": "tool_call"}The lookup chain is now:
arguments→args→function.arguments.Fixes PY-2281