Commit Graph

1601 Commits

Author SHA1 Message Date
Benjamin Taylor dd96b6e6a8 feat(runtime, react): Some cleanup 2026-03-03 21:33:18 -06:00
github-actions[bot] 7abe7f89d1 chore(post-release): update version to 1.52.2-next.1 2026-03-03 23:59:38 +00:00
Benjamin Taylor d814a36050 feat(runtime, react): Simplify expected Phoenix server message format to avoid many on() listeners 2026-03-03 17:23:52 -06:00
Jordan Ritter d6db65ab78 fix: deduplicate messages to prevent duplicate React keys in CopilotChatMessageView (#3305)
## Summary

- During streaming, `AbstractAgent.addMessage()` can push messages with
the same `id` into the messages array, causing React duplicate key
warnings in `CopilotChatMessageView`
- Added Map-based deduplication in the message rendering pipeline —
last-write-wins for duplicate IDs
- Includes dev-mode `console.warn` when duplicates are detected, to
surface the upstream cause without breaking the UI

Fixes #3258

## Test plan

- [x] Unit tests added verifying deduplication behavior
- [x] Warning logged in development when duplicates detected
- [x] Full package test suite passes
- [x] Build passes

🤖 Generated with [Claude Code](https://claude.ai/code)
2026-03-03 19:12:04 -04:00
Benjamin Taylor f59a4b22fa feat(runtime, react): Consolidate MockChannel and MockSocket into test-utils 2026-03-03 16:41:30 -06:00
Maxim f9ff467473 Merge branch 'main' into fix/issue-3258 2026-03-04 02:03:34 +04:00
Benjamin Taylor 856fc2e490 feat(runtime, react): Add beginnings of web socket-enabled Intelligence agent hook and agent runner 2026-03-03 16:01:01 -06:00
Maxim a9f518d77c Merge branch 'main' into fix/enums-in-convert-json-schema-to-zod-schema 2026-03-04 01:55:22 +04:00
Benjamin Taylor 18b71200b6 feat(runtime, react): Add scaffold and some initial work on intelligence agent runner and hook 2026-03-03 15:43:44 -06:00
Benjamin Taylor 764ec32427 feat(runtime, react): Add beginnings of web socket-enabled Intelligence agent hook and agent runner 2026-03-03 15:40:40 -06:00
Maxim b696313847 Merge branch 'main' into feat/after-run-middleware-callbacks 2026-03-04 01:27:33 +04:00
github-actions[bot] 4b78d74e11 chore(post-release): update version to 1.52.2-next.0 2026-03-03 17:40:27 +00:00
Maxim a827813bbe Merge branch 'main' into tyler/fix-thing 2026-03-03 21:23:04 +04:00
Alem Tuzlak e41c3ea213 refactor: revert useAgent to useMemo approach, keep stability tests
Reverts the resolveAgent extraction from the previous commit — the
original useMemo + ref cache already provides referential stability.
All 4 stability tests pass without the refactor.
2026-03-03 17:03:22 +01:00
Alem Tuzlak 4387188b2f test: add tests for useAgent referential stability during connection lifecycle 2026-03-03 16:39:35 +01:00
Alem Tuzlak 7ab1e61c29 Merge branch '3169-multiple-requests' of github.com:IanVS/CopilotKit into 3169-multiple-requests 2026-03-03 14:37:13 +01:00
Alem Tuzlak 9f3f613dd9 chore: fix failing test in CI and lint issues 2026-03-03 14:36:58 +01:00
Alem Tuzlak b55a88a13f Merge branch 'main' into 3169-multiple-requests 2026-03-03 14:32:14 +01:00
Alem Tuzlak 0c472fe567 chore: update tsconfig paths and improve CopilotKitProvider stability 2026-03-03 14:27:19 +01:00
Jordan Ritter bf3d32200c fix: add Nx implicit dependency on runtime for build ordering
runtime-client-gql's graphql-codegen needs the schema file generated
by @copilotkit/runtime's build. After removing the package.json
dependency (to fix bundle size), Nx no longer orders the builds
correctly. implicitDependencies restores build ordering without
reintroducing the runtime dependency.
2026-03-02 19:45:06 -08:00
Jordan Ritter 6471a912f1 fix: remove spurious @copilotkit/runtime dependency from runtime-client-gql (#3225)
The @copilotkit/runtime-client-gql package listed @copilotkit/runtime as
a dependency, but none of its source files actually import from it. This
caused the entire server-side runtime (graphql-yoga, hono, openai, shiki,
reflect-metadata, etc.) to be pulled into client bundles, exploding
bundle size from ~600kb to 4.3mb+.

Remove the unused dependency from package.json, the UMD externals list,
and the UMD globals map in tsdown.config.ts.
2026-03-02 19:45:06 -08:00
Jordan Ritter 2beb93c39e fix: rewrite dead via.placeholder.com URLs to placehold.co in A2UI Image component (#3109) 2026-03-02 19:45:03 -08:00
Jordan Ritter 78c7bdf26c fix: add missing CSS classes to v2 CopilotChat components (#3133) 2026-03-02 19:44:58 -08:00
Jordan Ritter 676b1f9392 fix: use Map-based dedup and add dev warning for duplicate messages 2026-03-02 19:44:56 -08:00
Jordan Ritter 2dc5910a8a fix: deduplicate messages to prevent duplicate React keys in CopilotChatMessageView (#3258) 2026-03-02 19:44:56 -08:00
Maxim 6cfdd3464c fix: formatting 2026-03-02 23:51:19 +04:00
Maxim 30c2ae95ba test: add enum preservation tests for convertJsonSchemaToZodSchema
Move V1 test file to __tests__/ directory and add test verifying that
string enum constraints round-trip through convertJsonSchemaToZodSchema.
Add equivalent test for V2's copy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:47:54 +04:00
Maxim 662007f264 fix: preserve enum constraints in convertJsonSchemaToZodSchema
The string case in convertJsonSchemaToZodSchema produced z.string() and
silently discarded the enum field. When useCopilotAction defines a
parameter with enum: ["todo", "done"], the constraint was lost during
the V1→V2 bridge and never reached the runtime payload.

Add an enum check before falling through to z.string() in both V1
(shared/json-schema.ts) and V2 (agent/index.ts) copies of the function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:47:54 +04:00
Alem Tuzlak 933914df0f Merge branch 'main' into tyler/fix-thing 2026-03-02 18:06:19 +01:00
Alem Tuzlak 3a161ac6af Merge branch 'main' into worktree-validated-greeting-quokka 2026-03-02 18:05:13 +01:00
Maxim c2ce3f19ae fix(runtime): use expect.any(Response) in middleware tests for Node 20/22 compat
The afterRequestMiddleware receives a cloned Response (via c.res.clone()),
whose internal stream controller functions have different names across
Node versions. Using expect.any(Response) avoids brittle deep equality
on Response internals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:43:34 +04:00
Maxim c56386e9db docs: update afterRequestMiddleware reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:43:34 +04:00
Maxim 3057c7c9ec feat(runtime): expose messages in afterRequestMiddleware
Clone Response before body is consumed, parse SSE stream to reconstruct
messages. Adds messages, threadId, runId to AfterRequestMiddlewareParameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:43:34 +04:00
Alem Tuzlak 93edc65f23 fix: update build process and add outputs for snapshot caching 2026-03-02 11:42:22 -05:00
Alem Tuzlak 45652201a9 Merge branch 'main' into worktree-validated-greeting-quokka 2026-03-02 15:23:37 +01:00
g97iulio1609 8cf1bb8b4a fix(react): replace static KaTeX CSS import with dynamic runtime injection
Next.js rejects global CSS imports from within node_modules, causing
build failures when consumers use @copilotkitnext/react:

  Global CSS cannot be imported from within node_modules.
  Location: node_modules/@copilotkitnext/react/dist/index.mjs

The static `import 'katex/dist/katex.min.css'` in
CopilotChatAssistantMessage.tsx gets preserved in the dist bundle
(tsdown unbundle mode), triggering the Next.js css-npm restriction.

Replace with a useKatexStyles() hook that dynamically imports the CSS
at runtime via useEffect. Dynamic imports bypass Next.js static
analysis and load the stylesheet lazily when the component mounts.

Fixes #2851
2026-02-28 02:59:17 +01:00
Tyler Slaton 7e792a8ec5 fix(react): address issue with isModelOpen test
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-02-27 18:24:44 -05:00
Tyler Slaton 12fb5ea6bf fix(react): add backwards compat for disclaimer prop on chat components
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-02-27 18:16:49 -05:00
Tyler Slaton 089e4f3370 fix(react): [data-copilotkit] scoping to avoid leaking base styles
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-02-27 18:09:51 -05:00
Tyler Slaton f1eaa4c214 fix: ensure setModalOpen is always defined in useCopilotChatConfiguration
The shouldCreateModalState guard introduced in #3101 made setModalOpen
and isModalOpen conditionally undefined when isModalDefaultOpen wasn't
explicitly passed. This broke programmatic modal control for anyone
using useCopilotChatConfiguration outside of CopilotPopup/CopilotSidebar.

Reverts to the simpler ?? fallback pattern: each provider always has
modal state, preferring parent state when available, falling back to
its own internal state otherwise. Initial state still respects the
local isModalDefaultOpen prop (fix from 76e381f78).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:55:00 -05:00
github-actions[bot] aeac645881 chore(post-release): update version to 1.52.1 2026-02-27 20:04:51 +00:00
Alem Tuzlak cc0b6b0a91 Merge branch 'main' into 3169-multiple-requests 2026-02-27 15:32:17 +01:00
Alem Tuzlak fc5fbc7fe3 Merge branch 'main' into 3169-multiple-requests 2026-02-27 15:21:13 +01:00
Markus Ecker 39722ecbe4 Merge branch 'main' into mme/ag-ui-0.0.46 2026-02-27 15:13:22 +01:00
github-actions[bot] d523d6cc68 chore(post-release): update version to 1.52.1-next.1 2026-02-27 14:12:29 +00:00
Markus Ecker 979511a900 chore: upgrade AG-UI to 0.0.46 2026-02-27 14:47:50 +01:00
Alem Tuzlak b555ac4b69 fix(react-core): allow overriding useSingleEndpoint in CopilotKit provider
The V1 CopilotKit provider hardcoded useSingleEndpoint={true}, preventing
users from opting into REST transport mode. Now passes through the user's
prop value, defaulting to true for backward compatibility.
2026-02-27 13:36:06 +01:00
github-actions[bot] 0cf39911a0 chore(post-release): update version to 1.52.1-next.0 2026-02-27 03:53:52 +00:00
Tyler Slaton 6fb4f6518c fix(css): address imcompat with CJS
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-02-26 19:50:26 -08:00
Jordan Ritter a3fbf467aa feat: add selfManagedAgents prop to React and Angular providers (#3285)
## What does this PR do?

Add `selfManagedAgents` prop.

## Related PRs and Issues

- https://copilotkit.slack.com/archives/C075NF9SN01/p1771967940173989
2026-02-26 18:55:49 -04:00