[PR #1876] [MERGED] JS: update typescript custom middleware beforeModel examples t… #1932

Closed
opened 2026-02-17 17:22:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1876
Author: @errdefer
Created: 12/12/2025
Status: Merged
Merged: 1/26/2026
Merged by: @christian-bromann

Base: mainHead: patch-2


📝 Commits (1)

  • 4a5664b fix(docs): update typescript custom middleware beforeModel examples to include canJumpTo

📊 Changes

1 file changed (+19 additions, -12 deletions)

View changed files

📝 src/oss/langchain/middleware/custom.mdx (+19 -12)

📄 Description

Overview

Updates the TypeScript custom middleware documentation to correctly include the canJumpTo configuration when using jumpTo inside beforeModel. Without declaring canJumpTo, the documented examples would throw an error at runtime when a jump was attempted. This change aligns the examples with the current middleware API and prevents both runtime and TypeScript typing errors when conditionally terminating execution.

Type of change

Type: Fix typo/bug/link/formatting

Related issues/PRs

GitHub issue: N/A
Feature PR: N/A

  • Linear issue:
  • Slack thread:

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

(Internal team members only / optional): Create a preview deployment as necessary using the Create Preview Branch workflow

Additional notes

This change updates the same fix in multiple locations to ensure consistency across the documentation and reduce confusion for users implementing custom middleware in TypeScript.


🔄 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/docs/pull/1876 **Author:** [@errdefer](https://github.com/errdefer) **Created:** 12/12/2025 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `patch-2` --- ### 📝 Commits (1) - [`4a5664b`](https://github.com/langchain-ai/docs/commit/4a5664b0ea6893e6a8b36ccea6bea4415106e1a4) fix(docs): update typescript custom middleware beforeModel examples to include canJumpTo ### 📊 Changes **1 file changed** (+19 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/middleware/custom.mdx` (+19 -12) </details> ### 📄 Description ## Overview Updates the TypeScript custom middleware documentation to correctly include the `canJumpTo` configuration when using `jumpTo` inside `beforeModel`. Without declaring `canJumpTo`, the documented examples would throw an error at runtime when a jump was attempted. This change aligns the examples with the current middleware API and prevents both runtime and TypeScript typing errors when conditionally terminating execution. ## Type of change **Type:** Fix typo/bug/link/formatting ## Related issues/PRs GitHub issue: N/A Feature PR: N/A <!-- For LangChain employees, if applicable: --> - Linear issue: - Slack thread: ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [x] I have updated navigation in `src/docs.json` if needed (Internal team members only / optional): Create a preview deployment as necessary using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes This change updates the same fix in multiple locations to ensure consistency across the documentation and reduce confusion for users implementing custom middleware in TypeScript. --- <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-17 17:22:53 -05:00
yindo closed this issue 2026-02-17 17:22:53 -05:00
yindo changed title from [PR #1876] JS: update typescript custom middleware beforeModel examples t… to [PR #1876] [MERGED] JS: update typescript custom middleware beforeModel examples t… 2026-06-05 18:15:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1932