Fix: LangChain systemPrompt param + add missing @types deps + unblock Python Agent Framework startup#224
Open
Yogeshp-MSFT wants to merge 3 commits intomicrosoft:mainfrom
Open
Fix: LangChain systemPrompt param + add missing @types deps + unblock Python Agent Framework startup#224Yogeshp-MSFT wants to merge 3 commits intomicrosoft:mainfrom
Yogeshp-MSFT wants to merge 3 commits intomicrosoft:mainfrom
Conversation
… agent.py for improved agent initialization
Contributor
There was a problem hiding this comment.
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
createAgentAPI call to usesystemPromptinstead of incorrectinstructionsparameter - 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 |
Add temporary compatibility workaround for ChatAgent import.
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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


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

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
Evidence


Testing
Verified all three samples using Agents Playground.
fixes #221