Repository navigation
fix(examples): import LangGraphAgent from the langgraph subpath - #7120
Merged
Merged
Conversation
`LangGraphAgent` re-exported from the `@copilotkit/runtime` root is a stub
whose constructor throws:
LangGraphAgent import from @copilotkit/runtime is deprecated.
Please import it from @copilotkit/runtime/langgraph instead
Both canvas examples float their runtime pin (`^1.10.4` / `^1.9.3`), so a
fresh install resolves 1.71.1 and the stub is what they get.
- canvas/langgraph-python constructs it, so its `/api/copilotkit` route
throws at module load and the example does not boot.
- canvas/gemini only imports the symbol and never constructs it, so it is a
dead import of a throw-only stub. Removed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe canvas examples update ChangesCanvas runtime imports
Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BenTaylorDev
marked this pull request as ready for review
September 14, 2026 16:36
BenTaylorDev
requested review from
jpr5,
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
September 14, 2026 16:36
BenTaylorDev
added a commit
that referenced
this pull request
Sep 14, 2026
Follow-up to #7120, which fixed the same defect in the two canvas examples. ## What this deletes `showcase/shell-docs/src/content/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx`. It is dead content, and it is stale content. **Dead.** shell-docs reaches a snippet by exactly two routes, and the file is on neither: 1. An MDX import, `@/snippets/<path>` — resolved by `inlineSnippets`. No file in the repo imports this one. 2. A stub-name entry in `mdx-registry.tsx` / `docs-render.tsx` — read back by `mdx-registry-loader.tsx` through a mapped relative path. This file has no entry; its two live siblings, `self-hosting-copilot-runtime-create-endpoint.mdx` and `self-hosting-copilot-runtime-configure-copilotkit-provider.mdx`, do. Nothing enumerates the snippets directory — no glob, no `readdirSync` over it — so an unreferenced file there is reachable by no code path. A raw repo-wide grep for the basename also returns nothing. Its importer was the retired docs app, removed in 33a7948 (2026-06-18). The snippet was left behind. **Stale.** Four of its five tabs (Pages Router, Express, Node HTTP, NestJS) still import `LangGraphAgent` from the `@copilotkit/runtime` root, which is a deprecation stub whose constructor throws on any version >= 1.7x: ``` Error: LangGraphAgent import from @copilotkit/runtime is deprecated. Please import it from @copilotkit/runtime/langgraph instead ``` #6617 converted only the App Router tab. So the file is simultaneously invisible to readers and wrong. ## Why delete rather than patch The live LangGraph quickstart already documents the endpoint with the correct import (`showcase/shell-docs/src/content/docs/integrations/langgraph/quickstart.mdx:371`). Patching four tabs of a file that ships to nobody adds a maintenance surface without adding a reader. ## Testing Deletion only — no code changes. Verified by four independent lenses, each of which came back empty for this file: | Lens | Result | |---|---| | MDX imports of `@/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdx` | none | | `mdx-registry.tsx` / `docs-render.tsx` stub maps | absent | | Directory enumeration of `src/content/snippets` | no such mechanism exists | | Repo-wide `grep -F` for the basename | none | I did not build shell-docs locally; the branch's shell-docs CI jobs are the check that matters for a content deletion, and a reference that all four lenses missed would surface there. ## Note, not addressed here While scoping this I ran two different orphan sweeps over all 98 snippets and they disagreed sharply (19 vs 42 candidates) — path-matching over-reports because it misses registry entries, basename-matching under-reports because distinct files share a basename. A real answer needs a resolver that follows both mechanisms. That is worth doing, and it is not this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Removed the self-hosting guide for configuring Copilot Runtime LangGraph endpoints. - The guide previously covered setup examples for Next.js, Node.js, Express, and NestJS. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
Problem
LangGraphAgentexported from the@copilotkit/runtimeroot is a deprecation stub whose constructor throws:The throw is in the constructor, not at import time, so a file that only imports the symbol still loads.
Both canvas examples float their runtime pin, so a fresh install resolves the latest 1.x (1.71.1 today) and gets the stub:
examples/canvas/langgraph-python^1.10.4/api/copilotkitthrows at module load — the example does not bootexamples/canvas/gemini^1.9.3Fix
canvas/langgraph-python: importLangGraphAgentfrom@copilotkit/runtime/langgraph.canvas/gemini: drop the unused import.No behavior change beyond the import path. Two lines.
Testing
A structural scan of the repo for a root import of
LangGraphAgent/LangGraphHttpAgentthat is also constructed. Before the change, three files matched; after it, none outside dead content:The third hit is deliberately not in this PR — that snippet file is referenced by nothing in the repo (its siblings are imported as
@/snippets/<name>.mdx; this one has no importer), so it is orphaned content and a separate call. Flagged below.Before/after against the version the example's own
package.jsonresolves to (@copilotkit/[email protected]), replaying the example's exact route construction:End-to-end, the fixed import shape was driven against a live LangGraph deployment (langgraph 1.2.11 + langchain 1.4.0,
create_agent),@copilotkit/[email protected], agent registered exactly as the example registers it. A full turn streams and completes:No
RUN_ERROR.geminihas no other reference toLangGraphAgent, so removing the import is inert.oxfmt --checkpasses on both files.Commit hooks were bypassed (this worktree has no
node_modules, so lefthook cannot run);oxfmt --checkwas run manually against the repo's pinned binary instead.Follow-up, not in this PR
showcase/shell-docs/src/content/snippets/self-hosting-copilot-runtime-langgraph-endpoint.mdxhas four tabs (Pages Router, Express, Node HTTP, NestJS) still showing the throwing root import — #6617 converted only the first tab. Nothing imports the file, so it ships to no reader today. It wants a decision (wire it up, or delete it) rather than a silent one-line patch.🤖 Generated with Claude Code
Summary by CodeRabbit