[PR #168] [MERGED] test: add unit tests for createPatchToolCallsMiddleware #172

Closed
opened 2026-02-16 06:17:20 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/168
Author: @JadenKim-dev
Created: 2/2/2026
Status: Merged
Merged: 2/2/2026
Merged by: @christian-bromann

Base: mainHead: add-middleware-test


📝 Commits (1)

  • 5b777ac test(deepagents): add unit tests for createPatchToolCallsMiddleware

📊 Changes

1 file changed (+207 additions, -0 deletions)

View changed files

libs/deepagents/src/middleware/patch_tool_calls.test.ts (+207 -0)

📄 Description

This PR adds test coverage for the patch tool calls middleware, validating its ability to detect dangling tool calls and inject synthetic ToolMessages.

Tests cover...

  • basic functionality
  • mixed scenarios with partial responses
  • edge cases including empty tool_calls arrays and multiple AI messages.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/168 **Author:** [@JadenKim-dev](https://github.com/JadenKim-dev) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `add-middleware-test` --- ### 📝 Commits (1) - [`5b777ac`](https://github.com/langchain-ai/deepagentsjs/commit/5b777accb9ebd7e070984fdb91c6294ddf330f18) test(deepagents): add unit tests for createPatchToolCallsMiddleware ### 📊 Changes **1 file changed** (+207 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `libs/deepagents/src/middleware/patch_tool_calls.test.ts` (+207 -0) </details> ### 📄 Description This PR adds test coverage for the patch tool calls middleware, validating its ability to detect dangling tool calls and inject synthetic ToolMessages. Tests cover... - basic functionality - mixed scenarios with partial responses - edge cases including empty tool_calls arrays and multiple AI messages. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 06:17:20 -05:00
yindo closed this issue 2026-02-16 06:17:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#172