Repository navigation
refactor(core)!: share A2UI, Open Generative UI and MCP Apps logic across React, Vue and Angular - #8175
Merged
Conversation
Vue put the raw web_core action into the a2uiAction run property. Both runtimes (@ag-ui/a2ui-middleware and runtime-python) read forwardedProps.a2uiAction.userAction, so a Vue button click reached the agent with no action. Wrap it as React and Angular do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ics and lifecycle controller React, Vue and Angular each carried their own copy of reading a2ui_operations, resolving an operation's surface (nested id first, OSS-1048), the paint check, the userAction envelope + runAgent bridge, the dev warnings and the pre-paint lifecycle (retry reveal, debug exposure, progress phases, skeleton rows, the 8s hand-off fallback). These now live once in core under ɵ names, with no web_core and no zod dependency. ɵA2UIActivityController drives what an a2ui-surface activity shows; ɵA2UI_SURFACE_CONTENT_SCHEMA is a hand-written Standard Schema for its content. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g A2UI operations normalizeA2UIOperations, applyA2UIOperations and A2UIOperationApplier (Angular's validated, catalog-pinned, apply-only-what-is-new logic), A2UISurfaceDiagnostics (missing-surface and unresolved-root dev warnings) and the AGUISendStateSnapshot conversion now live in @copilotkit/a2ui-renderer/engine so React, Vue and Angular share them. A2UIProvider gains an applyOperations action built on the applier. Operations keys outside the message (a top-level surfaceId) are ignored instead of failing validation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lifecycle and engine The A2UI message renderer now draws ɵA2UIActivityController's snapshot, applies operations through the provider's applier, sends actions with ɵrunA2UIAction and runs the shared dev diagnostics. The recovery states are presentational components over the snapshot. Behaviour changes: a createSurface naming a stray catalogId no longer blanks the surface (pinned to the renderer's catalog); operations for a surface whose createSurface never arrived create it on demand; only the operations new since the last snapshot are applied. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le and engine Vue now uses ɵA2UIActivityController (closing the gap: the loader stays over the hidden surface until it paints, with the 8s fallback), the engine's applier and diagnostics, and ɵrunA2UIAction. a2ui.onAction is new (interceptor, as in React). getOperationSurfaceId resolves the nested surface id first (OSS-1048) instead of a top-level one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ecycle and engine Angular's surface, recovery, activity and tool renderers now use the engine's applier and diagnostics, ɵA2UIActivityController and ɵrunA2UIAction. Fixes the retry reveal being reset by every streamed snapshot, shows config.a2ui.loadingComponent while building, adds a2ui.onAction and the dev diagnostics, and labels debug details in lowercase as React and Vue do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g and core sync /catalog-schema now carries buildA2UIContextEntries (the four agent context entries, scoped to agentIds), filterCatalog (moved out of the React folder; it now keeps the catalog's class and extra fields such as an Angular catalog's surfaceComponent) and A2UICatalogController, which registers a catalog's components with core, derives the catalog without the components disabled in the Inspector, and registers the context entries scoped to core.a2uiAgents, again whenever that list changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g controller The provider's component registration effect and A2UICatalogContext are replaced by A2UICatalogController from @copilotkit/a2ui-renderer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on agent changes Vue now syncs its A2UI catalog through the shared A2UICatalogController: catalog components are registered with core so the Inspector can toggle them, disabled components are removed from what renders and what the agent is told, and the context entries are registered again when the runtime's A2UI agent list changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…our Inspector toggles Angular registered the A2UI catalog context for every agent (#5369) and never registered its catalog components with core. It now uses the shared A2UICatalogController: entries are scoped to core.a2uiAgents, components are registered for the Inspector, and disabled components are removed from what surfaces render and what the agent is told. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…exts and placeholder rotation React, Vue and Angular each defined the content and tool-argument zod schemas, the generateSandboxedUi tool, the "OGUI active" rule, the design-skill and sandbox-function context entries, and the placeholder rotation. Core now has hand-written Standard Schemas (with the same JSON Schema zod produced), ɵcreateOpenGenerativeUITool, ɵbuildOpenGenerativeUIContexts, ɵisOpenGenerativeUIActive and ɵPlaceholderCycler. The controller state gains showSpinner/showOverlay (both while generating, React's rule). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…emas, tool and contexts The content and tool-argument schemas, the generateSandboxedUi tool, the active rule, the agent contexts and the placeholder rotation now come from core. The spinner and overlay follow the controller's showSpinner/showOverlay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and contexts The schemas, tool, active rule, contexts and placeholder rotation now come from core. Behaviour changes: the sandbox-function context tells the model "Call via: await Websandbox.connection.remote.<functionName>(args)" as React and Angular do; the placeholder rotation no longer restarts on every streamed chunk; the spinner sits in the 0.5 overlay while generating and nothing shows once generation is done (React's look). OpenGenerativeUIContentSchema and GenerateSandboxedUiArgsSchema are now hand-written Standard Schemas instead of zod objects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s, tool and contexts The schemas, tool, active rule, contexts and placeholder rotation now come from core; the spinner and overlay follow the controller state. OpenGenerativeUIContentSchema and GenerateSandboxedUiArgsSchema are now hand-written Standard Schemas instead of zod objects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ɵMcpAppHost (bridge-free, from /activity) owns what React, Vue and Angular each re-implemented around bindMcpApp: creating and styling the iframe, binding again only when the widget identity, agent, message id or container changes, sizing it as the widget reports (height clamped to a positive finite value, at most 5000px), and the loading / error / content-error / prefersBorder state. ɵloadMcpAppsRenderer wraps the frontend's dynamic import with the "what to install" message. scopeToWidget opts into Angular's session contract. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behaviour change: a reported height is clamped to a positive finite value of at most 5000px, as Angular did. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behaviour change: a reported height is clamped to a positive finite value of at most 5000px, as Angular did. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The widget keeps its scoped session contract (scopeToWidget). Behaviour changes: the iframe is created by the shared host instead of the template, the reported width is applied as React and Vue do, loading ends when the resource arrives, and a missing agent shows "No agent available to fetch resource". Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eact, Vue and Angular mapJustify, mapAlign, the leaf/container style constants and the DateTimeInput type rule now live in one React-free module, exported through @copilotkit/a2ui-renderer/engine and used by the React, Vue and Angular basic catalogs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vue and Angular now take an A2UI action interceptor on their provider config; React only had it on createA2UIMessageRenderer. The provider now passes a2ui.onAction to the built-in A2UI renderer too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…A2UI and OGUI exports Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he public API manifest Co-Authored-By: Claude Opus 5.5 <[email protected]>
The core-lifecycle refactor narrowed it to the a2ui-surface content type, which would stop it from being assigned to a list of ReactActivityMessageRenderer<unknown>. Restore the 1.x signature. Also pin the Vue A2UI and Open Generative UI exports that 2.0 keeps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The v2-migration codemod now deletes explicit type arguments on filterCatalog<…>(…) from @copilotkit/a2ui-renderer (its type parameter is now the inferred catalog type), and adds a TODO(copilotkit-2.0) that names the Standard Schema call wherever the Vue or Angular OpenGenerativeUIContentSchema / GenerateSandboxedUiArgsSchema is used as a zod schema (.parse, .safeParse, other zod members, zod composition), where removed CopilotA2UIRecovery members are read, and where tests target the removed open-generative-ui-placeholder test id. The README and the skill's mappings reference describe the new step. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Covers the Vue and Angular Open Generative UI schemas that are Standard Schemas now (with before/after code for .parse and .safeParse), the filterCatalog type parameter, the Angular CopilotA2UIRecovery members, the changed test IDs, CSS class and labels, and the A2UI, Open Generative UI and MCP Apps behavior that changed in React, Vue and Angular. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…erative-ui React, Vue and Angular providers keep the shared Open Generative UI and A2UI catalog wiring and the core provider-config diagnostics. Keep the generative UI A2UI renderer tests, list both migrate pages, and regenerate react-core external re-exports and the public API manifest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…time flags from ɵruntimeInfo The A2UI catalog controller and the Angular A2UI and Open Generative UI checks read core's runtime info snapshot instead of the separate core fields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AlemTuzlak
requested review from
rainerhahnekamp,
tylerslaton and
wolfmanfx
as code owners
November 3, 2026 18:14
Contributor
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-11-04 02:33:02 PST — 0 finding(s). |
@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
@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: |
This was referenced Nov 3, 2026
Merged
Merged
Merged
Contributor
|
Size Change: +40.4 kB (+1.78%) Total Size: 2.3 MB 📦 View Changed
ℹ️ View Unchanged
|
…l bundle The /engine subpath of @copilotkit/a2ui-renderer statically re-exported the surface diagnostics and the tool-call snapshot helpers, which import @copilotkit/core. The @copilotkit/angular/a2ui surface imports /engine, so an app that renders A2UI surfaces eagerly pulled all of core, AG-UI and their zod build into its initial bundle (+736 KB raw in the Angular showcase, over the performance budget). /engine now has no core import (applier, normalize, basic catalog styles). The core-dependent helpers move to a new @copilotkit/a2ui-renderer/engine-core subpath. The Angular surface loads its development diagnostics from it with a dynamic import; React, Vue and the Angular tool renderer, which already load core, import it statically. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…erative-ui The Angular and Vue A2UI helpers keep this layer's shared engine versions, and the Angular surface outlet keeps core's runA2UIAction, now voided so the slot output stays void-returning. The Open Generative UI tool handler returns Promise.resolve instead of an async function with no await. The lint baseline moves two no-explicit-any entries with the code this layer moved (the React provider's A2UI catalog and the React A2UI operation applier) and drops 47 others. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…into core (#8181) Merge this PR first. It is PR 1 of 10 in the "2.0 core pipeline" stack, with base `2.0.0`. The chat primitives of React, Vue, and Angular now get their logic from `@copilotkit/core`. As a result, a bug in this logic has one fix, in core. This PR also corrects five bugs where the three frameworks did different things. ## What does this PR do? These rules moved into core. The framework packages keep only the rendering and the lifecycle. | Core file | What it holds now | | --- | --- | | `chat/message-feedback.ts` | The rating store, the "Learning feedback on" rule, and the comment popover rules (150 ms close delay) | | `chat/viewport.ts` | `autoScroll` modes, the mobile media query, the keyboard height, and pin-to-send | | `chat/license.ts` | License banner text, links, colors, and the 52 px bottom offset | | `chat/message-display.ts` | Reasoning time label, work summary text, user message text and files, branch navigation, toolbar rule, and the "copied" timer | | `chat/inspector-button.ts` | The "hide shortcuts" store, the kite icon as data, and the hover menu (180 ms close delay) | Core also exports `ɵshallowEqualRecord` and `ɵcn` to the framework packages. All new exports use the `ɵ` prefix, because they are internal. Bugs that this PR corrects: - **Copy buttons:** Fast clicks made the check mark flicker in the React user message and both Angular buttons. A second copy now starts the 2 seconds again. - **Angular toolbar:** The assistant toolbar showed while the latest message streamed. Now it is hidden, as in React and Vue. - **License text:** React license warnings ignored custom labels, and the Vue inline warning had fixed text. Both now use the chat labels. - **Stable refs:** React and Vue treated `{ a: undefined }` and `{ b: undefined }` as equal. Now they compare with `Object.is` and own keys. - **Pin-to-send in React:** It now runs without `requestAnimationFrame` or `ResizeObserver`, as Vue did. Angular also gets an optional `branchSwitchEnabled` input (default `true`) on the user message and its branch navigation. The merge from `2.0.0` brought in the React StrictMode pin-to-send fix of #8159. This fix now lives in core `ɵpinMessageToTop`. The unpin function returns `false` when it cancelled a scroll that did not run. On `false`, React pins again. A new core test covers this ("reports whether the scroll ran before it was unpinned"). BREAKING CHANGE: In `@copilotkit/angular`, `copied` on `CopilotChatUserMessageCopyButton` and `CopilotChatAssistantMessageCopyButton` is a read-only signal. Calls to `copied.set()` and `copied.update()` do not type-check. Call `handleCopy()` on the button, or render your own button in the `copyButton` slot. The [v2-migration codemod](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/codemods/v2-migration/scripts/angular-copy-buttons.ts) puts a TODO above each of these calls. The steps are in [Angular copy buttons](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#angular-copy-buttons). Behavior changes without a codemod are in the same page: - [License warning text](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#license-warning-text) (React and Vue) - [Chat behavior in Vue and Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-primitives/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#chat-behavior-in-vue-and-angular): the Angular toolbar, and the Vue copy buttons without the Clipboard API ## Related PRs and Issues - #8159 (the pin-to-send fix that this PR moves into core) ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run** On the head `cb06e3f5cb` (after the merge from `2.0.0`): - `pnpm nx run-many -t test -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular`: core 1955, react-core 2487 (35 skipped), vue 1432, angular 690 tests pass. - The first run had two failures from a stale local install: a stale `external-reexports` check and a Vue test that timed out at 5 s. After `pnpm install` and a core build, both pass. Before the merge, on this branch: - `pnpm nx run-many -t build,check-types -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular`: pass. - `pnpm nx run @copilotkit/v2-migration:test --skip-nx-cache`: 39 TypeScript and 14 TSX cases pass. - `pnpm check:public-api-manifest`: current. - `pnpm nx run @copilotkit/vue:lint`: 197 errors. `2.0.0` has the same 197 errors. None come from this PR. **Manual test** 1. In an Angular chat, send a message. The assistant toolbar shows only after the reply stops streaming. 2. Click a copy button two times in 2 seconds. The check mark stays for 2 seconds after the second click. 3. In React, render `<CopilotChat labels={{ licenseFeatureUnlicensedText: "No license for {feature}" }} />` without a license. The warning shows your text. 4. Run the codemod on an Angular file with `copyButton.copied.set(true)`. A `TODO(copilotkit-2.0)` comment is above the call. **How this PR makes testing easy** - Each new core module has its own tests in `packages/core/src/chat/__tests__/` and `packages/core/src/utils/__tests__/`. - Each behavior change has an adapter test, for example `CopilotChatCopyButtons.test.tsx`, `copy-buttons.spec.ts`, and `copilot-chat-assistant-message.component.spec.ts`. - The codemod has three new cases in `codemods/v2-migration/tests/ts/angular-copy-buttons*`. ## Risk / rollback The risk is medium. Many chat components in three frameworks changed at the same time. The tests above cover each moved rule. If this PR causes an error, revert it. Before that, revert the stack PRs that merged after it. ## Public API change **Before** ```ts this.copyButton().copied.set(true); ``` **After** ```ts this.copyButton().handleCopy(); ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | **#8181 (this PR)** | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Angular 2.0 migration guidance now covers copy-button changes, including read-only copied state and options for custom copy behavior. * **Improvements** * License banners and inline warnings now use configured labels across React and Vue, with default labels when no provider is present. * Chat toolbars, branch navigation, copy feedback, Inspector menus, and work summaries now follow shared behavior across frameworks. * **Documentation** * Updated the migration guide with Angular copy-button, license-warning, and chat-behavior notes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…o core (#8173) The CopilotKit providers in React, Vue, Angular, and React Native now get their config rules, prop sync, runtime info, and error handling from `@copilotkit/core`. Each framework kept its own copy of this logic, and the copies did not match. A fix in these areas now goes in one place in core. This is PR 2 of 10 in the "2.0 core pipeline" stack. Its base is `alem/2.0-core-chat-primitives`. Merge it after PR 1. ## What does this PR do? **Moved into core** (`packages/core/src/core/provider-config.ts`, `runtime-info.ts`, `core.ts`): - `ɵresolveProviderConfig`: the key fallback (`publicApiKey ?? publicLicenseKey`), the Copilot Cloud URL, the transport from `useSingleEndpoint`, the agent merge, the `a2uiCatalogAvailable` property, the key header, and the missing-config check. - `CopilotKitCore.ɵupdateConfig(patch)`: applies only the keys present, in a fixed order (message filter first). - `CopilotKitCore.ɵruntimeInfo` + `ɵsubscribeToRuntimeInfo`: one frozen snapshot of every `/info` field, so an adapter cannot miss a field. - `onError` config + `setErrorHandler`: without a handler, core logs `[CopilotKit] Error (code):`. - `ɵCopilotKitProviderBaseOptions`: one copy of the shared option docs that React and Vue extend, and Angular and React Native pick from. Also `ɵSTABLE_ARRAY_WARNINGS` and `ɵtoolRendererShapeChanged`. **Bugs fixed:** - React and React Native never disposed their core. They now dispose it on unmount. The dispose waits one task, so the StrictMode remount keeps the same core, and a later remount (`<Activity>`) gets a new core. - Vue and Angular fetched `/info` during server-side rendering. Vue now connects on mount, and Angular only in the browser. - Angular could not clear `runtimeUrl`, and had no `runtimeTransport`, `debug`, `defaultThrottleMs`, or `onError` at startup. Now it has all of them. - Vue logged an invalid `defaultThrottleMs` two times. Now core logs it once. - Vue `CopilotChatConfigurationProvider` registered its open Thread again on every runtime status event. - A React StrictMode remount pushed the provider tool lists over the tools that children registered. ## Breaking changes BREAKING CHANGE: Angular `provideCopilotKit` with no `runtimeUrl`, `licenseKey`, `agents`, or `selfManagedAgents` now throws in production. Add a `runtimeUrl` to the config. Behavior changes that apps can notice: - Without `onError`, core, Vue, and Angular now log errors with `console.error`. - The React and React Native providers dispose their core on unmount. - Vue and Angular no longer send `/info` during server-side rendering. - Angular `licenseKey` with no `runtimeUrl` connects to Copilot Cloud. Angular sends every key value, also keys that do not start with `ck_pub_`. - Angular `updateRuntime({ runtimeUrl: undefined })` clears the URL. `agents` and `selfManagedAgents` each keep the last value of the other set. Migration: - Guide: [Providers in 2.0](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-provider-config/showcase/shell-docs/src/content/docs/migrate/providers-2.0.mdx), linked from the main 2.0 migration page. - Codemod: the [v2 migration codemod](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-provider-config/codemods/v2-migration/scripts/codemod.ts) adds a `TODO(copilotkit-2.0)` comment to each `provideCopilotKit` call that it can read in full and that has no runtime config. ## Related PRs and Issues - Base: `alem/2.0-core-chat-primitives` (PR 1 of the stack). - Keeps the deferred connection from #5801 and the header rules from #1937 and #5635. ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Merge notes - The merge of 2.0.0 into this branch kept both codemod transforms. - In the React Native provider, this branch's version won over the reworded `debug` doc comment from 2.0.0. The core base type now documents that prop. ## Testing **Commands run** (before the stack merge, on this layer alone): - `pnpm nx run-many -t build,check-types,test,lint -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular @copilotkit/react-native --parallel=1`: builds and type checks pass. Core 116 test files, React Native 27, and Angular 71 pass. - These tests timed out under load in the full run and passed when run alone: the react-core chart tests, Vue `build-entries.test.ts`, and Angular `public-api-documentation.spec.ts`. - Vue lint fails on the base too. It has 197 errors on the base and 194 on this branch, so this PR adds none. - `pnpm nx run @copilotkit/v2-migration:test --skip-nx-cache`: 14 tsx and 40 ts cases pass. - `npm test` in `showcase/shell-docs`: 91 files and 585 tests pass, with link integrity. - `pnpm check:public-api-manifest`: current. - Not run after the stack merge: the full suites on head `4ba047de80`. **Manual test:** 1. In a React app, wrap the provider in `<StrictMode>`. Read the core with `useCopilotKit()`, then unmount the provider. The core is disposed after one task, and StrictMode does not dispose it. 2. In an Angular app, call `provideCopilotKit({})` in a production build. The app throws `Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'`. Add `runtimeUrl` to remove the error. 3. In a Vue app, render the provider on the server. No request goes to `/info` until the app mounts in the browser. **How this PR makes testing easy:** - Core unit tests: `provider-config.test.ts`, `runtime-info.test.ts`, `core-update-config.test.ts`. - Adapter tests: `CopilotKitProvider.lifecycle.test.tsx` (React, StrictMode and `<Activity>`), `CopilotKitProvider.config.test.ts` (Vue), `copilotkit.provider-config.spec.ts` (Angular). - Codemod fixtures: `codemods/v2-migration/tests/ts/angular-*`. ## Risk / rollback - Risk: an app that keeps the React core after unmount, or an Angular app with no runtime config at startup, breaks. The guide and the codemod TODO cover both. - Raw `CopilotKitCore` users now see logged errors when they set no handler. - Rollback: revert this PR. Layers 3 to 10 of the stack build on it, so revert them first. ## Public API change **Before** (Angular, 1.x) ```ts provideCopilotKit({ licenseKey: "ck_pub_..." }); // later copilotKit.updateRuntime({ runtimeUrl: "/api/copilotkit" }); ``` **After** ```ts provideCopilotKit({ licenseKey: "ck_pub_...", runtimeUrl: "/api/copilotkit", onError: ({ code, error }) => console.warn(code, error), }); ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | **#8173 (this PR)** | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Provider configuration is more consistent across Angular, React, React Native, and Vue, with shared options for runtime settings, agents, and error handling. * Runtime and license information updates are synchronized across providers. Angular runtime updates can clear selected settings with `undefined`. * Errors use a configured handler when available; otherwise, they are logged. * Angular migration tooling flags missing runtime configuration with a TODO. * **Bug Fixes** * Vue and Angular defer runtime information requests until browser startup. * **Documentation** * Added a provider migration guide covering 2.0 configuration and behavior changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
Merge this PR after PR 2. It is PR 3 of 10 in the "2.0 core pipeline" stack, with base `alem/2.0-core-provider-config`. Tool-call rendering now follows one set of rules in `@copilotkit/core`. React, Vue, and Angular only connect those rules to their own reactivity, so a rendering bug is fixed in one place. This PR also fixes several bugs where the three frameworks disagreed. One of them: Angular showed tool-call status the wrong way round. ## What does this PR do? **Moved into core:** - **Renderer registry** (`ɵRendererRegistry`): prop and hook tool-call renderers by `agentId` and name, plus activity and custom message renderers. React, Vue, and Angular store their renderers in it. - **Executing tool calls**: `CopilotKitCore.executingToolCallIds` and the `onExecutingToolCallsChanged` event. The React and Vue providers read it. Angular gets an `executingToolCallIds` signal. - **Tool-call render props**: status, argument parsing, the result text, and the agent to look up renderers for. The props of the built-in card and the state of a tool-call group come from core too. - **Activity and custom message renderers**: the renderer lookup, a reason when nothing can draw, one warning text, and the props of a custom message renderer. - **Component tools**: the tool description that `useComponent` and `registerComponent` give the model. **Bugs fixed:** - **Angular status was inverted.** A call with no result was "in-progress" while the run went on and "executing" after it stopped. Now it is "executing" only while its handler runs. - **Vue status lagged.** Vue removed executing ids one tick late, with `setTimeout`. Core now keeps a call executing until its result is in the messages. A human-in-the-loop `respond` also never shows before the handler waits for it. - **Angular `<copilot-activity>` used no agent** when `agentId` was not set. It now uses the default agent, as React and Vue do. - **Vue `useComponent` dropped `followUp`.** It now passes it on, as React and Angular do. - **Renderer changes went unannounced.** React sent no event when activity or custom message renderers changed, and Vue sent none for activity renderers. Both now send one. ## Breaking changes BREAKING CHANGE: In React, `copilotkit.renderToolCalls` and `copilotkit.renderActivityMessages` are read-only arrays. Code that changes them in place no longer type-checks. Give a new list to `setRenderToolCalls` or `setRenderActivityMessages` instead. See [Renderer lists](https://docs.copilotkit.ai/migrate/chat-2.0#renderer-lists). BREAKING CHANGE: `CopilotChatLabels` has a new key, `toolCallStatusUnknownLabel`. A complete labels object no longer type-checks. Spread `CopilotChatDefaultLabels` and override only your keys. See [Label type](https://docs.copilotkit.ai/migrate/chat-2.0#label-type). The codemod marks both cases with a `TODO(copilotkit-2.0)` comment. See [`chat-apis.ts`](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-tool-call-rendering/codemods/v2-migration/scripts/chat-apis.ts). These behavior changes have guide entries and no codemod: - **Angular:** for two renderers with the same name and `agentId`, the newer renderer is used. In 1.x, the first one was used. See [Chat behavior in Vue and Angular](https://docs.copilotkit.ai/migrate/chat-2.0#chat-behavior-in-vue-and-angular). - **React and Vue:** malformed tool-call arguments read `{ _raw }` or `{ _value }`, not `{}`. This is the rule that Angular already tested. See [Tool-call rendering](https://docs.copilotkit.ai/migrate/chat-2.0#tool-call-rendering). - **The built-in card:** its status and headings come from the labels, and a status it does not know shows "Unknown status". - **All three frameworks:** they log the same activity warning text. ## Merge notes - **Angular `copilotkit.ts`:** this PR adds the renderer registry and the executing tool-call ids on top of the runtime-info subscription from PR 2. - **Codemod:** the stack merge kept the changes from both sides. - **`chat-2.0.mdx`:** the Vue custom message renderer bullet replaces the earlier 2.0.0 sentence. That sentence said that the chat tries each renderer until one draws. Both React and Vue use the first renderer for the agent, then the first global one. ## Related PRs and Issues - PR 2 of the stack: `alem/2.0-core-provider-config` (the base of this PR). ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run.** I ran these on this branch before the stack merge, at `12d04e3743`. I did not run them again after the merge of PR 2 (`2fde35e750`). - `pnpm nx run-many -t build,test,lint,check-types -p @copilotkit/core @copilotkit/react-core @copilotkit/vue @copilotkit/angular`. Build and check-types passed for all four packages, and the Angular tests passed. - The core, React and Vue test failures were timeouts while ten agents ran on the same machine. Each failing file passed when run on its own, except one Vue `build-entries.test.ts` case. That case times out a Vite build at 5 seconds. I did not run it on the base branch. - `vue:lint` fails with 197 errors. None is on a line that this PR adds. - `pnpm --filter @copilotkit/v2-migration test`: 16 tsx fixtures and 38 ts fixtures passed. - `pnpm check:public-api-manifest`: the manifest is current. **Manual test (the Angular status bug):** 1. Run `pnpm nx run @copilotkit/angular:test -- src/lib/render-tool-calls.spec.ts`. The new `status` cases pass: "in-progress" when the run stopped, "executing" while core runs the handler, "complete" with a result. On the base branch, a stopped run gave "executing". 2. Run `pnpm --filter @copilotkit/v2-migration test`. The `chat-labels-object` and `chat-renderer-lists` fixtures show the codemod TODOs. **How this PR makes testing easy.** It adds core unit tests for each moved rule (`renderer-registry.test.ts`, `core-executing-tool-calls.test.ts`, `tool-call-render.test.ts`, and new cases in `renderers.test.ts` and `tool-call-layout.test.ts`). It also adds adapter tests for each behavior change and four codemod fixtures. ## Risk / rollback The tool-call rendering of all three frameworks changes. The largest risk is the Angular status change, because a renderer that waited for "executing" after a run now stays at "in-progress". To undo, revert this PR. PRs 4 to 10 of the stack build on it, so revert them first. ## Public API change **Before** ```ts const { copilotkit } = useCopilotKit(); copilotkit.renderToolCalls.push(searchRenderer); const labels: CopilotChatLabels = { chatInputPlaceholder: "Ask me anything..." /* every 1.x key */ }; ``` **After** ```ts const { copilotkit } = useCopilotKit(); copilotkit.setRenderToolCalls([...copilotkit.renderToolCalls, searchRenderer]); const labels: CopilotChatLabels = { ...CopilotChatDefaultLabels, chatInputPlaceholder: "Ask me anything...", }; ``` New and additive: `CopilotKitCore.executingToolCallIds`, `onExecutingToolCallsChanged`, and the Angular `CopilotKit.executingToolCallIds` signal. ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | **#8176 (this PR)** | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…o core (#8174) Merge this after PR 4. It moves the agent, thread-list, chat configuration, threads drawer, and Inspector "view thread" logic from React, Vue, and Angular into `@copilotkit/core`. The three framework packages now only connect that core logic to their reactivity, so a logic fault is fixed in one place. It also fixes several drifts between the frameworks. The largest fix: data that an app writes to the stand-in agent before the runtime connects is now kept in React and Vue. PR 5 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-core-generative-ui` (PR 4). ## What does this PR do? New core modules (internal `ɵ` exports): - `core/agent-resolver.ts`: `ɵAgentResolver` (one per core) owns the binding checks, the agent ID fallback, the stand-in agent cache, the hand-off from the stand-in to the real agent, and thread-scoped proxy registration. `useAgent` (React, Vue) and `injectAgentStore` (Angular) use it. - `threads-controller.ts`: `ɵThreadsController` owns thread projection, config errors, the gated `/threads` context dispatch, the store registry claim, and the mutation guard. `useThreads` (React, Vue) and `injectThreads` (Angular) use it. - `chat/chat-configuration.ts`: `ɵChatConfigurationStore` owns thread, agent, modal, and drawer state across nested providers, and open-thread registration. The three chat configuration providers wrap it. - `chat/threads-drawer.ts` and `inspector-thread-bridge.ts`: the drawer actions, element props, chat-input lookup, and `ɵInspectorThreadOverride`. - `core/agent-helpers.ts` and `core/record-annotation.ts`: context value serialization, capability lookup, and the learn-from-user-action request (moved from React). Faults and drifts this fixes: - **Stand-in agent hand-off (React, Vue):** messages, state, and a run written to the stand-in during the `/info` request now move to the real agent. Same-ID consumers share one stand-in (Angular already did this). - **Stand-in request settings (all):** the stand-in now gets the same credentials, message filter, debug, and Intelligence settings as a registered proxy. React keys header refresh on `ɵheadersGeneration` (#1937). - **Vue `useAgent`:** returns `isReady`, re-renders on run start, and batches message updates like React. - **Angular gaps closed:** chats apply the Inspector "view thread" request. `CopilotChatConfiguration` registers the open thread and warns when the thread is controlled. Agent context accepts JSON values. - **Thread lists:** React and Vue no longer fetch `/threads` twice for the same context. Vue and Angular `startNewThread` hides config errors, like React. ## Breaking changes BREAKING CHANGE: Angular `CopilotChatConfiguration` no longer has the protected `_setOverride(threadId, explicit)` method. In a subclass, call `this.setActiveThreadId(threadId, { explicit })` instead. To customize thread changes, override `setActiveThreadId` and `startNewThread`. - Codemod: [`angular-chat-configuration.ts`](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-agents-threads/codemods/v2-migration/scripts/angular-chat-configuration.ts) rewrites the calls. It adds a `TODO(copilotkit-2.0)` comment to a subclass that overrides `_setOverride`. - Migration guide: [Chat configuration](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-agents-threads/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#chat-configuration). Behavior-only changes are in the same page: [Agents before the runtime connects](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-agents-threads/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#agents-before-the-runtime-connects), [Agent context in Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-agents-threads/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#agent-context-in-angular), [Thread lists](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-agents-threads/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#thread-lists). Behavior changes an app can notice (guide only, no codemod): - Vue chat configuration: a parent thread beats a nested non-explicit seed. Nested thread changes go to the top-most provider. A bare provider has `isModalOpen: true` and a `setModalOpen` function. - React: the placeholder thread ID is made once per provider. - Angular: `connectAgentContext` and the `copilotkitAgentContext` directive send a non-string value as JSON text. ## Merge notes - Angular `injectCapabilities` keeps the default-agent fallback from 2.0.0 (`d3c6423f92`) on top of the core `ɵgetAgentCapabilities` version. - The codemod passes are chained: generative UI first, then Angular chat configuration. - `f7480aa80b` makes the threads controller and the agent resolver read `ɵruntimeInfo`. `6c501597fb` makes `chat-configuration.ts` use the shared `ɵMOBILE_MAX_WIDTH_QUERY`. - `d107031158` moves one Vue render-count test baseline after the first render. The provider from the earlier layer now connects on mount, and that causes one extra render. ## Related PRs and Issues - Stack: PR 5 of 10, "2.0 core pipeline". Base PR: `alem/2.0-core-generative-ui`. ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing Commands run on this layer before the merge of PR 4: - `nx run-many -t check-types` for core, react-core, vue, angular: pass. - `nx run @copilotkit/react-core:test`: 2477 passed, 35 skipped. `nx run @copilotkit/vue:test`: 1439 passed. Core and Angular tests: pass. - Codemod `pnpm test`: 53 fixtures pass, 3 of them new. `kiira check` on `chat-2.0.mdx`: 7 snippets pass. `pnpm check:public-api-manifest`: current. - Not run by me after the merge of PR 4 and the three follow-up commits. CI is the check for those. Manual test: 1. Start a React or Vue app with a runtime URL. Call `useAgent()` and add a message to the agent before the runtime connects. 2. When `isReady` becomes `true`, confirm that the message is on the real agent. Before this PR, React and Vue lost it. 3. In an Angular app, open the Inspector and pick "View in app" on a thread. Confirm that the chat loads that thread. How this PR makes testing easy: new core unit tests for each module (`agent-resolver.test.ts`, `threads-controller.test.ts`, `chat-configuration.test.ts`, `threads-drawer.test.ts`, `inspector-thread-override.test.ts`, `agent-helpers.test.ts`), new adapter tests for each behavior change, and three codemod fixtures under `codemods/v2-migration/tests/ts/angular-chat-configuration*`. ## Risk / rollback Risk is medium. The three frameworks now share one implementation of agent resolution, thread lists, and chat configuration, so a core fault shows in all three. The stand-in hand-off bridges stay subscribed for the life of the core and copy each registered-agent update into the stand-in. To undo, revert this PR. Later layers of the stack build on it. ## Public API change **Before** (Angular subclass) ```ts export class RoutedChatConfiguration extends CopilotChatConfiguration { openFromRoute(threadId: string) { this._setOverride(threadId, true); } } ``` **After** ```ts export class RoutedChatConfiguration extends CopilotChatConfiguration { openFromRoute(threadId: string) { this.setActiveThreadId(threadId, { explicit: true }); } } ``` ### Angular bundle fix (added after the PR opened) Commit `56ba9982d9` (`perf(angular)`) fixes a CI failure on this layer, "Build canonical Angular browser artifact". Angular's chat configuration imported the core store from the core index, and it also injected `CopilotKit`. That pulled all of core, AG-UI and zod into the showcase's initial bundle, which was 2,711,682 raw bytes against a 1,633,493 cap. Initial-path Angular modules must not import core at runtime (see `config.ts`, #1937). - New public subpath `@copilotkit/core/chat-configuration`. It exports only `ɵChatConfigurationStore`, and the manifest lists it. - Angular `chat-configuration.ts` imports the store from that subpath. It hands the store to a small root service, `ɵOpenThreadBindings`, and does not inject `CopilotKit`. `CopilotKit` connects its core to that service when it is created. - Behavior: a chat configuration created before `CopilotKit` now registers its thread when `CopilotKit` is created, not straight away. A new test covers this order. - Result: the initial bundle is 1,503,074 raw bytes. All Angular tests and the type check pass. ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | **#8174 (this PR)** | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added Angular migration support for chat configuration overrides, including guidance for custom overrides. * Agent context values can now be supplied as JSON-compatible values and are serialized consistently across frameworks. * Vue’s agent hook now exposes whether the resolved agent is ready. * Inspector thread-view requests can select a chat thread and report connection failures. * **Improvements** * Chat configuration, agent resolution, thread lists, and thread-drawer actions now share behavior across frameworks. * Thread-list configuration errors and unsupported mutations are handled consistently. * **Documentation** * Expanded the 2.0 migration guide with framework-specific behavior and migration details. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…e message view into core (#8179) The chat's send, attachment, thread-switch and message-list logic now lives in `@copilotkit/core`. React, Vue and Angular call it, so a fix there applies to all three. This fixes Vue sends that did not wait for the active run (#5195), Angular welcome-screen gating, and other drift between the three frameworks. This is PR 6 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-core-agents-threads`. Merge it after PR 5. ## What does this PR do? New internal (`ɵ`) modules in `packages/core/src/chat/` and `packages/core/src/core/`: - `attachment-queue.ts`: `ɵAttachmentQueue`. It checks file type and size, shows a placeholder per file, uploads (`onUpload` or base64), and hands ready files to the next message. - `session.ts`: `ɵcreateChatSubmitter`. It owns send, suggestion, stop and transcription: the send queue, the upload guard, and the 5-second notice. - `thread-switch.ts` and `thread-baseline.ts`: `ɵThreadSwitchCoordinator` and `ɵresetAgentThreadBaseline`. They pin the thread, reset the agent on a switch to a fresh thread, and keep teardowns in order. The run handler uses the same reset. - `message-view.ts`: `ɵcreateMessageViewModel` for tool-call layout, the "turn" work summaries, and the cursor rule. - `chat-view.ts`: `ɵgetChatViewState` (suggestions, welcome screen, connecting indicator, padding) and the pin-to-send tracker. Fixes: - Vue now waits for the thread to load and for the active run before it sends (#5195). Before, a send in Vue stopped a thread load that was in progress, and the chat could stay in "connecting". - Vue and Angular show `chatAttachmentsUploadingText` and keep the typed text when an upload blocks a send. - Angular hides the welcome screen while the thread loads and when `[welcomeScreen]` is `false`. It also takes `[autoScroll]` instead of always scrolling. - Angular logs a failed detach on a thread switch instead of leaving an unhandled rejection. Not in this PR: a core connect/reconnect controller (item 6 of the slice). It is designed but not built. React, Vue and Angular still own their connect code. BREAKING CHANGE: behavior only. No public export, prop or input is removed or renamed. Migration steps are on the chat 2.0 migration page: - [Sending messages](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-session/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#sending-messages): a send waits for the active run and the thread load. Blank text and loading suggestions are not sent. Angular sends text untrimmed. - [Attachment uploads](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-session/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#attachment-uploads): `processFiles` needs `enabled: true`. Vue and Angular honor `maxConcurrentUploads`. - [Welcome screen and suggestions in Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-session/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#welcome-screen-and-suggestions-in-angular): a custom `<copilot-chat-view>` must pass `[isRunning]` and `[isConnecting]`. - [Console messages](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-chat-session/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#console-messages): new text for the Vue duplicate-ID warning and the Angular connect failure. ## Related PRs and Issues - Stack: PR 6 of 10, "2.0 core pipeline". Base `alem/2.0-core-agents-threads` (PR 5). - #5195 (Vue send did not wait for the active run). ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Merge notes - Angular `copilot-chat.ts` combines this layer's change with layer 5's. This layer makes a send wait for the thread to load. Layer 5 makes a failed connect end the Inspector's "view thread" override. Both now sit in the same connect callback. - A carry-over commit (`f47b53867f`) moves the React-only "connecting" indicator rule from 2.0.0 into core's `ɵgetChatViewState`, with tests. React reads it from there. ## Testing Commands run: - Before the stack merge: `nx run` build, check-types and test for `@copilotkit/core`, `@copilotkit/react-core`, `@copilotkit/vue` and `@copilotkit/angular`. Build and check-types passed. Tests: core 119/119 files, React 2482 passed. Vue 1437/1438 and Angular 675/677. The failures were timeouts under machine load (`build-entries`, `inspector.spec`, `mcp-apps-widget.spec`), and they passed when run alone. - On this head (`f47b53867f`): `nx run-many -t check-types` for the four packages passed. `nx run @copilotkit/core:test`: 146/146 files passed. `nx run` build for React, Vue and Angular passed when run one at a time. In one parallel run, the builds read a stale core `dist` and failed. - `nx run @copilotkit/v2-migration:test`: 52/52. `pnpm check:public-api-manifest`: current. - Not run: `nx run @copilotkit/vue:lint`. It fails with 197 errors on lines this PR does not touch. Core, React and Angular have no lint target. I ran repo `oxlint` on the changed files: 0 errors. Manual test (Vue, #5195): 1. On the base branch, open a Vue chat with an explicit `threadId` that has history. Send a message while the history still loads. The load stops, and the chat can stay in "connecting". 2. On this branch, do the same. The message waits until the history loads, then sends. 3. While a reply streams, send a second message. It sends after the first run ends. It does not stop that run. How this PR makes testing easy: core unit tests for every new module in `packages/core/src/chat/__tests__/` (`attachment-queue`, `session`, `thread-switch`, `message-view`, `chat-view`) and `packages/core/src/core/__tests__/thread-baseline.test.ts`. New Angular specs cover `[welcomeScreen]`, `[autoScroll]` and the connecting welcome gate. ## Risk / rollback The main risk is send timing. A send now waits for the active run in Vue. If a run never ends (for example, a human-in-the-loop prompt with no answer after its component unmounts in Vue), later sends wait too. To roll back, revert this PR. It has no data or config migration. ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | **#8179 (this PR)** | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Chat submission, stopping, transcription, attachment handling, and thread switching now follow consistent behavior across React, Vue, and Angular. * Chat views now provide more consistent welcome-screen, suggestion, connecting-indicator, and message-layout behavior, with configurable welcome screens and auto-scrolling in Angular. * **Bug Fixes** * Sends wait for active runs and thread connections; failed connections and attachment uploads are handled more consistently. * **Documentation** * Updated the chat 2.0 migration guide with cross-framework behavior and Angular welcome-screen details. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…ntrollers into core (#8178) Merge this after PR 6. It moves the chat input, the audio recorder, and the DOM work of the sidebar, popup, lightbox, attachment previews, and scroll-to-bottom from React, Vue, and Angular into `@copilotkit/core`. The three framework packages now only connect that core logic to their own reactivity, so a fault in this logic is fixed in one place. It also fixes several drifts between the frameworks. PR 7 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-core-chat-session` (PR 6). ## What does this PR do? New core code (internal `ɵ` exports): - **Slash-command menu** (`chat/composer.ts`): flatten, rank, query parsing, highlight, and key handling. React and Vue use it. - **Chat input auto-grow and layout** (`chat/composer-layout.ts`): `ɵcreateComposerAutosize` measures the text box, caps it at `maxRows` (default 5), picks the compact or expanded layout, and watches the elements with one `ResizeObserver`. All three use it. - **Audio recorder** (`chat/audio-recorder.ts`): `ɵAudioRecorder` and `ɵcreateWaveformRenderer`. All three use it. `AudioRecorderError` is now one class in all packages. - **DOM controllers** (`chat/dom.ts`): docked sidebar margins, popup dismiss, the lightbox morph and focus trap, document preview URLs, and the scroll-to-bottom check. Bugs fixed: - Angular: padding that the browser did not report made the text box max-height `NaN`. - Angular: the text box measured its max-height only once, so a later `inputMaxRows` was ignored. - Vue: on a phone, each keystroke emptied the text box to measure it. This moved the caret to the end. - React and Vue: a second `start()` during the microphone prompt opened a second stream. - React: the docked sidebar set the page margins to `""` and lost the margins that the page had. - Vue: a pointer down in a chat popover closed the popup. - React: the attachment preview had no dialog role, no focus trap, and no focus return. - React and Vue: text previews decoded base64 as Latin-1, so text outside ASCII showed incorrectly. The full list of behavior changes per framework is in the commit messages. ### Breaking changes BREAKING CHANGE: Angular `CopilotChatTextarea` has no `ngAfterViewInit()` method. It measures its height after each render. 1. Run the v2 codemod. In a subclass of `CopilotChatTextarea`, it deletes `super.ngAfterViewInit()` and removes `override` from `ngAfterViewInit`. See [the codemod transform](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-composer-dom/codemods/v2-migration/scripts/deprecated-apis.ts) and [its fixture](https://github.com/CopilotKit/CopilotKit/tree/alem/2.0-core-composer-dom/codemods/v2-migration/tests/ts/angular-textarea-lifecycle). 2. Read [Chat UI in 2.0](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-composer-dom/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx) for the behavior changes. The new sections: - "Angular text box" - "Audio recorder": a second `start()` rejects, and the Angular `error` output emits every failure. - "Docked sidebar": one owner, margins come back, the 767px breakpoint, and Vue server rendering. - "Slash commands in React", "Attachment previews", and "Scroll to bottom in Angular" (12px, was 10px). ## Related PRs and Issues - Stack: PR 7 of 10, "2.0 core pipeline". Base: `alem/2.0-core-chat-session` (PR 6). Merge after PR 6. ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Merge notes - `chat-2.0.mdx` was rebuilt when PR 6 was merged into this branch. The sections of this layer are appended at the end of the page. - Commit `97870c944e` makes `composer-layout.ts`, `dom.ts`, and the Angular sidebar use `ɵMOBILE_MAX_WIDTH_QUERY` from the chat-primitives layer. No `(max-width: 767px)` string remains in TypeScript source, except the definition of that constant. - `packages/core` gets `jsdom` as a dev dependency for its DOM tests. The lockfile change is only that dependency. ## Testing Commands run: - On this layer before the merge of PR 6: `pnpm nx run-many -t build,test,lint,check-types` for core, react-core, vue, and angular. Build and check-types passed. Core tests passed (1942). The other failures were: - 3 recharts Chart tests in react-core. They also fail without this layer. - Timeouts on a loaded machine. They passed when I ran them again with a longer timeout. - `vue:lint`, with 197 errors that were already on the base. - On head `97870c944e`, after the merge of PR 6: `pnpm nx run-many -t check-types` for the same four projects passed. The core chat tests passed (577). - Codemod: `pnpm --filter @copilotkit/v2-migration test` passed, with the new fixture. `check-types` passed. - Docs: `pnpm kiira check` on `chat-2.0.mdx` passed. `pnpm check:public-api-manifest` reports the manifest is current. Not run after the merge of PR 6: the full test suites of react-core, vue, and angular. CI is the check for those. Manual test: 1. Open a chat with a sidebar, type a long line, then a line break. The text box grows to 5 rows, then scrolls. The buttons move below it. 2. On a narrow window (767px or less), the text box sits above the buttons. 3. Open the docked sidebar, then close it. The page margin comes back to what it was before. 4. In React, open an image attachment. Focus moves to the close button, Tab stays inside, and Escape returns focus to the thumbnail. 5. Start a voice recording, then stop it. The waveform moves, and the recording is transcribed. How this PR makes testing easy: - New core tests: `composer-slash`, `composer-layout`, `audio-recorder`, `dom` (jsdom). - New adapter tests for each behavior change. For example `Lightbox.test.tsx`, `copilot-chat-audio-recorder.spec.ts`, `stick-to-bottom.spec.ts`, and the sidebar margin tests. - The codemod fixture `tests/ts/angular-textarea-lifecycle`. ## Risk / rollback Risk is medium. The three frameworks now share one chat input, one recorder, and one set of DOM controllers, so a core fault shows in all three. The most visible change is the docked sidebar: only one docked sidebar adds a page margin, and the margin now follows viewport changes. To undo, revert this PR. Later layers of the stack build on it. ## Public API change **Before** ```ts @component({ selector: "textarea[appTextarea]", template: "" }) export class AppTextarea extends CopilotChatTextarea { override ngAfterViewInit(): void { super.ngAfterViewInit(); } } ``` **After** ```ts @component({ selector: "textarea[appTextarea]", template: "" }) export class AppTextarea extends CopilotChatTextarea {} ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | **#8178 (this PR)** | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Improved chat input autosizing and slash-command menus across Angular, React, and Vue, including support for commands that load after text is entered. * Added accessible lightbox dialogs with focus management and clearer labels for attachment previews. * Improved audio recording, waveform display, attachment previews, and docked sidebar behavior across frameworks. * **Bug Fixes** * Prevented typed text from being cleared on phone-sized screens and kept popovers from dismissing the chat popup. * Sidebar margins are restored when the sidebar closes or is removed. Scrolling now treats distances up to 12px as at the bottom. * **Documentation** * Expanded the chat 2.0 migration guide with framework-specific migration details. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…shared engine (#8177) React, Vue, and Angular now render assistant markdown with one engine from `@copilotkit/markdown`. Markup and URL sanitization live in one file, so a fix there reaches all three frameworks. Angular drops `marked` and DOMPurify and keeps KaTeX math. This is PR 8 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-core-composer-dom`. Merge it after PR 7. ## What does this PR do? **What moved where** - `packages/markdown/src/render/` is new and has no framework code. `render-tree.ts` decides the elements, sanitized attributes, click actions, text segments for the fade-in, and the caret position. `parser-session.ts` parses only the appended text (this logic was inside the React hook). - The React and Vue renderers now only map that tree to elements and VNodes. - New subpath **`@copilotkit/markdown/dom`**: `createStreamingMarkdownDomRenderer(container)`. It patches the DOM by key, so text on screen keeps its nodes and does not fade in again. It creates nodes through `container.ownerDocument`, so it works on server DOMs. - Angular `components/chat/markdown.ts` uses the DOM renderer. `marked` and `dompurify` are removed from `@copilotkit/angular`. - The parser gets GFM task lists (`listItem.checked`) and an opt-in `enableMath` option for `math` nodes. Angular turns math on and typesets it with `katex.render()`, which builds DOM nodes, so no HTML string is parsed. **Bugs fixed** - Vue never showed the streaming caret. The boolean prop became `false`, so `caret ?? isStreaming` never fell back. - Vue did not pass `onLinkClick` / `onCitationClick` to the renderer. - Vue rendered an empty root for empty content. React rendered nothing. Both render nothing now. - Vue re-parsed the whole message on every update. It now parses only the new text. - Angular had no caret and no fade-in, and its parser and sanitizer were different from React and Vue. **Breaking changes** BREAKING CHANGE: the `@copilotkit/markdown` AST node types include `math`, and a task-list item has `checked` with no `[ ]` / `[x]` marker in its text. Exhaustive switches on `node.type` and maps keyed by every node type stop type-checking. The codemod marks these imports with a `TODO(copilotkit-2.0)` comment ([codemod](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-markdown-dom-renderer/codemods/v2-migration/scripts/codemod.ts), [fixtures](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-markdown-dom-renderer/codemods/v2-migration/tests/ts/markdown-ast)). These changes are behavior only, so no codemod applies. The steps are in the migrate section ["Rendering changes in 2.0"](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-markdown-dom-renderer/showcase/shell-docs/src/content/snippets/shared/migration-guides/migrate-markdown-renderer.mdx), on the `/migrate/markdown-renderer` page: - **Angular:** raw HTML in model output shows as text. A single newline is a soft break, not `<br>`. The table header is in `<tbody>`, and links open in a new tab. - **Angular:** `marked` and `dompurify` are no longer installed. Apps that import them must add them. - **React and Vue:** task-list items render as disabled checkboxes. - **Vue:** strikethrough is `<s>`, not `<del>`. The caret shows while the latest message streams. The renderer adds a `<style>` element next to its root. **Merge notes** Merging layer 7 into this branch conflicted only in the codemod `README.md` and `agents/skill/v2-migration/references/mappings.md`. Both sides were kept. My web-inspector change moved with its file to `packages/web-inspector/src/domains/announcements/markdown.ts`. ## Related PRs and Issues - PR 7 of the stack: `alem/2.0-core-composer-dom` (base of this PR) ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run** - On the merged head `2e1ffc0f95`: `nx run-many -t test -p @copilotkit/markdown @copilotkit/v2-migration` passes (215 tests, 73 codemod fixtures). The web-inspector announcements tests pass (93). - Before the layer 7 merge: build, check-types, publint, and attw pass for markdown, core, react-core, vue, angular, and web-inspector. Tests pass for all of them except react-core. - react-core has 3 failures in chart tests (`chart.test`, `chart-scatter.test`, `data.test`). They failed the same way on the old base. `2.0.0` has since fixed them, and they pass on the stacked heads. - `@copilotkit/vue:lint` reports 197 errors, all in files this PR does not touch. - `pnpm check:public-api-manifest` passes. kiira type-checks the changed doc pages (8 of 8 snippets). - I did not run the full suite again after the layer 7 merge. **Manual test** 1. Start the Angular demo and send a message with `**bold**`, a task list, and `$x^2$`. 2. While the reply streams, see the caret and the fade-in. After it finishes, see the checkbox and the typeset math. 3. In the Vue demo, send a long reply. Before this PR, no caret showed. Now the caret shows until the reply finishes. **How this PR makes testing easy** - Unit tests for the render tree, parser session, DOM renderer, and parser additions in `packages/markdown/src`. - Parity tests for the Vue renderer and the Vue default renderer. The Angular renderer spec covers caret, empty content, and rendering without a global `document`. - Codemod fixtures in `codemods/v2-migration/tests/{ts,tsx}/markdown-ast*`. ## Risk / rollback Medium risk for Angular, because its markdown markup changed (see the breaking changes above). React output is the same except for task lists and the default code block (data attributes, and the caret while it streams). To undo, revert this PR. Layers 9 and 10 build on it, so revert them first. ## Public API change **Before** ```ts import type { StreamingMarkdownAstNode } from "@copilotkit/markdown"; function label(node: StreamingMarkdownAstNode) { if (node.type === "list-item") return "item"; // task state only in the text: "[x] done" return node.type; } ``` **After** ```ts import type { StreamingMarkdownAstNode } from "@copilotkit/markdown"; import { createStreamingMarkdownDomRenderer } from "@copilotkit/markdown/dom"; function label(node: StreamingMarkdownAstNode) { if (node.type === "math") return node.display ? "display math" : "inline math"; if (node.type === "list-item") return node.checked === undefined ? "item" : "task"; return node.type; } const renderer = createStreamingMarkdownDomRenderer(element); renderer.render({ content: "**Hi**", caret: true }); ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | **#8177 (this PR)** | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added a framework-independent DOM renderer for streaming Markdown, with support for custom rendering, link and citation callbacks, and optional math rendering. * Markdown parsing now supports math when enabled and checked or unchecked task-list items. * React, Vue, and Angular assistant messages now share consistent streaming Markdown behavior, including caret display and task-list rendering. * **Improvements** * Raw HTML is displayed as text, and unsafe links and image URLs are filtered. * Added migration guidance and automated TODO comments for code that reads Markdown AST types. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
…to-start into core (#8182) React, Vue, and Angular now get suggestions, Inspector mounting, and the `learning` auto-start from `@copilotkit/core` and `@copilotkit/web-inspector`. A fix in that logic is now one change, not three. Vue and Angular get the Inspector rules that React had, and Angular gets `configureSuggestions` and a `learning` option. This is PR 9 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-markdown-dom-renderer`. Merge it after PR 8. ## What does this PR do? **What moved where** - **Suggestions:** `ɵbindSuggestionsConfig` (core) owns config dedupe, the target agent, global and targeted reloads, a retry for agents that were running, and the wait for a dynamic config's agent. `ɵsubscribeToAgentSuggestions` keeps a view's list and loading flag current. `useConfigureSuggestions` and `useSuggestions` in React and Vue now only call these. - **Inspector visibility:** `shouldEnableInspector` (`@copilotkit/shared`) takes an optional `hostname` and allows only `localhost`, `127.0.0.1`, and `[::1]`. - **Inspector mounting:** `ɵmountInspector` (`@copilotkit/web-inspector/mount`) loads the element, sets the core before it connects, replays an early open request, reports visibility, and removes the element. The adapters keep only the host element. - **Learning:** `ɵLearningAutoStarter` (core) owns the generated Trajectory ID, start and stop, the warnings, and the guard for a late start failure. The React and Vue providers only call `update()` and `dispose()`. **Bugs fixed** - Vue and Angular mounted the Inspector on any development host. They now use React's loopback rule. - Vue and Angular showed the message "Inspect" action while the Inspector was hidden. - Angular dropped an open request made before the Inspector loaded. - Vue `<CopilotKitInspector>` now gives event listeners, such as `@cpk-inspector-visibility-change`, to the `cpk-web-inspector` element. - React `useConfigureSuggestions` ignored the provider `agentId`. Vue did not load a global config while the agent list was empty, and did not wait for a dynamic config's agent. **New subpath:** `@copilotkit/web-inspector/mount`. It has no runtime import of the Inspector bundle, so the Inspector stays a lazy chunk. The public API manifest has the new entry. **Breaking changes** BREAKING CHANGE: the changes below are behavior only, so no codemod applies. The steps are in the migrate page `/migrate/chat-2.0`: - [Inspector in Vue and Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-suggestions-inspector-learning/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#inspector-in-vue-and-angular): the Inspector mounts only on loopback hosts, even with `enableInspector: true`. The message "Inspect" action shows only while the Inspector is visible. Vue `<CopilotKitInspector>` does not give object values (for example `:style="{ ... }"`) to the element. - [Suggestions](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-suggestions-inspector-learning/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#suggestions): in React, a global config outside a chat loads for the provider `agentId`, not `"default"`. Agents skipped while running reload when the run ends. A `deps` change no longer reloads a second time on mount. **Merge notes** - The web-inspector architecture test on `2.0.0` rejected a top-level `src/mount.ts`. A `fix(web-inspector)` commit moved it to `src/shell/mount.ts`. It still builds to `dist/mount.*`, so the `./mount` export is unchanged. - `ɵLearningProp` was removed in favor of D's identical `ɵCopilotKitLearningOptions`. - A's Angular toolbar test now stubs a visible Inspector, because the shortcut only shows while the Inspector is visible. ## Related PRs and Issues - PR 8 of the stack: #8177 (`alem/2.0-markdown-dom-renderer`, base of this PR) ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run** - Before the layer 8 merge: `nx run-many -t build,check-types,test,publint,attw` passed for core, react-core, vue, angular, shared, and web-inspector, except for the items below. - react-core chart tests (`chart.test`, `chart-scatter.test`, `data.test`) and the Vue `build-entries` test failed under full-suite load. They pass when run alone, on this branch and on the base commit. - `@copilotkit/vue:lint` fails with the same errors on the base commit, in files this PR does not touch. - `pnpm check:public-api-manifest` passes. `pnpm --filter @copilotkit/v2-migration test` passes (36 of 36). - On the merged head `89939875ea`: the Angular `inspector.spec.ts` passed 5 of 5 times with `--skip-nx-cache`. It also passed 5 of 5 on a clean `origin/2.0.0`. I did not run the full suites again after the layer 8 merge. **Manual test** 1. Start the Vue or Angular demo and open it at `http://localhost:<port>`. The Inspector button shows. 2. Open the same app at your LAN address (for example `http://192.168.1.20:<port>`). Before this PR, the Inspector mounted. Now it does not. 3. On `localhost`, hide the Inspector. The "Inspect" action on assistant messages is hidden too. 4. In React, put `useConfigureSuggestions` with static suggestions outside a chat, under `<CopilotKitProvider agentId="support">`. The suggestions show for the `support` agent. **How this PR makes testing easy** - Core unit tests: `packages/core/src/core/__tests__/suggestions-binding.test.ts` and `learning-autostart.test.ts`. - `packages/web-inspector/src/__tests__/mount.spec.ts` and the `shouldEnableInspector` hostname tests in `packages/shared`. - Adapter tests for each behavior change: Vue `CopilotKitInspector.test.ts` and `CopilotKitProvider.test.ts`, and Angular `inspector.spec.ts`, `configure-suggestions.spec.ts`, and `learning.spec.ts`. ## Risk / rollback Medium risk for the Inspector in Vue and Angular: developers who open the app on a LAN address or a tunnel no longer see it. Suggestions and learning keep the same public options. To undo, revert this PR. Layer 10 builds on it, so revert layer 10 first. ## Public API change Angular gets the suggestions and learning options that React and Vue have. **Before** ```ts const copilotKit = inject(CopilotKit); const id = copilotKit.addSuggestionsConfig({ instructions: "Suggest next steps" }); copilotKit.reloadSuggestions("default"); inject(DestroyRef).onDestroy(() => copilotKit.removeSuggestionsConfig(id)); ``` **After** ```ts provideCopilotKit({ runtimeUrl: "/api/copilotkit", learning: true }); readonly suggestions = inject(CopilotKit).configureSuggestions(() => ({ instructions: `Suggest next steps about ${this.topic()}`, available: "always", })); ``` ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | **#8182 (this PR)** | Suggestions, Inspector, learning | PR 8 | | 10 | #8180 | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added a learning option for Angular that can automatically start and manage trajectory capture. * Added Angular support for configuring suggestions, including reactive updates and lifecycle cleanup. * Added a shared Inspector mounting experience across Angular, React, and Vue, with visibility-aware actions and queued open requests. * Inspector display is limited to development on loopback hosts; explicit enablement does not override this restriction. * **Documentation** * Expanded the migration guide with Inspector and suggestions behavior across frameworks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AlemTuzlak
added a commit
that referenced
this pull request
Nov 4, 2026
Interrupts and human-in-the-loop (HITL) now run in `@copilotkit/core`. React, Vue, and Angular only project core state and render it. This also fixes four bugs that were in one or two of the three copies. This is PR 10 of 10 in the "2.0 core pipeline" stack. Base: `alem/2.0-core-suggestions-inspector-learning`. Merge it last. ## What does this PR do? Moved into core: - **`ɵInterruptController`** (`core/interrupt-controller.ts`): collects legacy and standard interrupts per run, runs `enabled` and `handler`, records answers in `ɵInterruptState`, adds tool results, and starts one resume run. `useInterrupt` (React, Vue) and `InterruptController` / `injectInterrupt` (Angular) project its snapshot. - **A generic interrupt slot** on `CopilotKitCore` (`ɵsetInterruptPayload`). React `setInterruptElement` and Vue `setInterruptState` store their value in it. Their names and events do not change. - **`ɵHumanInTheLoopRegistry`** (`core/human-in-the-loop.ts`, on `core.ɵhumanInTheLoop`): each HITL call waits by tool call id until `respond`. `ɵbuildHumanInTheLoopTool` and `ɵhitlRenderProps` build the tool and the render props for all three frameworks. - **Pending HITL calls in the run handler**: when no registration of a tool is left, its waiting calls fail with `Human-in-the-loop interaction aborted`. Bugs fixed: - **Angular `"*"` HITL tools hung.** The handler waited for the name `"*"`, but `respond` sent the called tool name. - **Parallel HITL calls in React and Vue.** One resolver per hook let a second call replace the first, so the first call never finished. - **Vue interrupt state.** Vue did not use the shared interrupt state. It did not add tool results, use saved frontend results, show pending interrupts after a reload, or catch a throw from `enabled` or `handler`. - **Waits after unmount.** When a HITL component unmounted with no answer, the run never ended. The Vue chat waits for that run, so the next message stayed queued. Now core rejects the wait and the run ends. ### Breaking behavior changes The exports and types do not change. Some behavior changes. Each item has a section in the migration guide: - **HITL calls end on abort:** a call fails with `Human-in-the-loop interaction aborted` when the provider unmounts, when you call `dispose()` on the core, or when its tool is unregistered and no other component registers it. See [Human-in-the-loop tools](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-interrupts-hitl/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#human-in-the-loop-tools). - **Interrupts in React and Vue:** a `RUN_ERROR` event removes the interrupt, and an answer after a thread change does not resume. See [Interrupts in React and Vue](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-interrupts-hitl/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#interrupts-in-react-and-vue). - **Interrupts in Vue:** `enabled` runs one time for each interrupt, and the `interrupt` ref is `null` while `enabled` returns `false`. See [Interrupts in Vue](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-interrupts-hitl/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#interrupts-in-vue). - **Angular scroll threshold:** the chat view uses the core default of 12px from the end. See [Scroll to bottom in Angular](https://github.com/CopilotKit/CopilotKit/blob/alem/2.0-core-interrupts-hitl/showcase/shell-docs/src/content/docs/migrate/chat-2.0.mdx#scroll-to-bottom-in-angular). BREAKING CHANGE: HITL calls now fail with "Human-in-the-loop interaction aborted" when their tool is unregistered, the provider unmounts, or the core is disposed. React and Vue interrupts clear on RUN_ERROR and after a thread change. Vue runs `enabled` one time per interrupt. To migrate, follow the "Interrupts and human-in-the-loop" section of `migrate/chat-2.0.mdx`. No codemod: no export or type changes. ### Merge notes These files combine this layer with layer B (tool-call rendering): - **`core/run-handler.ts`:** keeps this layer's pending-HITL table and microtask check. B's executing-call cleanup sits beside it in the same `finally` block. - **React `lib/react-core.ts` and Vue `lib/vue-core.ts`:** B's `ɵRendererRegistry` plus this layer's core interrupt slot. - **Angular `buildHumanInTheLoopToolCall`:** uses B's core-built props and this layer's core `respond`. ### Top-of-stack cleanup commits - The React and Vue `normalize-auto-scroll.ts` and Vue `is-mobile-viewport.ts` shims are removed. - Vue `CopilotChatView` uses `ɵisScrolledToBottom`. - Angular `autoScroll` goes through core's `ɵnormalizeAutoScroll`. - Angular `[threshold]="10"` is removed, so the chat view uses the core default of 12px. The migration page has a note. ## Related PRs and Issues - PR 9 of the stack (base): `alem/2.0-core-suggestions-inspector-learning` ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [x] 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](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md) - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Testing **Commands run** on head `b254db2961`: - `pnpm nx run-many -t test,check-types -p @copilotkit/core @copilotkit/vue @copilotkit/angular @copilotkit/react-core --skip-nx-cache` - core: 155 of 155 test files pass. - Angular: 74 of 74 test files pass. - react-core: 197 test files pass, 2 skipped. - Vue: 1459 of 1460 tests pass. `src/__tests__/build-entries.test.ts` hit its 5 s timeout under load. Run alone, it passes (2 of 2). - `@copilotkit/markdown:check-types` failed once in this run, because the worktree had a stale install after the stack merge. Re-run on this head with `--skip-nx-cache`, it passes. - `pnpm nx run-many -t check-types -p @copilotkit/core @copilotkit/vue @copilotkit/angular @copilotkit/react-core --exclude-task-dependencies --skip-nx-cache`: pass. - `pnpm nx run @copilotkit/v2-migration:test`: 15 tsx and 39 ts cases pass. No codemod change in this layer. - `pnpm check:public-api-manifest`: current. **Manual test** (Vue, unanswered prompt): 1. In a Vue app, call `useHumanInTheLoop` in a component that you can hide with `v-if`. 2. Ask the agent to call that tool. The HITL card shows. 3. Hide the component. Do not answer. 4. Send a new message. Before this PR, the first run never ended. Now the call ends with `Human-in-the-loop interaction aborted` and the message sends. **How this PR makes testing easy:** - `packages/core/src/core/__tests__/interrupt-controller.test.ts` and `human-in-the-loop.test.ts` test the new core modules. - `packages/core/src/__tests__/core-hitl-unregister.test.ts` tests rejection on unregister, a same-pass re-registration, and no resurrection. - `packages/angular/src/lib/human-in-the-loop.spec.ts` covers the `"*"` hang and parallel calls. - React `use-human-in-the-loop.e2e.test.tsx` and Vue `use-human-in-the-loop.test.ts` cover parallel calls and the Vue unmount case. ## Risk / rollback - **Risk:** apps that depend on the earlier behavior listed above. For example, a test that expects a HITL call to stay open after its component unmounts. - **Merge order:** this layer sits on 9 others. Merge it last. - **Rollback:** revert this PR. The layers below it do not depend on it. ## Stack Merge in this order. Each PR's base is the PR above it. | # | PR | Area | Base | |---|---|---|---| | 1 | #8181 | Chat primitives | `2.0.0` | | 2 | #8173 | Provider config and runtime info | PR 1 | | 3 | #8176 | Tool-call rendering | PR 2 | | 4 | #8175 | A2UI, Open Generative UI, MCP Apps | PR 3 | | 5 | #8174 | Agents, threads, chat configuration | PR 4 | | 6 | #8179 | Chat sends, attachments, message view | PR 5 | | 7 | #8178 | Chat input, recorder, DOM controllers | PR 6 | | 8 | #8177 | Markdown renderer | PR 7 | | 9 | #8182 | Suggestions, Inspector, learning | PR 8 | | 10 | **#8180 (this PR)** | Interrupts and human-in-the-loop | PR 9 | **Stack verification.** After each merge, the stack builder ran these on this layer's head before pushing it, all with `--skip-nx-cache`: build, check-types and tests for core, react-core, vue and angular, plus the packages this layer touches; the codemod tests; oxlint; and `check:public-api-manifest`. On the top layer it also ran publint, attw, and the shell-docs tests and build. All passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This was referenced Nov 5, 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.
Generative UI logic now lives once in
@copilotkit/coreand@copilotkit/a2ui-renderer. React, Vue and Angular only render it. The change covers A2UI, Open Generative UI and MCP Apps. It also fixes two bugs: Vue A2UI button clicks reached the agent with no action, and Angular sent the A2UI catalog context to every agent (#5369).This is PR 4 of 10 in the "2.0 core pipeline" stack. The base is
alem/2.0-core-tool-call-rendering. Merge it after PR 3.What does this PR do?
What moved into shared code:
@copilotkit/core,ɵexports): reada2ui_operations, find the surface of an operation (nested id first, OSS-1048), the paint check, the{ userAction }envelope plusɵrunA2UIActionwith theonActioninterceptor, and the development warnings.ɵA2UIActivityController): building, retrying and failed states, the retry reveal timer, debug exposure, skeleton rows, and the hand-off from the loader to the painted surface (8 s fallback).@copilotkit/a2ui-renderer/engine(no React, no core): validate and apply operations (A2UIOperationApplier) and the basic catalog style rules.@copilotkit/a2ui-renderer/engine-core: surface diagnostics andAGUISendStateSnapshotconversion. They use@copilotkit/core, so they are not in/engine.@copilotkit/a2ui-renderer/catalog-schema):buildA2UIContextEntries,filterCatalog, andA2UICatalogController. The controller registers catalog components for the Inspector, filters out the disabled ones, and scopes the context to the runtime's A2UI agents.generateSandboxedUitool, the context entries, placeholder rotation, andɵMcpAppHost(iframe, size, loading and error state).Bugs fixed:
forwardedProps.a2uiAction.userAction, so the agent got no action. Vue now sends the envelope.core.a2uiAgents, as React and Vue do (Runtime info flattens per-agent A2UI scoping — a2ui catalog/schema/guidelines context (~30KB) is injected into every agent's runs #5369).New options (additive):
a2ui.onActionon the React, Vue and Angular providers.Related PRs and Issues
alem/2.0-core-tool-call-rendering(PR 3).Checklist
!(for examplefeat(react-core)!: ...) and the description has aBREAKING CHANGE:line with migration steps. See VERSIONING.mdBreaking changes
BREAKING CHANGE: the Vue and Angular
OpenGenerativeUIContentSchemaandGenerateSandboxedUiArgsSchemaare Standard Schemas, not zod schemas. ThefilterCatalogtype parameter is the catalog type. AngularCopilotA2UIRecoveryno longer exposes its internal state members. Theopen-generative-ui-placeholdertest id is removed. Runnpx codemod @copilotkit/v2-migration, then follow the generative UI 2.0 migration guide.OpenGenerativeUIContentSchema,GenerateSandboxedUiArgsSchema(Vue, Angular) have no zod methods["~standard"].validate(value)filterCatalog<T>(…)type argumentCopilotA2UIRecovery:lifecycle,retryRevealed,debugExposure,label,phase,failureDiagnostics,retryDiagnosticsremovedopen-generative-ui-placeholderremovedThe codemod step is
codemods/v2-migration/scripts/generative-ui.ts. The guide also lists the changes that need no code change: label text, the Angular MCP iframe class, and behavior that is now the same in all three frameworks.Public API change
Before
After
Merge notes
refactor(a2ui-renderer,angular)commit makes the A2UI catalog controller and the Angular A2UI and Open Generative UI checks readɵruntimeInfo.@copilotkit/a2ui-renderernow depends on@copilotkit/coreand@copilotkit/shared. Only the/engine-coreand/catalog-schemasubpaths import them. The main entry,/engine, and the UMD bundle do not.@copilotkit/a2ui-renderer/engineand@copilotkit/a2ui-renderer/engine-core./engine-corewith a dynamic import. This keeps core out of the initial bundle of an app that renders A2UI surfaces. The Angular showcase initial bundle is 1,499,242 bytes. Without this, it was 2,234,669 bytes and failed the performance budget.Testing
Commands run. The first five ran on
219ae349ff, before the stack merge. The last two ran onf4175efd5c.nx run-many -t build,test,check-types,publint,attw,compat-checkfor core, a2ui-renderer, mcp-apps-renderer, react-core, vue and angular: passed.nx run @copilotkit/vue:lint: fails on about 45 files. This layer did not add these errors.nx run-many -t test,check-types,validate --projects=@copilotkit/v2-migration --skip-nx-cache: 54 fixtures passed.nx run repo-scripts:check-docs-snippets: 1615 snippets passed.pnpm check:public-api-manifest: current.pnpm --dir showcase/angular build(includes the bundle budget): passed, 1,499,242 raw bytes, cap 1,633,493.nx run-many -t test,check-types --skip-nx-cachefor angular, core, a2ui-renderer, react-core and vue: passed.Manual test.
a2uiAction.userAction. Before this PR, it was missing.How this PR makes testing easy. Core has unit tests for each new module in
packages/core/src/a2ui/__tests__andpackages/core/src/open-generative-ui/__tests__. a2ui-renderer has tests insrc/engine/__tests__andsrc/__tests__/catalog-controller.test.ts. mcp-apps-renderer hassrc/__tests__/host.test.ts. Each framework has renderer tests for the fixes above, and the codemod has 4 new fixtures.Risk / rollback
The risk is medium. A2UI rendering, the Open Generative UI sandbox and MCP Apps now run through new shared code in all three frameworks. A regression shows up in all three frameworks at the same time. To undo, revert this PR. If a later stack layer is already merged, revert that layer first.
🤖 Generated with Claude Code
Summary by CodeRabbit