-
Notifications
You must be signed in to change notification settings - Fork 4.2k
langchain-quickjs: nested Pydantic schemas render as unknown in PTC signatures #6459
Copy link
Copy link
Open
Labels
integration:quickjsIntegration with the QuickJS sandbox package.Integration with the QuickJS sandbox package.org:externalIssue or pull request created by someone outside the `langchain-ai` GitHub organization.Issue or pull request created by someone outside the `langchain-ai` GitHub organization.priority:backlogNot currently planned/prioritized work, often affecting a limited feature or set of users.Not currently planned/prioritized work, often affecting a limited feature or set of users.topic:code-interpreterQuickJS and code interpreter middleware.QuickJS and code interpreter middleware.topic:modelsModel providers, model selection, and model configuration.Model providers, model selection, and model configuration.type:bugAn unexpected problem or incorrect behavior.An unexpected problem or incorrect behavior.
Description
Activity
Metadata
Metadata
Assignees
Labels
integration:quickjsIntegration with the QuickJS sandbox package.Integration with the QuickJS sandbox package.org:externalIssue or pull request created by someone outside the `langchain-ai` GitHub organization.Issue or pull request created by someone outside the `langchain-ai` GitHub organization.priority:backlogNot currently planned/prioritized work, often affecting a limited feature or set of users.Not currently planned/prioritized work, often affecting a limited feature or set of users.topic:code-interpreterQuickJS and code interpreter middleware.QuickJS and code interpreter middleware.topic:modelsModel providers, model selection, and model configuration.Model providers, model selection, and model configuration.type:bugAn unexpected problem or incorrect behavior.An unexpected problem or incorrect behavior.
Submission checklist
Area (Required)
Related Issues / PRs
PR #3210,
feat(quickjs): propagate return types, introduced return-type rendering but did not resolve compound schema references.Reproduction Steps / Example Code (Python)
Error Message and Stack Trace (if applicable)
Description
langchain-quickjslets an agent call Python tools from JavaScript. It generates a TypeScript-style API reference so the agent knows each tool's expected inputs and outputs.When a tool uses nested Pydantic models, the generated reference loses their structure. In the reproduction provided, a tool accepting
list[User], where eachUsercontains anAddress, is currently shown as:It should be shown as:
The JavaScript runtime can already transport these nested values. The problem is only in the generated API reference. Pydantic stores nested definitions using JSON Schema
$defsand$ref, but the current renderer does not resolve those references and therefore falls back tounknown.A minimal fix is to run input and return schemas through LangChain Core's existing
dereference_refsutility before rendering them. This requires no new dependency or public API change and supports nested and inherited Pydantic models.If this approach is acceptable, please assign this issue to me. I have a focused implementation and regression tests ready to submit.
Environment / System Info
OS: Linux x86_64
Python: 3.13.5
deepagents: 0.7.16
langchain: 1.4.2
langchain-core: 1.6.3
langchain-quickjs: 0.3.7
quickjs-rs: 0.2.5
Relevant environment variables: None
Date verified: September 21, 2026