[PR #3399] fix: use dataclass/zod for runtime context schema instead of plain dict [closes DOC-951] #3453

Open
opened 2026-06-05 18:23:10 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3399
Author: @open-swe[bot]
Created: 4/1/2026
Status: 🔄 Open

Base: mainHead: open-swe/b6691feb-f3cb-78b3-5d08-aa38f4a0d723


📝 Commits (1)

  • 69ffef2 fix: use dataclass/ToolRuntime for runtime context docs instead of plain dict/config

📊 Changes

2 files changed (+98 additions, -78 deletions)

View changed files

📝 src/oss/deepagents/context-engineering.mdx (+29 -19)
📝 src/oss/deepagents/subagents.mdx (+69 -59)

📄 Description

Description

Fixes runtime context docs to use the correct API patterns: @dataclass (Python) / Zod schema (TypeScript) for context_schema, context=Context(...) keyword arg for passing context at invoke time, and ToolRuntime for accessing context in tools. The previous examples incorrectly used plain dicts for context_schema, config={"context": {...}} for passing, and config.get("context") for access — which was a common source of confusion.

Resolves DOC-951

Test Plan

Opened collaboratively by Naomi Pentrel and open-swe.


🔄 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/3399 **Author:** [@open-swe[bot]](https://github.com/apps/open-swe) **Created:** 4/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `open-swe/b6691feb-f3cb-78b3-5d08-aa38f4a0d723` --- ### 📝 Commits (1) - [`69ffef2`](https://github.com/langchain-ai/docs/commit/69ffef2c6ccbf969087914d40b5730c6ec84264a) fix: use dataclass/ToolRuntime for runtime context docs instead of plain dict/config ### 📊 Changes **2 files changed** (+98 additions, -78 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/deepagents/context-engineering.mdx` (+29 -19) 📝 `src/oss/deepagents/subagents.mdx` (+69 -59) </details> ### 📄 Description ## Description Fixes runtime context docs to use the correct API patterns: `@dataclass` (Python) / Zod schema (TypeScript) for `context_schema`, `context=Context(...)` keyword arg for passing context at invoke time, and `ToolRuntime` for accessing context in tools. The previous examples incorrectly used plain dicts for `context_schema`, `config={"context": {...}}` for passing, and `config.get("context")` for access — which was a common source of confusion. Resolves DOC-951 ## Test Plan - [ ] Verify runtime context section renders correctly on https://docs.langchain.com/oss/python/deepagents/context-engineering#runtime-context - [ ] Verify subagents context management section renders correctly on https://docs.langchain.com/oss/python/deepagents/subagents#context-management _Opened collaboratively by Naomi Pentrel and open-swe._ --- <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 18:23:10 -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#3453