[PR #22046] fix(Agent Node): Thinking model issue - undefined .map error #22011

Open
opened 2025-11-20 06:22:37 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/n8n-io/n8n/pull/22046
Author: @mike12345567
Created: 11/19/2025
Status: 🔄 Open

Base: masterHead: fix-ai-1668-thinking-model-error


📝 Commits (2)

  • 4c05ee0 Fixing an issue that presented with Sonnet 4.5 - models that think were not getting any kind of response which led to issues in future messages to the agent.
  • 930f24c Moving tests into existing file.

📊 Changes

2 files changed (+69 additions, -6 deletions)

View changed files

📝 packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/common.ts (+24 -6)
📝 packages/@n8n/nodes-langchain/nodes/agents/Agent/test/ToolsAgent/commons.test.ts (+45 -0)

📄 Description

Summary

Fixing an issue that presented with Sonnet 4.5 - models that think were not getting any kind of response which led to issues in future messages to the agent.

After researching I found that the issue related to the agent response, if there are thinking messages then it would not record the text based messages, future conversations would pull this from memory and error.

Addresses: https://linear.app/n8n/issue/AI-1668/anthropic-chat-model-says-cannot-read-properties-of-undefined-reading

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

🔄 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/n8n-io/n8n/pull/22046 **Author:** [@mike12345567](https://github.com/mike12345567) **Created:** 11/19/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix-ai-1668-thinking-model-error` --- ### 📝 Commits (2) - [`4c05ee0`](https://github.com/n8n-io/n8n/commit/4c05ee015d203b6fd45cddf4eaa14ab4004faddb) Fixing an issue that presented with Sonnet 4.5 - models that think were not getting any kind of response which led to issues in future messages to the agent. - [`930f24c`](https://github.com/n8n-io/n8n/commit/930f24c0ba653b6502109ed3085dbb747a9cf708) Moving tests into existing file. ### 📊 Changes **2 files changed** (+69 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/common.ts` (+24 -6) 📝 `packages/@n8n/nodes-langchain/nodes/agents/Agent/test/ToolsAgent/commons.test.ts` (+45 -0) </details> ### 📄 Description ## Summary Fixing an issue that presented with Sonnet 4.5 - models that think were not getting any kind of response which led to issues in future messages to the agent. After researching I found that the issue related to the agent response, if there are thinking messages then it would not record the text based messages, future conversations would pull this from memory and error. Addresses: https://linear.app/n8n/issue/AI-1668/anthropic-chat-model-says-cannot-read-properties-of-undefined-reading ## Review / Merge checklist - [ ] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md)) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** --> - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [ ] Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. --> - [ ] PR Labeled with `release/backport` (if the PR is an urgent fix that needs to be backported) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the
pull-request
label 2025-11-20 06:22:38 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/n8n#22011
No description provided.