Repository navigation
docs(langgraph): fix inaccurate "Works the same for create_react_agent" comments (7 sites) - #6614
Merged
tylerslaton merged 1 commit intoAug 25, 2026
Conversation
…t" comments Swapping the create_agent factory for create_react_agent (langgraph.prebuilt) does not work: create_react_agent has no middleware= or system_prompt= parameter and rejects state_schema=CopilotKitState, so following the comment raises TypeError. It is also deprecated in favour of langchain.agents.create_agent. Replace the misleading inline comment with an accurate note at all 7 sites (supersedes the deprecated factory; accepts neither middleware= nor system_prompt=), and fix the TypeScript snippets to reference createReactAgent instead of the Python snake_case name. Closes CopilotKit#6607
adisivaprasad
requested review from
jpr5,
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
August 20, 2026 21:14
This was referenced Aug 21, 2026
tylerslaton
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6607.
Verified against the pinned
langgraph_prebuilt(1.1.0):create_react_agenthas neithermiddlewarenorsystem_promptparameters, rejectsstate_schema=CopilotKitState, and is deprecated in favour oflangchain.agents.create_agent. Readers following the comment hit an immediateTypeError.All 7 occurrences on
mainare updated (4 sites noted in the issue plus the 3 that landed with #5469):showcase/shell-docs/src/content/docs/integrations/langgraph/agent-app-context.mdx(Python + TypeScript)showcase/shell-docs/src/content/docs/integrations/langgraph/frontend-tools.mdx(Python + TypeScript)showcase/shell-docs/src/content/snippets/integrations/langgraph/frontend-tools.mdx(Python + TypeScript)showcase/shell-docs/src/content/reference/hooks/useFrontendTool.mdx(Python)Each comment is replaced with an accurate note (”
create_agentsupersedes the deprecatedcreate_react_agent, which accepts neithermiddleware=norsystem_prompt=”), and the TypeScript snippets now referencecreateReactAgent(camelCase) instead of the Pythoncreate_react_agentname — the second, smaller problem noted in the issue.