Skip to content

Fix: LangChain systemPrompt param + add missing @types deps + unblock Python Agent Framework startup#224

Open
Yogeshp-MSFT wants to merge 3 commits intomicrosoft:mainfrom
Yogeshp-MSFT:main
Open

Fix: LangChain systemPrompt param + add missing @types deps + unblock Python Agent Framework startup#224
Yogeshp-MSFT wants to merge 3 commits intomicrosoft:mainfrom
Yogeshp-MSFT:main

Conversation

@Yogeshp-MSFT
Copy link

Issue 1: Nodejs LangChain Quickstart Build Error


Problem
The LangChain Quickstart agent build command displays error due to an incorrect parameter name used in the createAgent API.

In client.ts (line 37), the parameter instructions is passed to createAgent
The LangChain API expects the parameter to be named systemPrompt

This mismatch causes a build error during agent initialization.
Additionally, the package.json file is missing required TypeScript type definitions for Express and Node.js, which results in TypeScript compilation errors.

Fix
Updated the createAgent API call to use systemPrompt instead of instructions
Added the following missing dev dependencies to package.json:

@types/express: ^5.0.6
@types/node: ^25.2.3

Evidence
image
image

Issue 2: Nodejs Devin Sample Build Error


Problem
The Devin sample agent build command reports TypeScript errors due to missing type definitions for Express and Node.js.
The following dev dependencies were not present in the sample’s package.json:

@types/express
@types/node

This results in build‑time errors when running the project.

Fix
Added the required TypeScript type definitions to devDependencies:

@types/express: ^5.0.6
@types/node: ^25.2.3

Evidence
image

Issue 3: Python Agent-framework not running


Problem
The agent-framework-core package exports Agent but does not export ChatAgent.
However, microsoft-agents-a365-tooling-extensions-agentframework expects ChatAgent to exist in the module.
This causes a failure in agent.py at line 40, where the extension attempts to reference/import ChatAgent.

Incorrect constructor argument passed to ChatAgent
The ChatAgent constructor is being called with chat_client instead of the expected parameter name client.

Fix

  • Added a temporary import patch in agent.py to alias Agent as ChatAgent, resolving a mismatch where agent-framework-core does not export ChatAgent but the tooling extension expects it.
  • Fixed an incorrect constructor invocation by renaming the keyword argument from chat_client to client, which was causing TypeError: Agent.init() missing 1 required positional argument: 'client'.
  • These changes unblock agent initialization and allow the Python agent server to start successfully.

Evidence
image
image

Testing


Verified all three samples using Agents Playground.

fixes #221

@Yogeshp-MSFT Yogeshp-MSFT requested a review from a team as a code owner February 18, 2026 10:51
Copilot AI review requested due to automatic review settings February 18, 2026 10:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes critical build and runtime issues in three sample agents caused by API changes in their respective frameworks. The PR addresses a LangChain API parameter name mismatch, adds missing TypeScript type definitions to Node.js samples, and implements a workaround for breaking changes in the Python Agent Framework.

Changes:

  • Fixed LangChain createAgent API call to use systemPrompt instead of incorrect instructions parameter
  • Added missing TypeScript type definitions (@types/express and @types/node) to langchain/quickstart-before and devin samples
  • Implemented import workaround for Python Agent Framework's ChatAgent removal and fixed constructor parameter name

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
nodejs/langchain/quickstart-before/src/client.ts Corrected parameter name from instructions to systemPrompt in createAgent call
nodejs/langchain/quickstart-before/package.json Added @types/express and @types/node devDependencies for TypeScript compilation
nodejs/devin/sample-agent/package.json Added @types/express and @types/node devDependencies for TypeScript compilation
python/agent-framework/sample-agent/agent.py Added ChatAgent import workaround and fixed constructor parameter from chat_client to client

@Yogeshp-MSFT
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python/agent-framework/sample-agent no longer works due to breaking changes in Agent Framework

2 participants