Skip to content

feat!: move the chat logic into @copilotkit/core so React, Vue and Angular share it - #8113

Merged
AlemTuzlak merged 24 commits into
2.0.0from
alem/core-extraction
Oct 30, 2026
Merged

AlemTuzlak merged 24 commits into
2.0.0from
alem/core-extraction

Conversation

@AlemTuzlak

@AlemTuzlak AlemTuzlak commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

React, Vue, and Angular now share one copy of the chat logic, in @copilotkit/core. A fix in core now reaches all three frameworks. This PR moves the labels, renderer types, renderer lookup, tool-call layout, message de-duplication, the input's send and stop rules, transcription, and the license state into core. The chat icons are now inline SVG data in core, so lucide-react and lucide-vue-next are gone.

BREAKING CHANGE: BasicMarkdownRenderer, BasicMarkdown, parseMarkdown (with its types), and the useLearningContainers hooks are removed. CopilotChatLabels has more keys. CopilotKitCore.addTool lets a newer tool replace an older one. Vue and Angular use React's default text and chat rules. Migration steps: docs/migrate/chat-2.0.mdx ("Chat UI in 2.0").

What does this PR do?

  1. Removes dead code: the basic markdown renderers, parseMarkdown and the marked dependency in core, the deprecated useLearningContainers hooks, @radix-ui/react-slot, and the test-only minimalCatalog.
  2. Adds the shared code to core: framework-neutral renderer types, one label set, and helpers for renderer lookup, tool-call layout, de-duplication, the input, transcription, and license state. New helpers use the ɵ prefix.
  3. Fixes core: setters skip equal values, snapshots stay stable, dispose() is new, and tool registrations stack. The React and Vue subclasses pass a wait-for-render option instead of overriding a method.
  4. Rewires React, Vue, and Angular to the shared code and deletes their copies.
  5. Draws the icons from core's SVG data (copied from Lucide, with its ISC notice).

Bugs that this fixes:

  • In Vue, Enter during a run stopped the run, even with text in the input. Now it sends.
  • Angular had no stop button. Now it has one.
  • A component that replaced a provider tool deleted that tool for good. Now the provider tool comes back on unmount.
  • The license banner said "expires in undefined days".
  • Vue showed duplicate tool calls, and Angular did not de-duplicate messages.

Related PRs and Issues

Checklist

  • I have read the Contribution Guide
  • If the PR changes or adds functionality, I have updated the relevant documentation
  • If the PR contains a breaking change, the title has ! (for example feat(react-core)!: ...) and the description has a BREAKING CHANGE: line with migration steps. See VERSIONING.md
  • "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone)

Testing

Commands run

  • pnpm nx run-many -t build,test,check-types,publint,attw for core, shared, react-core, vue, angular, a2ui-renderer, markdown-renderer, react-native, web-inspector, web-components, and mcp-apps-renderer: all pass.
  • pnpm check:docs-snippets: all 1611 snippets pass.
  • Vue lint fails on 2.0.0 already. This PR adds no lint errors.

Manual test (the demos need an LLM key, or the slow-tools agent from the Angular demo server)

  1. In the Vue chat, send a message. While the agent runs, type text and press Enter. The text is sent, and the run does not stop.
  2. In the Vue chat, press Enter in an empty input during a run. The chat sends a stop request.
  3. In the Angular chat, send a message. During the run, the send button shows a square stop icon. Click it. The chat sends a stop request.
  4. In the React Storybook, open "Tool Call Display / Turn". The summary counts "Working Ns", then shows "Worked for".

How this PR makes testing easy

  • Each core module has its own unit tests in packages/core/src/chat/__tests__/.
  • New e2e tests in React and Vue prove that a provider tool comes back after the replacing component unmounts.
  • New input tests in Vue and Angular cover Enter and Stop during a run.

Risk / rollback

Medium. The chat components in all three frameworks changed. React's behavior is the reference, and React's existing tests pass without change. Vue and Angular change where they used to differ from React (listed in the migration guide). To undo, revert this PR.

Public API change

Before

import { BasicMarkdownRenderer } from "@copilotkit/react-core";

copilotkit.addTool(searchTool); // a second call with the same name did nothing

After

import { StreamingMarkdownDefaultRenderer } from "@copilotkit/react-core";

const removeSearch = copilotkit.addTool(searchTool); // the newest tool is active
removeSearch(); // the earlier tool is active again

copilotkit.dispose(); // new: stop the instance

🤖 Generated with Claude Code

AlemTuzlak and others added 24 commits October 30, 2026 16:26
…ntainers hooks and unused dependencies

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n any-value Standard Schema

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e and skip no-op setter updates

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o a replaced provider tool returns

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ules and transcription in the chat

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ose the core on unmount

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tton while the agent runs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bel the last chat strings

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tool overrides and dispose()

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AlemTuzlak
AlemTuzlak merged commit 8f95ac7 into 2.0.0 Oct 30, 2026
32 of 57 checks passed
@AlemTuzlak
AlemTuzlak deleted the alem/core-extraction branch October 30, 2026 15:29
@github-actions

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 43 services digest-pinned.

Run 2026-10-30 08:29:35 PDT — 0 finding(s).

AlemTuzlak added a commit that referenced this pull request Nov 2, 2026
Core's public types (chat messages and tool-call layout) import from
@ag-ui/core, but core listed it only as a dev dependency. tsdown then
inlined it into the declaration bundle and, with CI set, failed the
build ("Detected dependencies in bundle: @ag-ui/core"). Every job that
builds core failed on 2.0.0 since #8113.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant