Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Fix memory issue with empty model response #11300

Conversation

burivuhster
Copy link
Contributor

@burivuhster burivuhster commented Oct 17, 2024

Summary

This PR addresses the issue with memory sub-nodes. In some cases model may respond with an empty string. LangChain's memory code throws an exception, while trying to save this to a message history, because it uses coercion to boolean.

The problematic line of code is here:
https://github.com/langchain-ai/langchainjs/blob/c9b80263a0777c39d5bdaa30728715c5e124f55e/langchain-core/src/memory.ts#L93

This affects all memory nodes.

The proper solution would be to fix this in the LangChain, but as a temporary fix we may just use a patch.

Related Linear tickets, Github issues, and Community forum posts

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)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Oct 17, 2024
Copy link

cypress bot commented Oct 22, 2024

n8n    Run #7473

Run Properties:  status check passed Passed #7473  •  git commit d891291dea: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Project n8n
Branch Review ai-395-community-issue-ai-agent-output-after-execution-is-empty-i
Run status status check passed Passed #7473
Run duration 04m 20s
Commit git commit d891291dea: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Committer Eugene Molodkin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 453
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@burivuhster burivuhster merged commit 216b119 into master Oct 22, 2024
34 checks passed
@burivuhster burivuhster deleted the ai-395-community-issue-ai-agent-output-after-execution-is-empty-i branch October 22, 2024 13:08
@takefy-dev
Copy link

hey when it's push to production ?

@janober
Copy link
Member

janober commented Oct 24, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants