[PR #393] [MERGED] fix(deepagents): align prompt templates with runtime behavior #422

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/393
Author: @hntrl
Created: 3/30/2026
Status: Merged
Merged: 4/1/2026
Merged by: @hntrl

Base: alphaHead: hunter/align-prompts


📝 Commits (2)

  • bf62dd3 fix(deepagents): align prompt templates with runtime behavior
  • d601a4a chore: add changeset for prompt alignment fixes

📊 Changes

7 files changed (+379 additions, -331 deletions)

View changed files

.changeset/tame-ladybugs-sleep.md (+9 -0)
📝 libs/deepagents/src/backends/utils.ts (+1 -1)
📝 libs/deepagents/src/middleware/fs.ts (+154 -125)
📝 libs/deepagents/src/middleware/memory.ts (+62 -59)
📝 libs/deepagents/src/middleware/skills.ts (+2 -2)
📝 libs/deepagents/src/middleware/subagents.ts (+142 -138)
📝 libs/deepagents/src/middleware/summarization.ts (+9 -6)

📄 Description

Summary

This updates deepagents middleware prompt text to better match current runtime behavior and improve parity with Python guidance. It also removes stale hardcoded values by sourcing read-file line splitting guidance directly from the shared runtime constant.

Changes

  • In libs/deepagents/src/middleware/fs.ts, switched filesystem/tool prompt strings to context templates, added the "Following Conventions" section, and rendered the long-line read guidance from MAX_LINE_LENGTH using formatted interpolation instead of a hardcoded number.
  • In libs/deepagents/src/backends/utils.ts, updated MAX_LINE_LENGTH to 5000 so prompt docs and runtime line-chunking behavior stay aligned via a single source of truth.
  • In libs/deepagents/src/middleware/skills.ts, removed Python-specific wording in skill docs so guidance is language-agnostic.
  • In libs/deepagents/src/middleware/memory.ts, libs/deepagents/src/middleware/subagents.ts, and libs/deepagents/src/middleware/summarization.ts, moved large prompt/message literals to context templates for consistent formatting and interpolation 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/393 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 3/30/2026 **Status:** ✅ Merged **Merged:** 4/1/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `alpha` ← **Head:** `hunter/align-prompts` --- ### 📝 Commits (2) - [`bf62dd3`](https://github.com/langchain-ai/deepagentsjs/commit/bf62dd39a89276fe3690fc57f1aeaed7b5db6295) fix(deepagents): align prompt templates with runtime behavior - [`d601a4a`](https://github.com/langchain-ai/deepagentsjs/commit/d601a4aeea21e249055fa1f6d763359070177a60) chore: add changeset for prompt alignment fixes ### 📊 Changes **7 files changed** (+379 additions, -331 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/tame-ladybugs-sleep.md` (+9 -0) 📝 `libs/deepagents/src/backends/utils.ts` (+1 -1) 📝 `libs/deepagents/src/middleware/fs.ts` (+154 -125) 📝 `libs/deepagents/src/middleware/memory.ts` (+62 -59) 📝 `libs/deepagents/src/middleware/skills.ts` (+2 -2) 📝 `libs/deepagents/src/middleware/subagents.ts` (+142 -138) 📝 `libs/deepagents/src/middleware/summarization.ts` (+9 -6) </details> ### 📄 Description ## Summary This updates deepagents middleware prompt text to better match current runtime behavior and improve parity with Python guidance. It also removes stale hardcoded values by sourcing read-file line splitting guidance directly from the shared runtime constant. ## Changes - In `libs/deepagents/src/middleware/fs.ts`, switched filesystem/tool prompt strings to `context` templates, added the "Following Conventions" section, and rendered the long-line read guidance from `MAX_LINE_LENGTH` using formatted interpolation instead of a hardcoded number. - In `libs/deepagents/src/backends/utils.ts`, updated `MAX_LINE_LENGTH` to `5000` so prompt docs and runtime line-chunking behavior stay aligned via a single source of truth. - In `libs/deepagents/src/middleware/skills.ts`, removed Python-specific wording in skill docs so guidance is language-agnostic. - In `libs/deepagents/src/middleware/memory.ts`, `libs/deepagents/src/middleware/subagents.ts`, and `libs/deepagents/src/middleware/summarization.ts`, moved large prompt/message literals to `context` templates for consistent formatting and interpolation 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:23:01 -04:00
yindo closed this issue 2026-06-05 17:23:01 -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#422