274 Commits

Author SHA1 Message Date
Claude d849fae68b test: add LangGraph integration unit tests + dead code annotations
- Python SDK: 18 new tests for LangGraphAGUIAgent (custom event handling,
  emit filtering, state merging, copilotkit namespace)
- TypeScript SDK: 25 new tests for copilotkitCustomizeConfig and
  convertActionsToDynamicStructuredTools
- TypeScript Runtime: 27 new tests for event-source helpers
  (shouldEmitToolCall, getCurrentMessageId, getCurrentContent, etc.)
- TypeScript Runtime: expanded dispatch-event-filtering tests with
  custom event dispatch (manually_emit_message/tool_call/state, exit)
  and langGraphDefaultMergeState tests
- Dead code annotations: LangGraphAgent class and use_function_call=True
  branch annotated with TODO(ran-review) for Ran to verify

https://claude.ai/code/session_01BPMn7zhadhapfyyD8kYeAH
2026-04-03 22:44:09 +00:00
Ran Shem Tov aae2c5cee1 chore: use latest ag-ui langgraph version 2026-04-03 14:57:45 +02:00
Alem Tuzlak 79ce60c580 chore: migrate from eslint+prettier to oxlint+oxfmt
Replace eslint and prettier with oxlint and oxfmt for faster linting
and formatting across the monorepo. Remove all eslint and prettier
configs, dependencies, and related packages. Add .oxlintrc.json and
.oxfmtrc.json for the new tooling. Update CI workflows and lefthook
hooks accordingly. Reformat codebase with oxfmt.

https://claude.ai/code/session_01GMkSf29p78HuMR1mbXn8He
2026-04-02 16:39:05 +02:00
Tyler Slaton 368663dd08 fix(sdk-python): add missing import re in copilotkit_lg_middleware
The re module was used in _fix_messages_for_bedrock (re.compile) but
never imported, causing NameError at runtime when the middleware is
invoked. Bumps version to 0.1.83.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 16:42:56 -07:00
Tyler Slaton a33d24496b chore(sdk-python): bump version to 0.1.82
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-20 16:27:22 -07:00
Ran Shem Tov 4073d3d035 fix: deduplicate ToolMessages and tighten adjacent-only validation for Bedrock Converse API 2026-03-20 16:14:49 -07:00
Ran Shem Tov 3c98ceab9c chore: release py-sdk 0.1.81 2026-03-19 13:45:33 +01:00
Ran Shem Tov 2f2fdec7ee chore: fix python test ci process 2026-03-19 13:45:10 +01:00
Ran Shem Tov c3adbd4113 chore: release py-sdk 0.1.80 2026-03-19 13:00:14 +01:00
Ran Shem Tov 31a721cdae feat: re-export state streaming langgraph middleware 2026-03-19 12:58:55 +01:00
Ran Shem Tov 82eaf93f11 chore: release lg python sdk 0.1.79 2026-03-13 17:31:15 +01:00
Ran Shem Tov 4506570206 chore: use latest python langgraph ag-ui 2026-03-13 13:49:15 +01:00
Markus Ecker d6d2e2c96a Fix Bedrock Converse API compatibility in CopilotKitMiddleware
Add _fix_messages_for_bedrock() to handle three issues caused by
after_agent restoring frontend tool_calls to the checkpoint:

1. Strip unanswered tool_calls without matching ToolMessages (Bedrock
   rejects toolUse without a corresponding toolResult)
2. Sync msg.content tool_use blocks with msg.tool_calls
3. Fix tool_use/tool_call blocks with string input/args (must be dict)
2026-03-13 12:02:05 +01:00
Ran Shemtov de02e9cef0 Merge branch 'main' into fix/2667-langgraph-agui-agent-dict-repr 2026-03-11 16:27:00 +01:00
Maxim 46d58ac3bf chore(sdk-python): regenerate poetry.lock
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
Maxim c5ec0f8512 fix(sdk-python): guard assistant message with content check
Avoid emitting spurious empty assistant messages for tool-call-only
AIMessages (common with OpenAI models where content is empty string).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
Maxim 3b684d914b fix(sdk-python): always emit assistant message for AIMessages with tool_calls
langchain_messages_to_copilotkit previously skipped creating the assistant
message when an AIMessage had tool_calls, causing missing context in chat
history on reconnect. Also adds ActionExecutionMessage type guard in
copilotkit_messages_to_langchain to prevent KeyError on non-tool messages
with parentMessageId.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
Jordan Ritter 973b4e460e fix(sdk-python): loosen FastAPI version ceiling from ^0.115.0 to >=0.115.0,<1.0.0 (#3261)
## Problem

The Poetry caret constraint `^0.115.0` in `sdk-python/pyproject.toml`
resolves to `>=0.115.0,<0.116.0` for 0.x versions (per [PEP 440 / Poetry
docs](https://python-poetry.org/docs/dependency-specification/#caret-requirements)).
This blocks installation alongside any FastAPI release since **0.116.0
(June 2025)**.

Current stable FastAPI is **0.129.0** — 14 minor versions ahead of the
ceiling.

## Impact

- Cannot `pip install copilotkit` in any project using FastAPI >=0.116.0
- Multiple users blocked (see #2771 comments)
- Our production project has **~90 tests bypassed** with
`COPILOTKIT_AVAILABLE = False` guards because of this

## Fix

```diff
- fastapi = "^0.115.0"
+ fastapi = ">=0.115.0,<1.0.0"
```

This allows all current and future 0.x FastAPI releases while still
capping at the upcoming 1.0 major version boundary, which may introduce
breaking changes.

## Testing

- The SDK uses standard FastAPI features (routing, dependency injection,
middleware) that have been stable across all 0.11x–0.12x releases
- No FastAPI APIs used by the SDK were deprecated or removed in
0.116.0–0.129.0
- `ag-ui-langgraph` (also in deps) uses `>=0.115.0` without an upper
bound, so this change aligns the two constraints

## Note on `ag-ui-langgraph`

`ag-ui-langgraph[fastapi]` also depends on FastAPI. Its constraint is
already `>=0.115.0` (no ceiling), so this change to `copilotkit` is the
only fix needed.

Fixes #2771
2026-03-06 14:39:52 -04:00
Jordan Ritter 8bad9f30ac test: add unit tests for emit_messages/emit_tool_calls filtering
Tests the two bugs fixed in this PR:
1. Dict raw_event metadata must be read with .get(), not getattr()
2. Filtered events must return None (not ""), and run() strips them

Adds pytest as a dev dependency.
2026-03-06 08:32:06 -08:00
Valen 95fada4490 fix(sdk-python): fix emit_messages and emit_tool_calls config not working
Fixes #2066

## Problem

`copilotkit_customize_config(config, emit_messages=False)` does not work -
TEXT_MESSAGE_* events are still emitted despite the configuration.

## Root Causes

1. **Metadata Reading Bug**: In `langgraph_agui_agent.py`, the code uses
   `getattr(raw_event, 'metadata', {})` to read metadata, but `raw_event`
   is a dict, not an object. This should use `.get()` instead.

2. **Encoder Crash Bug**: When the filtering logic works (after fixing bug #1),
   it returns `""` (empty string) to skip dispatching events. However, this
   empty string gets yielded to the event encoder which expects event objects
   with `model_dump_json()` method, causing an `AttributeError`.

## Fixes

1. Changed metadata reading to handle both dict and object cases.
2. Changed return value from `""` to `None` for filtered events.
3. Added `run()` method override to filter out `None` values before yielding
   to encoder.
2026-03-06 08:29:04 -08:00
Alem Tuzlak f4e8fdf61f Merge branch 'main' into fix/prebuilt-agent-state-streaming 2026-03-02 18:06:02 +01:00
Tyler Slaton cc8c945893 refactor(docs): optimize structure, content and navigability
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-02 11:30:16 -05:00
Ran Shem Tov b21db3a8fc fix: do not override predict state metadata if no cpk prefixed metadata present 2026-03-02 13:30:33 +01:00
BreBryBro 62ba11fe1c fix(sdk-python): loosen FastAPI version ceiling from ^0.115.0 to >=0.115.0,<1.0.0
The Poetry caret constraint `^0.115.0` resolves to `>=0.115.0,<0.116.0` for
0.x versions, blocking installation alongside any FastAPI release since 0.116.0
(June 2025). This prevents adoption of the Python SDK in projects using current
FastAPI versions.

Change to `>=0.115.0,<1.0.0` to allow all 0.x releases while still capping
at the upcoming 1.0 major version boundary.

Fixes #2771
2026-02-23 16:19:04 -06:00
Ran Shemtov c07362d137 chore: release py sdk 0.1.78 (#3158) 2026-02-06 13:01:23 +01:00
Ran Shemtov f0a0ed5e60 feat: add app context readables to prebuilt LG agent middleware (#3155) 2026-02-06 12:49:04 +01:00
Ran Shem Tov 880bdd9907 chore: update all local dependencies of sdk-python 2026-01-29 11:27:08 -07:00
Ran Shem Tov 8ffb56a58e chore: update old dependencies of sdk-python 2026-01-29 11:27:08 -07:00
Ran Shemtov b49277b605 fix: update all agui langgraph dependencies (#3115) 2026-01-28 16:22:04 +01:00
Ran Shemtov f122e424c1 chore: release python sdk 0.1.75 (#2988) 2026-01-09 17:08:45 +01:00
Ran Shemtov 5a24f28894 feat: create copilotkit langgraph middleware (#2928) 2026-01-09 16:46:40 +01:00
Ran Shemtov ab6b00de57 chore: ease up ag-ui langgraph versions and release 0.1.74 sdk py (#2882) 2025-12-22 12:40:11 +01:00
Ran Shemtov 07a346dc64 release python sdk 0.1.72 (#2715) 2025-11-13 15:44:43 +01:00
Charlie Tonneslan fb613ad07a fix(sdk-python): add dict_repr method to LangGraphAGUIAgent
Adds missing dict_repr() method to LangGraphAGUIAgent class to fix
AttributeError when SDK tries to serialize agent info.

The method was present in the parent LangGraphAgent class but not
overridden in LangGraphAGUIAgent, causing failures when calling
sdk.info() with AGUI agents in FastAPI integrations.

Fixes #2667
2025-10-27 15:37:31 -04:00
Ran Shemtov 09b3ac6d44 release python sdk version 0.1.70 (#2657) 2025-10-24 11:50:43 +02:00
alexforrestf 8f76efc384 fix(sdk-python): compatibility with langchain v1 (#2633) (#2634) 2025-10-23 15:47:53 -04:00
Ran Shemtov 7455309ffa feat: use latest agui langgraph integration packages (#2588) 2025-10-09 18:04:09 -04:00
Ran Shemtov 223bfabee7 chore: release python sdk 0.1.66 (#2575) 2025-10-06 17:25:54 +02:00
Ran Shemtov a0155b03e6 fix: ensure stringified args when emitting tool calls (#2571) 2025-10-03 17:05:25 +02:00
Ran Shemtov 19cae45de6 fix: deprecate lg platform remote endpoint (#2540) 2025-09-30 12:13:30 +02:00
Ran Shemtov e7303691c3 Feat/upgrade agui lg integration packages (#2476) 2025-09-22 17:31:09 +02:00
Ran Shemtov 23fe6a1586 feat: upgrade agui packages (#2467) 2025-09-19 18:28:38 +02:00
Ran Shemtov b7bc3a03e9 feat: pass copilot readable context to agui agents (#2426) 2025-09-15 12:37:55 +02:00
Ran Shemtov 363a5544a0 chore: upgrade agui versions and release v0.1.63 (#2408) 2025-09-03 13:12:53 +02:00
Ran Shemtov 30a7e80b93 chore: release python sdk 0.1.62 which uses latest agui langgraph integration (#2350) 2025-08-28 10:41:09 +02:00
Ran Shemtov f566562de1 LangGraphJS support fix bundle (#2346) 2025-08-21 14:20:52 +02:00
Ran Shemtov 83139450fc chore: upgrade dependencies of coagents-research canvas demo (#2314) 2025-08-13 13:07:53 +02:00
Ran Shemtov dc6df18e63 feat: support latest lg agui (#2262) 2025-08-07 09:07:31 -04:00
Ran Shemtov b75c01ef0d chore: release python sdk version 0.1.56 (#2218) 2025-07-23 10:24:00 +02:00
Ran Shemtov 85e09eea2b fix(sdk-python): preserve state messages on subsequent get_state calls (#2216) 2025-07-23 10:21:38 +02:00