[PR #362] [MERGED] fix(deepagents): extend BackendFactory and make it async #394

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

📋 Pull Request Information

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

Base: mainHead: cb/fix-backend-factory


📝 Commits (6)

📊 Changes

21 files changed (+316 additions, -363 deletions)

View changed files

.changeset/funny-pears-clap.md (+7 -0)
📝 libs/deepagents/src/agent.ts (+2 -3)
📝 libs/deepagents/src/backends/composite.test.ts (+55 -54)
📝 libs/deepagents/src/backends/index.ts (+2 -1)
📝 libs/deepagents/src/backends/protocol.ts (+35 -4)
📝 libs/deepagents/src/backends/sandbox.test.ts (+2 -2)
📝 libs/deepagents/src/backends/state.test.ts (+27 -27)
📝 libs/deepagents/src/backends/state.ts (+6 -8)
📝 libs/deepagents/src/backends/store.test.ts (+44 -43)
📝 libs/deepagents/src/backends/store.ts (+4 -4)
📝 libs/deepagents/src/index.ts (+2 -0)
📝 libs/deepagents/src/middleware/fs.eviction.test.ts (+10 -10)
📝 libs/deepagents/src/middleware/fs.int.test.ts (+59 -58)
📝 libs/deepagents/src/middleware/fs.test.ts (+8 -8)
📝 libs/deepagents/src/middleware/fs.ts (+28 -75)
📝 libs/deepagents/src/middleware/index.test.ts (+2 -2)
📝 libs/deepagents/src/middleware/memory.ts (+2 -12)
📝 libs/deepagents/src/middleware/skills.ts (+4 -11)
📝 libs/deepagents/src/middleware/summarization.ts (+2 -11)
📝 libs/providers/deno/src/sandbox.test.ts (+9 -6)

...and 1 more files

📄 Description

The BackendFactory is currently very limited as it only passes along state, store and assistantId. This doesn't help to e.g. define a backend based on a specific thread_id and also wouldn't allow to use the store since the factory wouldn't allow async code.

Solution

This patch deprecates the StateAndStore interface and consolidates how we resolve the BackendFactory to include the entire runtime of the agent which mimics Python behavior.


🔄 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/362 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 3/24/2026 **Status:** ✅ Merged **Merged:** 3/25/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/fix-backend-factory` --- ### 📝 Commits (6) - [`16e3f6d`](https://github.com/langchain-ai/deepagentsjs/commit/16e3f6df4001384caf860d562a3f1bfac60e0204) fix(deepagents): extend BackendFactory and make it async - [`8a1a463`](https://github.com/langchain-ai/deepagentsjs/commit/8a1a4631a904b540093ec768ad6044c31d34bcd9) revert changes in old store - [`b0364eb`](https://github.com/langchain-ai/deepagentsjs/commit/b0364ebb60b0cc3636aee0622ce09d21c9860c4f) Create funny-pears-clap.md - [`055434b`](https://github.com/langchain-ai/deepagentsjs/commit/055434b3feea072dbdd98495e8a2f9c70a372218) cr - [`b7c67de`](https://github.com/langchain-ai/deepagentsjs/commit/b7c67de1e12974b51a14777c5cd67f1736075518) cr - [`0f70a77`](https://github.com/langchain-ai/deepagentsjs/commit/0f70a77d35de102120acea07e7c2c7a26c1710e7) cr ### 📊 Changes **21 files changed** (+316 additions, -363 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/funny-pears-clap.md` (+7 -0) 📝 `libs/deepagents/src/agent.ts` (+2 -3) 📝 `libs/deepagents/src/backends/composite.test.ts` (+55 -54) 📝 `libs/deepagents/src/backends/index.ts` (+2 -1) 📝 `libs/deepagents/src/backends/protocol.ts` (+35 -4) 📝 `libs/deepagents/src/backends/sandbox.test.ts` (+2 -2) 📝 `libs/deepagents/src/backends/state.test.ts` (+27 -27) 📝 `libs/deepagents/src/backends/state.ts` (+6 -8) 📝 `libs/deepagents/src/backends/store.test.ts` (+44 -43) 📝 `libs/deepagents/src/backends/store.ts` (+4 -4) 📝 `libs/deepagents/src/index.ts` (+2 -0) 📝 `libs/deepagents/src/middleware/fs.eviction.test.ts` (+10 -10) 📝 `libs/deepagents/src/middleware/fs.int.test.ts` (+59 -58) 📝 `libs/deepagents/src/middleware/fs.test.ts` (+8 -8) 📝 `libs/deepagents/src/middleware/fs.ts` (+28 -75) 📝 `libs/deepagents/src/middleware/index.test.ts` (+2 -2) 📝 `libs/deepagents/src/middleware/memory.ts` (+2 -12) 📝 `libs/deepagents/src/middleware/skills.ts` (+4 -11) 📝 `libs/deepagents/src/middleware/summarization.ts` (+2 -11) 📝 `libs/providers/deno/src/sandbox.test.ts` (+9 -6) _...and 1 more files_ </details> ### 📄 Description The `BackendFactory` is currently very limited as it only passes along `state`, `store` and `assistantId`. This doesn't help to e.g. define a backend based on a specific `thread_id` and also wouldn't allow to use the store since the factory wouldn't allow async code. ## Solution This patch deprecates the `StateAndStore` interface and consolidates how we resolve the `BackendFactory` to include the entire runtime of the agent which mimics Python behavior. --- <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:55 -04:00
yindo closed this issue 2026-06-05 17:22:55 -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#394