[PR #357] [MERGED] fix(deepagents): evict large HumanMessages to filesystem #389

Closed
opened 2026-06-05 17:22:54 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/357
Author: @christian-bromann
Created: 3/24/2026
Status: Merged
Merged: 3/29/2026
Merged by: @christian-bromann

Base: mainHead: cb/deepagents-pr-2183-js-26c1


📝 Commits (7)

  • 772f311 feat(sdk): evict large HumanMessages to filesystem
  • f7c5b15 format
  • b5766f0 Create angry-jobs-film.md
  • f383531 refactor: align with final Python PR - tag-based eviction architecture
  • cb4812a format
  • 5c1512a Merge branch 'main' into cb/deepagents-pr-2183-js-26c1
  • 7e27564 fix: update beforeAgent to use resolveBackend after main merge

📊 Changes

3 files changed (+653 additions, -2 deletions)

View changed files

.changeset/angry-jobs-film.md (+5 -0)
📝 libs/deepagents/src/middleware/fs.test.ts (+473 -1)
📝 libs/deepagents/src/middleware/fs.ts (+175 -1)

📄 Description

Port of python PR langchain-ai/deepagents#2183 to JS. Adds a beforeAgent hook to the FilesystemMiddleware that checks the most recent message. If it is a HumanMessage whose text content exceeds toolTokenLimitBeforeEvict, the full content is written to the backend and the message is replaced with a truncated preview pointing to the file.


🔄 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/357 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 3/24/2026 **Status:** ✅ Merged **Merged:** 3/29/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/deepagents-pr-2183-js-26c1` --- ### 📝 Commits (7) - [`772f311`](https://github.com/langchain-ai/deepagentsjs/commit/772f311d354a134c6342fae562ff9d4ab713836d) feat(sdk): evict large HumanMessages to filesystem - [`f7c5b15`](https://github.com/langchain-ai/deepagentsjs/commit/f7c5b15707472066c4a47db06d2fc129054a2551) format - [`b5766f0`](https://github.com/langchain-ai/deepagentsjs/commit/b5766f0568e29c65e43bbeeb377cf970e5fb7cd0) Create angry-jobs-film.md - [`f383531`](https://github.com/langchain-ai/deepagentsjs/commit/f3835314538839d73340407aef3d31cdeba966cd) refactor: align with final Python PR - tag-based eviction architecture - [`cb4812a`](https://github.com/langchain-ai/deepagentsjs/commit/cb4812a990eddb8f6786846834f84e4e45d5a440) format - [`5c1512a`](https://github.com/langchain-ai/deepagentsjs/commit/5c1512ae04c42b27c94290f98e0c9f6576df00a8) Merge branch 'main' into cb/deepagents-pr-2183-js-26c1 - [`7e27564`](https://github.com/langchain-ai/deepagentsjs/commit/7e27564836ed7719723c8a0fb22a8440fdb1135a) fix: update beforeAgent to use resolveBackend after main merge ### 📊 Changes **3 files changed** (+653 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/angry-jobs-film.md` (+5 -0) 📝 `libs/deepagents/src/middleware/fs.test.ts` (+473 -1) 📝 `libs/deepagents/src/middleware/fs.ts` (+175 -1) </details> ### 📄 Description Port of python PR langchain-ai/deepagents#2183 to JS. Adds a beforeAgent hook to the FilesystemMiddleware that checks the most recent message. If it is a HumanMessage whose text content exceeds toolTokenLimitBeforeEvict, the full content is written to the backend and the message is replaced with a truncated preview pointing to the file. --- <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-06-05 17:22:54 -04:00
yindo closed this issue 2026-06-05 17:22:54 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#389