[PR #101] [CLOSED] fix(deepagent): properly derrive types from createDeepAgent input #119

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/101
Author: @christian-bromann
Created: 1/9/2026
Status: Closed

Base: mainHead: cb/derriving-types


📝 Commits (1)

  • 017978f fix(deepagent): properly derrive types from createDeepAgent input

📊 Changes

2 files changed (+27 additions, -12 deletions)

View changed files

📝 libs/deepagents/src/agent.ts (+26 -11)
📝 package.json (+1 -1)

📄 Description

If a developer passes in custom middleware or response format into createDeepAgent the types should properly propagate to the createAgent instance so that the return values from invoke are the same as createAgent. For example:

const agent = createDeepAgent({
  tools: [sampleTool],
  subagents,
  middleware: [ResearchMiddleware],
});
assertAllDeepAgentQualities(agent);
expect(agent.graph.streamChannels).toContain("research");

const result = await agent.invoke(
  {
    messages: [
      new HumanMessage("Get surface level info on lebron james"),
    ],
  },
  { recursionLimit: 100 },
);

result.research // <-- should have proper types

🔄 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/101 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 1/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `cb/derriving-types` --- ### 📝 Commits (1) - [`017978f`](https://github.com/langchain-ai/deepagentsjs/commit/017978f33947668977ac6fca7c497b9fb068d0e9) fix(deepagent): properly derrive types from createDeepAgent input ### 📊 Changes **2 files changed** (+27 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/agent.ts` (+26 -11) 📝 `package.json` (+1 -1) </details> ### 📄 Description If a developer passes in custom middleware or response format into `createDeepAgent` the types should properly propagate to the `createAgent` instance so that the return values from `invoke` are the same as `createAgent`. For example: ```ts const agent = createDeepAgent({ tools: [sampleTool], subagents, middleware: [ResearchMiddleware], }); assertAllDeepAgentQualities(agent); expect(agent.graph.streamChannels).toContain("research"); const result = await agent.invoke( { messages: [ new HumanMessage("Get surface level info on lebron james"), ], }, { recursionLimit: 100 }, ); result.research // <-- should have proper types ``` --- <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:13 -05:00
yindo closed this issue 2026-02-16 06:17:13 -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#119