Skip to content

docs(langgraph): fix inaccurate "Works the same for create_react_agent" comments (7 sites) - #6614

Merged
tylerslaton merged 1 commit into
CopilotKit:mainfrom
adisivaprasad:docs/fix-inaccurate-create-react-agent-comments
Aug 25, 2026
Merged

tylerslaton merged 1 commit into
CopilotKit:mainfrom
adisivaprasad:docs/fix-inaccurate-create-react-agent-comments

Conversation

@adisivaprasad

Copy link
Copy Markdown
Contributor

Closes #6607.

Verified against the pinned langgraph_prebuilt (1.1.0): create_react_agent has neither middleware nor system_prompt parameters, rejects state_schema=CopilotKitState, and is deprecated in favour of langchain.agents.create_agent. Readers following the comment hit an immediate TypeError.

All 7 occurrences on main are 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_agent supersedes the deprecated create_react_agent, which accepts neither middleware= nor system_prompt=”), and the TypeScript snippets now reference createReactAgent (camelCase) instead of the Python create_react_agent name — the second, smaller problem noted in the issue.

…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
@tylerslaton
tylerslaton merged commit 72fcd1d into CopilotKit:main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(langgraph): "Works the same for create_react_agent" comment is inaccurate (7 sites)

2 participants