@ai-sdk/langchain HITL interrupt fails to match tool calls in dual streamMode

I found a bug in @ai-sdk/langchain when using streamMode: ["messages", "values"] with LangGraph’s HITL (Human-in-the-Loop) interrupt().

The problem: Tool calls emitted via messages stream are added to emittedToolCalls but not to emittedToolCallsByKey. When the __interrupt__ handler tries to match by key, it fails and generates a fallback ID — causing orphaned approval cards in the UI.

I’ve submitted an issue and a PR with a fix and tests. The fix is a 5-line else-if branch that registers the key mapping for tool calls already emitted via messages mode.

Would appreciate any feedback or a review. Thanks!

Thanks so much for the detailed bug report and the PR, really appreciate you taking the time to track this down and contribute a fix for the @ai-sdk/langchain HITL issue! :folded_hands:

The team will review your PR and get back to you soon. This kind of community contribution is exactly what helps make the SDK better for everyone.

I’ll loop back once there’s movement on the PR. Thanks again for jumping in! :flexed_biceps: