[PR #84] [CLOSED] feat: support SystemMessage for systemPrompt parameter #106

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/84
Author: @ps06756
Created: 12/26/2025
Status: Closed

Base: mainHead: feat/system-message-support


📝 Commits (1)

  • 45a5765 feat: support SystemMessage for systemPrompt parameter

📊 Changes

2 files changed (+33 additions, -10 deletions)

View changed files

📝 src/agent.ts (+15 -9)
📝 tests/integration/deepagents.test.ts (+18 -1)

📄 Description

Summary

  • Allow createDeepAgent() to accept SystemMessage objects in addition to strings for the systemPrompt parameter
  • Aligns with the capability already available in langchain's createAgent()
  • Enables cleaner integration for projects that model system prompts as structured SystemMessage objects

Closes #83

Changes

  1. Import SystemMessage from @langchain/core/messages
  2. Update systemPrompt type in CreateDeepAgentParams interface to string | SystemMessage
  3. Add logic to extract content from SystemMessage if provided
  4. Add tests for both string and SystemMessage system prompts

Test plan

  • Added unit tests for string systemPrompt
  • Added unit tests for SystemMessage systemPrompt
  • Note: Existing test failures are due to a known upstream bug (Issue #75) unrelated to this PR

🔄 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/84 **Author:** [@ps06756](https://github.com/ps06756) **Created:** 12/26/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/system-message-support` --- ### 📝 Commits (1) - [`45a5765`](https://github.com/langchain-ai/deepagentsjs/commit/45a576532fe55d76a5c55cf2c8eaccabc03a04ae) feat: support SystemMessage for systemPrompt parameter ### 📊 Changes **2 files changed** (+33 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/agent.ts` (+15 -9) 📝 `tests/integration/deepagents.test.ts` (+18 -1) </details> ### 📄 Description ## Summary - Allow `createDeepAgent()` to accept `SystemMessage` objects in addition to strings for the `systemPrompt` parameter - Aligns with the capability already available in langchain's `createAgent()` - Enables cleaner integration for projects that model system prompts as structured `SystemMessage` objects Closes #83 ## Changes 1. Import `SystemMessage` from `@langchain/core/messages` 2. Update `systemPrompt` type in `CreateDeepAgentParams` interface to `string | SystemMessage` 3. Add logic to extract content from `SystemMessage` if provided 4. Add tests for both string and `SystemMessage` system prompts ## Test plan - [x] Added unit tests for string systemPrompt - [x] Added unit tests for SystemMessage systemPrompt - [ ] Note: Existing test failures are due to a known upstream bug (Issue #75) unrelated to this PR --- <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:10 -05:00
yindo closed this issue 2026-02-16 06:17:10 -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#106