3119 Commits

Author SHA1 Message Date
Alem Tuzlak b433824476 Testing #3250 (#3253)
Triggering E2E for #3250
2026-03-05 17:29:00 +01:00
Ran Shem Tov e76e5e7c11 chore: use latest agui 2026-03-05 16:43:33 +01:00
Ran Shem Tov ff6130ece9 chore: formatting 2026-03-05 16:41:29 +01:00
Ran Shem Tov 947978e777 feat: enable mcp and a2ui middleware directly from copilotkit runtime 2026-03-05 16:41:29 +01:00
github-actions[bot] 3ff24c8b05 chore(post-release): update version to 1.52.2-next.2 2026-03-05 10:31:34 +00:00
Tyler Slaton 286ed58927 Merge branch 'main' into 3169-multiple-requests 2026-03-04 21:30:27 -05:00
Maxim 3ea54b2e65 Merge branch 'main' into feat/upgrade-ai-sdk 2026-03-05 01:27:05 +04:00
Ben Taylor ddea8d0f99 feat(runtime, react): Scaffold Intelligence runner and agent (#3348)
<!--
Thank you for sending the PR! We appreciate you spending the time to
work on these changes.

Help us understand your motivation by explaining why you decided to make
this change.


**Please PLEASE reach out to us first before starting any significant
work on new or existing features.**

By the time you've gotten here, you're looking at creating a pull
request so hopefully we're not too late.

We love community contributions! That said, we want to make sure we're
all on the same page before you start.
Investing a lot of time and effort just to find out it doesn't align
with the upstream project feels awful, and we don't want that to happen.
It also helps to make sure the work you're planning isn't already in
progress.

As described in our contributing guide, please file an issue first:
https://github.com/ag-ui-protocol/ag-ui/issues
Or, reach out to us on Discord: https://discord.com/invite/6dffbvGU3D


You can learn more about contributing to copilotkit here:
https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md

Happy contributing!

-->

## What does this PR do?

This PR adds an initial scaffolding of the CopilotKit Intelligence agent
runner and React agent classes.

Both will be part of the new threads-enabled feature set, and will be
iterated upon in subsequent PRs.

For this PR, the React agent is not tied into `useAgent`, so it cannot
currently be interacted with.

Also, in this PR, docs that describe the agent and runner architecture
are not updated, as it is assumed that these classes may change
substantially and rapidly in the very near term.

A big part of this PR is the integration of the Phoenix JS client SDK to
enable the IntelligenceAgent and IntelligenceAgentRunner to connect to
the Intelligence platform's Phoenix server. That allows threaded AG-UI
messages to be streamed from to and from the platform, instead of
directly from agent runner to client agent hook.

The message structure for the Phoenix connection is still in flux.

Note: while the SQLite-backed agent runner is in a separate package, the
IntelligenceAgentRunner was intentionally placed along side the
`ProxiedCopilotRuntimeAgent` to make it that much easier to switch from
the latter to the former if desired.

## Related PRs and Issues

- https://linear.app/copilotkit/issue/ENT-59
- https://linear.app/copilotkit/issue/ENT-54

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [ ] If the PR changes or adds functionality, I have updated the
relevant documentation
2026-03-04 14:05:17 -06:00
Maxim 9241c2b611 feat(runtime): upgrade AI SDK to v6 to match v2 agent 2026-03-04 15:02:37 -05:00
Maxim bdedf25f6d feat(agent): upgrade AI SDK to v6 for LanguageModelV3 compatibility 2026-03-04 15:02:16 -05:00
Tyler Slaton 7c87c4ac61 chore(runtime): fix linter issues
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-04 13:14:01 -05:00
Alem Tuzlak 910945f07a fix(runtime): update OpenAI import to use default export 2026-03-04 13:14:01 -05:00
Tyler Slaton aebb9b5918 fix(runtime): remove openai as a peerdep
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-04 13:14:01 -05:00
Benjamin Taylor 5322f2b3f0 feat(runtime, client): remove unhelpful void usage 2026-03-04 11:44:15 -06:00
Benjamin Taylor 18143c09be feat(runtime, react): Change executeAgentRun to use Observable semantics instead of Promise 2026-03-04 11:00:29 -06:00
Benjamin Taylor c6b8b5868c feat(runtime, react): Wrap Phoenix connection in an observable in run/connect 2026-03-04 10:32:47 -06:00
Benjamin Taylor 96c96c90cc feat(runtime, react): Remove some outlining comments and format others to be smaller 2026-03-04 09:02:15 -06:00
Alem Tuzlak 33372d2804 Merge branch 'main' into 3169-multiple-requests 2026-03-04 13:48:03 +01:00
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