Repository navigation
feat!: remove the 1.x deprecations that 2.0 drops, and migrate them in the codemod - #8106
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-10-30 07:58:55 PDT — 0 finding(s). |
|
Size Change: -1.15 kB (-0.06%) Total Size: 2.01 MB 📦 View Changed
ℹ️ View Unchanged
|
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/markdown-renderer
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/runtime
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
A new pass runs after the /v2 paths move. It renames BasicAgent, BasicAgentConfiguration, createNodeFetchHandler, and useA2UIStore to their replacements, and drops the import when the target is already imported. It deletes the no-op showDevConsole and registry props, and marks the other removed APIs with a TODO that names the 2.0 way. Refs: PE-1111 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: PE-1111 BREAKING CHANGE: useA2UIStore, useA2UIStoreSelector, createA2UICatalog, extractA2UISchema, A2UIComponentDefinition, A2UIComponentMap, A2UIComponentProps, ComponentLoader, ComponentRegistration, and the A2UIRenderer registry prop are removed. Use useA2UIContext, and createCatalog(definitions, renderers) with extractSchema(definitions). The v2-migration codemod renames useA2UIStore and deletes registry. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Capture keeps raw URLs, so route templates did nothing. Refs: PE-1111 BREAKING CHANGE: The routes option of the Learning collector and of trajectory capture is removed. It had no effect. Delete it from your learning configuration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ler, and setLicenseToken aliases
The workspace examples now use BuiltInAgent.
Refs: PE-1111
BREAKING CHANGE: BasicAgent and BasicAgentConfiguration are removed. Use
BuiltInAgent and BuiltInAgentClassicConfig. createNodeFetchHandler is
removed. Use createCopilotNodeHandler. The CopilotKitRequestHandler type
is removed. Use CopilotRuntimeFetchHandler, which takes the Request
directly. TelemetryClient.setLicenseToken is removed. Use
setTelemetryIdentity({ licenseToken }). The v2-migration codemod renames
BasicAgent, BasicAgentConfiguration, and createNodeFetchHandler.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…opilotChatView disclaimer prop
showDevConsole no longer controlled the Inspector. The workspace
examples and the reference docs no longer use it.
Refs: PE-1111
BREAKING CHANGE: The showDevConsole prop of CopilotKitProvider (React and
Vue) is removed. It did nothing. Use enableInspector to control the
Inspector. The disclaimer prop of CopilotChatView is removed. Pass it to
the input slot: input={{ disclaimer: MyDisclaimer }}. The v2-migration
codemod deletes showDevConsole and marks disclaimer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: PE-1111 BREAKING CHANGE: ImageData and the image field of AIMessage are removed. Send images as content parts, and use InputContentSource for their source. See https://docs.copilotkit.ai/migration-guides/migrate-attachments Co-Authored-By: Claude Opus 5.5 <[email protected]>
…readInspector Refs: PE-1111 BREAKING CHANGE: CpkThreadInspector no longer reads the headers property. Set resolveHeaders instead: inspector.resolveHeaders = () => headers. It runs before each request, so a rotated token is never stale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AG-UI 1.0 deprecates InputContentSource, and the old migrate-attachments link redirects to a page that does not cover images. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ments Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ifest Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mark the Before fences with ignore, since they show removed APIs on purpose, and make each After fence a complete module. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4aac2d4 to
8f4f5b3
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also make the getLicenseChecker snippet on the runtime 2.0 page pass kiira. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run
npx codemod @copilotkit/v2-migrationand the renamed 1.x deprecations migrate on their own. 2.0 is the only release where we can remove deprecated APIs without a semver break. This PR removes the ones that have a clear replacement, and the codemod migrates them.What does this PR do?
There are 64
@deprecatedtags on2.0.0. This PR removes 23 of them, for 21 APIs. 41 stay. PE-1111 has the full inventory, with a reason for each tag that stays.runtimeBasicAgent,BasicAgentConfiguration,createNodeFetchHandler,CopilotKitRequestHandler,TelemetryClient.setLicenseTokenBuiltInAgent,BuiltInAgentClassicConfig,createCopilotNodeHandler,CopilotRuntimeFetchHandler,setTelemetryIdentityreact-core,vueshowDevConsoleonCopilotKitProvider,disclaimeronCopilotChatViewenableInspector,input={{ disclaimer }}a2ui-rendereruseA2UIStore,useA2UIStoreSelector,createA2UICatalog,extractA2UISchema, the pre-v0.9 types, theregistrypropuseA2UIContext,createCatalog,extractSchemasharedImageData,AIMessage.imagecontentparts withImageInputPartlearning,web-inspectorroutesoption,CpkThreadInspector.headersresolveHeadersThe
v2-migrationcodemod has a new pass for these removals:BasicAgent,BasicAgentConfiguration,createNodeFetchHandler, anduseA2UIStore. If the file already imports the target name, it drops the old import.showDevConsoleandregistry.TODO(copilotkit-2.0)comment that names the 2.0 way.The codemod migrated the workspace examples. Examples that install CopilotKit from npm are not changed. The reference docs for the removed props are updated.
A new migration page,
migrate/removed-apis-2.0.mdx, lists each removed public API with its replacement and before and after code. It covers the cases the codemod can't fix: the{ request }handler change, the A2UI catalog split,routes,ImageData, and the inspectorheaders. The codemod'sImageDataTODO now links to this page.BREAKING CHANGE: These 1.x deprecations are removed. Run npx codemod @copilotkit/v2-migration, then resolve each TODO(copilotkit-2.0) comment.
runtime: BasicAgent -> BuiltInAgent, BasicAgentConfiguration -> BuiltInAgentClassicConfig, createNodeFetchHandler -> createCopilotNodeHandler, CopilotKitRequestHandler -> CopilotRuntimeFetchHandler (takes the Request directly), TelemetryClient.setLicenseToken(token) -> setTelemetryIdentity({ licenseToken: token }).
react-core and vue: delete showDevConsole and use enableInspector. CopilotChatView disclaimer -> input={{ disclaimer }}.
a2ui-renderer: useA2UIStore -> useA2UIContext, useA2UIStoreSelector -> useA2UIContext(), createA2UICatalog -> createCatalog(definitions, renderers), extractA2UISchema -> extractSchema(definitions). The registry prop and the pre-v0.9 types are removed.
shared: ImageData and AIMessage.image -> content parts with ImageInputPart.
learning: delete the routes option. web-inspector: CpkThreadInspector.headers -> resolveHeaders.
Guide: https://docs.copilotkit.ai/migrate/removed-apis-2.0
Related PRs and Issues
2.0.0. The two PRs do not touch the same files.Checklist
!(for examplefeat(react-core)!: ...) and the description has aBREAKING CHANGE:line with migration steps. See VERSIONING.mdThe documentation box covers the new migration page and the reference pages for the removed props. The older troubleshooting guides that show the v1
<CopilotKit showDevConsole>are left for PE-1088, the 2.0 docs work.Testing
Commands run
nx run-many -t build check-typeson every JS package: all passed.angular-demo-serverfails ontoReversedin its own code. That error is also on a clean2.0.0.nx run-many -t testonshared,runtime,react-core,core,vue,web-inspector,a2ui-renderer,learning,react-native, andangular: all passed. Under parallel load, somereact-corechart tests time out. They pass when they run alone.nx run @copilotkit/v2-migration:test: 32 TypeScript and 13 TSX fixtures passed.nx run @copilotkit/v2-migration:check-typespassed.npx kiira checkon all docs: 1605 snippets passed, 0 failed. TheBeforesnippets on the migration pages are markedignore, because they show removed APIs on purpose. This also fixes the snippets on theshared-2.0page from feat!: remove graphql and the v1-only helpers from shared, and drop the deps v1 freed #8103 and thegetLicenseCheckersnippet onruntime-2.0, which failed on2.0.0.showDevConsole(the error-debugging snippet, 7 contributing pages, and theCopilotKitreference) now useenableInspector.2.0.0:nx run-many -t build check-types testonshared,runtime,react-core,core,vue,a2ui-renderer,learning, andweb-inspectorpassed. The codemod fixtures (14 TSX, 35 TypeScript) passed.test-packageshook was skipped (LEFTHOOK_EXCLUDE=test-packages), because the same tests ran by hand above. Lint and commitlint ran.Manual test
BasicAgentorshowDevConsoleto a scratch folder, and commit it there.npx codemod jssg run --language tsx --target <app> --allow-dirty --no-interactive <repo>/codemods/v2-migration/scripts/codemod.ts. Use--language typescriptfor.tsfiles.BasicAgentbecameBuiltInAgentwith no duplicate import, and thatshowDevConsoleis gone.How this PR makes testing easy
tests/ts/deprecated-apis,tests/ts/deprecated-apis-existing-target, andtests/tsx/deprecated-props.examples/is real codemod output.showcase/shell-docs/src/content/docs/migrate/removed-apis-2.0.mdxhas before and after code for each manual change.Risk / rollback
CpkThreadInspector.headershas no codemod, because hosts set it as a DOM property. TheBREAKING CHANGEnote covers it.Public API change
Before
After
🤖 Generated with Claude Code