Commit Graph

396 Commits

Author SHA1 Message Date
Maxim 3f1c16881e fix: replace as any cast with typed RunAgentInput factory in throttle tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:46:35 +02:00
Maxim b2bc508f95 test: add missing throttleMs edge case coverage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:11:31 +02:00
Maxim c2dcee2751 fix: unify effectiveThrottleMs to return 0, upgrade validation to console.error
Also fixes JSDoc inaccuracies: documents trailing-edge window restart,
uses enum names instead of callback names, adds notificationThrottle
interaction note.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:06:58 +02:00
Maxim 9b6d444c43 fix: trailing edge restarts throttle window to prevent back-to-back renders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:01:43 +02:00
Alem Tuzlak 401a27c981 fix: resolve rebase conflicts and format files
- Remove stale eslint-config-custom refs from package.json files
- Regenerate pnpm-lock.yaml
- Format agentcore and other files with oxfmt
2026-04-02 16:43:34 +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
Maxim a4109ad3be refactor: enhance message handling in useAgent tests
- Introduced message factory functions to eliminate `as any` type assertions for message literals.
- Updated test cases to utilize the new message factories for improved clarity and type safety.
- Added helper functions for subscriber notifications to streamline test setup.

This refactor improves code readability and maintainability in the test suite for the useAgent hook.
2026-04-02 16:33:13 +02:00
Maxim d1357083da fix: harden throttleMs implementation from code review
- Replace Date.now()-based throttle with flag-based leading+trailing
  pattern that is immune to wall-clock jumps
- Wrap throttleMs validation in useMemo to warn once per value change
  instead of on every render
- Remove phantom AbstractAgent.notificationThrottleMs JSDoc reference
- Reorder cleanup to clear timer before unsubscribing for safety
- Add tests for trailing-edge data freshness, timer precision, and
  dynamic throttleMs prop changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:13:56 +02:00
Maxim f2b148c0d2 fix: improve throttleMs validation, simplify handlers, add invalid-input tests
- Fix JSDoc to accurately describe behavior for negative/non-finite values
- Remove NODE_ENV guard so console.warn fires in all environments
- Use derived effectiveThrottleMs instead of mutating destructured param
- Simplify handler wrappers: direct references instead of arrow wrappers
- Remove stale comment about content stripping
- Add parameterized tests for invalid throttleMs (NaN, Infinity, -1, -Infinity)
- Fix misleading test comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:44:13 +02:00
Maxim 3cdaaf089d fix: consolidate throttleMs into single useEffect, add input validation and edge-case tests
Addresses code review findings:
- Merge two separate useEffect hooks into one to eliminate dual-subscription
  race window and simplify cleanup
- Add active boolean guard to prevent forceUpdate after unmount/re-run
- Validate throttleMs input (reject NaN, Infinity, negatives with dev warning)
- Expand JSDoc with scope, constraints, and notificationThrottleMs interaction
- Replace JSON.stringify(updateFlags) with direct ref in effect deps
- Strengthen unmount test with render counter instead of not.toThrow()
- Add 5 new test cases: explicit zero, rapid burst, new cycle after trailing,
  updates excluding OnMessagesChanged, subscription cleanup verification

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:34:43 +02:00
Maxim 30916a6ab7 feat: add throttleMs option to useAgent for streaming render throttling
Adds optional `throttleMs` parameter to `useAgent()` that coalesces
rapid onMessagesChanged notifications (per-token TEXT_MESSAGE_CHUNK
events) into fewer React re-renders using a leading+trailing throttle.

- throttleMs=0 (default): exact current behavior, zero overhead
- throttleMs>0: only onMessagesChanged is throttled; onStateChanged
  and onRunStatusChanged always fire immediately
- Leading+trailing: first call immediate, last call guaranteed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:09:17 +02:00
Claude 0d9e3b88f6 chore(post-release): update version to 1.55.0-next.8
The previous publish workflow released 1.55.0-next.8 to npm but the
post-release commit failed to push to main (blocked by branch
protection). This applies the version bumps and pre.json updates that
the workflow would have committed, unblocking future releases.

https://claude.ai/code/session_01N8sLK9h9p6FdRjyHqzKzVV
2026-04-02 02:23:27 +00:00
Claude d55ce2c87b fix: add React keys to CopilotMessages children to suppress warning
CopilotMessages received an array of children (memoizedChildren +
RegisteredActionsRenderer) without keys, causing a React "unique key prop"
warning in dev mode. Wrap memoizedChildren in a keyed Fragment and add a
key to RegisteredActionsRenderer.

https://claude.ai/code/session_01N8sLK9h9p6FdRjyHqzKzVV
2026-04-02 01:32:52 +00:00
Alem Tuzlak 2f38e945e2 feat(react-core): add useCapabilities hook 2026-04-01 18:34:20 +02:00
Alem Tuzlak 232c9eb994 chore: bump @ag-ui/core and @ag-ui/client to 0.0.49 2026-04-01 18:18:40 +02:00
Martha Schumann 092956d299 style: fix prettier formatting across all changed files 2026-03-30 13:09:10 -07:00
Martha Schumann 6395a9a42d style: fix prettier formatting in CopilotChatMessageView after merge 2026-03-30 13:04:44 -07:00
Martha Schumann 83f58ee3de Merge branch 'main' into fix/cpk-7155-thread-shared-state
Incorporates the V1/V2 flat package consolidation (96885b595). All our
thread-isolation changes auto-merged to the new package paths. Three
content conflicts resolved (import paths updated from @/ aliases to
relative paths and @copilotkitnext/* to @copilotkit/*):
- packages/react-core/src/v2/hooks/use-agent.tsx
- packages/react-core/src/v2/hooks/use-render-custom-messages.tsx
- packages/react-core/src/v2/components/chat/CopilotChatMessageView.tsx

File location conflict resolved: use-agent-thread-isolation.test.tsx
moved from packages/v2/react/... to packages/react-core/src/v2/...
2026-03-30 12:33:16 -07:00
github-actions[bot] a1edf59eae chore(post-release): update version to 1.55.0-next.7 2026-03-29 00:19:22 +00:00
Claude 1ceb963a84 Revert "fix: resolve changeset version errors from stale @copilotkitnext package refs"
This reverts commit 1f6ae0d629.
2026-03-28 17:04:55 -07:00
Claude 369266f1be fix: resolve changeset version errors from stale @copilotkitnext package refs
After the V1/V2 consolidation merge, several changesets still referenced
old @copilotkitnext/* package names that no longer exist. Fixed package
references and ran changeset version to apply pending version bumps.

https://claude.ai/code/session_01A5aahBWFTmLPR3xZSeh4SD
2026-03-28 17:04:55 -07:00
Tyler Slaton 96885b5959 refactor: consolidate V1/V2 packages into flat @copilotkit/* structure
Flatten all packages from packages/v1/* and packages/v2/* into packages/* —
every package now lives directly under the @copilotkit/ scope with no v1/v2
subdirectories.

- Move all v1 packages (react-core, react-ui, runtime, shared, etc.) from
  packages/v1/* to packages/*
- Absorb v2 react code into packages/react-core/src/v2/ (exported via /v2 subpath)
- Absorb v2 agent code into packages/runtime/src/agent/ (exported via /v2 subpath)
- Move v2 packages (core, angular, demo-agents, etc.) to packages/*
- Replace all @copilotkitnext/* imports with @copilotkit/* equivalents
- Keep @copilotkitnext/angular as the sole exception (angular remains on next)
- Update CI workflows, renovate config, release scripts for flat structure
- No public API surface changes — all exports fields are preserved

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-28 16:45:10 -07:00
Atai Barkai 5f3727dde8 move to CopilotKit subdirectory
.
2023-08-22 23:09:55 -07:00
Atai Barkai 853a2d7bad vercel.ai —> ^2.2, openAI —> ^4.0, dropped ‘openai-edge’ package
fix route.ts for opneai v4
2023-08-20 03:52:17 -07:00
Atai Barkai 76c97a1011 throw errors to reduce chance of shenannigans 2023-08-18 18:53:19 -07:00
Atai Barkai 7f80cefaaf minor
.
2023-08-18 18:40:05 -07:00
Atai Barkai 62c8375153 tree printing changes 2023-08-18 05:28:20 -07:00
Atai Barkai c5de7de1de add documentation 2023-08-15 06:30:57 -07:00
Atai Barkai c0e3c3ec53 when we can simply pass ‘default value’ by passing undefined, no need to re-specify the defualt value 2023-08-15 06:25:09 -07:00
Atai Barkai 1ab4b98b98 minor rearrange and comment for clarity 2023-08-15 06:07:24 -07:00
Atai Barkai 2b46479c03 copilot context takes categories, to allow for filtering of content 2023-08-14 22:50:40 -07:00
Atai Barkai 452c5eb20c global context now takes categories in initialization and in printing 2023-08-14 22:21:20 -07:00
Atai Barkai 4f19bd7bf8 publish packages 2023-07-18 23:32:25 -07:00
Atai Barkai 5474e93615 system message: add directions for funcs. and add max tokens to backend code
.
2023-07-18 12:55:39 -07:00
Atai Barkai 1befcaf145 upgrade ai package 2023-07-18 12:55:29 -07:00
Atai Barkai dc69ad3b84 wip: explicilty pass function descriptions
..

.
2023-07-18 12:55:28 -07:00
Atai Barkai 7a38756e4d make tree reducer pure 2023-07-17 12:43:04 -07:00
Atai Barkai e4faea4adf breakpoint debugging potentially works better? 2023-07-17 12:43:04 -07:00
Atai Barkai e25de82f0f upgrade tsup 2023-07-17 12:43:04 -07:00
Atai Barkai 168adf236c debugging problem seems ACTUALLY fixed this time. fingers crossed 2023-07-17 12:43:04 -07:00
Atai Barkai 74261cd73b wip 2023-07-17 12:43:04 -07:00
Atai Barkai a4b3cc44d6 breakpoints in libs actually working
.

.
2023-07-17 12:43:04 -07:00
Atai Barkai 1f1c385464 add sourcemap to tsconfig and to tsup config 2023-07-15 08:13:58 -07:00
Atai Barkai 40af06bb6b minor copilot optimizations 2023-07-15 03:26:17 -07:00
Atai Barkai 1c836e53a6 correct support for array type 2023-07-14 18:13:07 -07:00
Atai Barkai 03164e91c7 v0.2 turbo refactor 2023-07-13 16:08:04 -07:00