Commit Graph

236 Commits

Author SHA1 Message Date
tylerslaton 4394f9c81d chore: release monorepo v1.62.3 2026-07-08 16:17:36 +00:00
Benjamin Taylor 5994bfe482 Merge origin/main into ben1/ent-1018-stateless-suggestions
Syncs the branch with main (304 commits) to resolve CI type-check failure.
main changed extractForwardableHeaders to require a forwarding policy and
added the mergeForwardableHeaders helper (#5712); handle-suggest now uses
mergeForwardableHeaders(agent.headers, request, runtime.forwardHeadersPolicy ??
resolveForwardHeadersPolicy(undefined)) to match the run handler — fixing the
drift and adopting the server-headers-win / infra-header denylist behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 17:40:50 -05:00
Benjamin Taylor 9f938e89cf refactor(suggestions): stream stateless /suggest over SSE and forward consumer state
Rework the stateless /suggest transport to reuse the AG-UI SSE pipeline
instead of a buffered JSON response, resolving the streaming + state review
feedback:

- server runs the provider agent directly and streams its events via
  createSseEventResponse (the runner's event pipeline minus GLOBAL_STORE
  persistence), gated with captureTelemetry:false so suggestions stay out of
  run telemetry
- client drives a stock HttpAgent against /agent/:id/suggest, so chips stream
  progressively via onMessagesChanged and the run never routes through the
  Intelligence websocket delegate (still no thread persistence)
- forward the consumer's deep-cloned messages + state onto the suggestion run
  (was state: {}), matching the clone fallback

Net -68 LOC of production code; the stateless and fallback paths now share one
runAgent flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 17:24:46 -05:00
Benjamin Taylor 0b4f6ca392 fix(threads-drawer): clear stale fetch-more error, trap Escape while confirming, shield rows behind open menu (ENT-1051)
Addresses PR #5823 review (MikeRyanDev + marthakelly):

- core/threads.ts: a full-list refetch (filter-change / retry) now clears
  fetchMoreError on both listRequested and listSucceeded, so the inline
  'couldn't load more - retry' banner no longer survives onto a fresh list.
- web-components: Escape while the confirm-delete <dialog> is open is now
  consumed by a confirm guard in the host keydown handler; previously the
  bubbled keydown fell through to the mobile branch and closed the whole drawer
  along with the confirmation.
- web-components: an open kebab popover now shields the rest of the list -
  .list.menu-open .row:not(.menu-open) gets pointer-events:none so other rows
  no longer reveal their kebab or paint a host ::part(row):hover background
  around/behind the menu. Click-away dismissal is preserved via the existing
  document pointerdown handler.
- README: drop the removed --cpk-drawer-rail-width from the documented tokens.

Tests: core clears-fetchMoreError-on-refetch; web-components Escape-while-
confirming, confirm-dialog backdrop-click, menu-open row shield; Angular
scoped-chat-input focus (ancestor copilot-chat-view over the global fallback).
Menu-shield verified live in the langgraph-js example (:3002).
2026-07-07 14:01:12 -05:00
Benjamin Taylor 9407cfdd7d fix(core,react,vue,angular): CR round 1 — fetchMoreError + Angular open-state/focus + parity nits [ENT-1051]
D2 — wire fetchMoreError end-to-end:
- core: add a dedicated `fetchMoreError` channel to the thread store, tracked
  separately from the initial-list `error`. `nextPageFailed` now writes
  `fetchMoreError` (was `error`), so a paginated-load failure preserves the
  loaded list and drives the element's inline "couldn't load more — retry"
  panel instead of a full-panel error. Cleared on fetch-more request (retry),
  on success, and reset on context change / stop. New symbols:
    * `ThreadState.fetchMoreError`
    * `ThreadSelectors.fetchMoreError` + `ɵselectFetchMoreError`
  Call sites of `ɵselectFetchMoreError`:
    * packages/core/src/threads.ts (export)
    * packages/react-core/src/v2/hooks/use-threads.tsx (selector read)
    * packages/vue/src/v2/hooks/use-threads.ts (bindThreadStoreSelector)
    * packages/angular/src/lib/threads.ts (bridge to signal)
    * packages/vue/src/v2/hooks/__tests__/use-threads.test.ts (core mock)
  Call sites of `ThreadSelectors.fetchMoreError` (mock objects updated):
    * packages/core/src/__tests__/core-thread-store-auto-unregister.test.ts
    * packages/core/src/__tests__/thread-store-registry.test.ts
- react/vue/angular: expose `fetchMoreError` on the hook/composable/store and
  push it onto `el.fetchMoreError`, making the dead `retry{scope:"fetch-more"}`
  handler reachable. Initial-list error behavior unchanged.

D1 — Angular wrapper open-state coordination: drive `el.open` from the config's
`drawerOpen` (default CLOSED) so the element no longer springs open full-screen
and scroll-locks on mobile load; handle `(open-change)` -> `config.setDrawerOpen`
with a provider-less local-state fallback; call `config.registerDrawer()` with
cleanup on destroy. The config's drawer members were fully functional (only
marked "RESERVED/unwired") — wiring them makes them consumed, so their comments
were updated accordingly (no reservation conflict).

D3 — Angular focus-return: add a `findChatInput` scoped to the Angular chat
selectors (`copilot-chat-view` container, `textarea[copilotChatTextarea]`) and
focus it on thread select, mirroring React/Vue.

A6 — react wrapper comment rot: "nine outbound events" -> "eleven" (2 spots).

DEFAULT_AGENT_ID parity (react): import `DEFAULT_AGENT_ID` from
`@copilotkit/shared` instead of hardcoding `"default"` (equal value).

Angular test isolation: three list-path tests now set `licenseStatusSignal`
explicitly instead of relying on inherited module-level state.

Tests: core 552, react-core 1417, vue 1068, angular 176 — all pass;
check-types passes for all four packages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 11:12:29 -05:00
Markus Ecker 7b72bd491a Merge branch 'main' into mme/memory-core 2026-07-03 10:20:47 +02:00
BenTaylorDev a2cabd9455 chore: release monorepo v1.62.2 2026-07-02 22:23:11 +00:00
Markus Ecker 01469359a8 merge: integrate origin/main into mme/memory-core
Resolve the single conflict in packages/web-inspector/src/index.ts by keeping
both additions: this branch's CpkMemoryList memory-tab element and main's
ɵCpkThreadDetails back-compat alias (independent top-level declarations).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 17:26:01 +02:00
Benjamin Taylor 95345f10ef test(suggestions): cover header/credential forwarding, multi-route dispatch, 405, explicit-false; fix comments 2026-07-02 09:32:30 -05:00
Benjamin Taylor d440b30e51 fix(core): treat aborted-signal fetch failures as expected; cover suggest error-body branches 2026-07-02 09:32:30 -05:00
Benjamin Taylor 5a57fb8bab fix(core): harden stateless suggestions (single-route fallback, loading balance, abort detection, response guards) 2026-07-02 09:32:29 -05:00
Benjamin Taylor 629f7208d8 feat(core): generate suggestions via stateless /suggest when advertised 2026-07-02 09:32:28 -05:00
Benjamin Taylor b8cf717a5a feat(core): surface the runtime suggestions capability 2026-07-02 09:32:28 -05:00
Maximiliano Korp 12739f9b42 fix(core): gate idle reconnect fallback by cursor 2026-07-01 11:07:07 -07:00
Maximiliano Korp 9a173f1e45 fix(core): harden Intelligence reconnect cursors 2026-07-01 11:07:07 -07:00
Maximiliano Korp ea0b903fb1 fix: harden passive reconnect completion gates 2026-07-01 11:07:07 -07:00
Maximiliano Korp ed7a1e5412 fix: isolate passive reconnect replay 2026-07-01 11:07:06 -07:00
Maximiliano Korp c606a93f44 fix: coalesce opaque thread reconnect cursors 2026-07-01 11:07:06 -07:00
Maximiliano Korp c300411619 fix: harden multidevice reconnect cursors 2026-07-01 11:07:06 -07:00
Maximiliano Korp 0fe0b4a1b2 fix: stabilize multi-device reconnect streaming 2026-07-01 11:07:06 -07:00
Maximiliano Korp 8eb9bd77cd fix: scope chat run-activity reconnects 2026-07-01 11:07:05 -07:00
Maximiliano Korp 7132026df4 fix: harden thread activity reconnects 2026-07-01 11:07:05 -07:00
Maximiliano Korp 2b99d96f46 test(core): guard intelligence connect completion semantics 2026-07-01 11:07:05 -07:00
Maximiliano Korp 481f67d9a8 feat(core): expose intelligence thread run activity notifications 2026-07-01 11:07:05 -07:00
tylerslaton 617e88a069 chore: release monorepo v1.62.1 2026-07-01 17:07:44 +00:00
MikeRyanDev ca836ff920 chore: release monorepo v1.62.0 2026-07-01 15:45:54 +00:00
serhiizghama f9bba02c20 fix(web-inspector): subscribe to the running clone via onAgentRunStarted
The inspector subscribed to AG-UI events only through onAgentsChanged, which
skips per-thread clones, leaving the event timeline empty during runs
(regression of #3872). Subscribe to the run instance reported by
onAgentRunStarted so its events are recorded.
2026-07-01 08:23:53 +07:00
serhiizghama 7f0ca7eabf fix(core): notify subscribers of the agent instance at run start
Add an onAgentRunStarted subscriber event fired from RunHandler.runAgent and
connectAgent with the instance that actually runs. Per-thread clones (from
useAgent) are not in the agent registry, so onAgentsChanged never fires for
them and subscribers that only track registry agents can't observe their run.
2026-07-01 08:23:53 +07:00
Benjamin Taylor f53a70c691 refactor(drawer): rename to CopilotThreadsDrawer / copilotkit-threads-drawer
Final naming decision. Renames the public component + element across the
board: React/Angular CopilotDrawer -> CopilotThreadsDrawer, the Lit element
copilotkit-drawer -> copilotkit-threads-drawer (tag, CopilotKitThreadsDrawer
class, COPILOTKIT_THREADS_DRAWER_TAG, defineCopilotKitThreadsDrawer), the
@copilotkit/web-components/drawer subpath -> /threads-drawer (+ src dir),
the CopilotThreadsDrawerRow directive / copilotThreadsDrawerRow input, and
all prose/test references. Generic types (DrawerThread, DrawerFilter),
--cpk-drawer-* tokens, and ::part names are unchanged. Behavior unchanged.
2026-06-30 17:34:39 -05:00
Markus Ecker 0e82ae01d6 test(memory): cover context/realtime/idempotency edges, store teardown, angular mutation parity 2026-06-30 16:49:42 +02:00
Markus Ecker f5086be167 feat(memory): surface realtime connection status (connecting/connected/unavailable) 2026-06-30 16:26:32 +02:00
Markus Ecker ac6e83ef79 feat(core): memory error registry with stable codes 2026-06-30 16:07:37 +02:00
Markus Ecker 9bb49d9c76 fix(core): reset availability on stop, per-store request counter, deep-freeze server state 2026-06-30 16:02:40 +02:00
Markus Ecker 95ed596d3a fix(memory): tighten mutation-response and runtime boundary validation 2026-06-30 15:58:35 +02:00
Markus Ecker 993a0f1322 docs(memory): align react/angular binding docs; re-export public memory types 2026-06-30 15:54:00 +02:00
Markus Ecker f5560ead32 fix(core): harden memory mutation/refresh paths (validate response, settle refresh on context switch, freeze server) 2026-06-30 15:38:10 +02:00
Markus Ecker 8907c41ff7 fix(core): scope memory availability to the list route; settle refresh on unavailable; treat 422 as not-configured 2026-06-30 15:27:32 +02:00
Markus Ecker 0e1fc83485 fix(core): session-guard mutations, handle credentials events, add getServerState 2026-06-30 14:59:49 +02:00
Markus Ecker 3c472bc581 test(core): import test() from vitest in memory.test
Three snapshot tests (lines 751/771/789) call test() while the file uses
explicit vitest named imports. They pass at runtime via vitest's global
but fail tsc check-types (TS2593). Add test to the import.
2026-06-30 13:53:43 +02:00
Markus Ecker 111aca5688 refactor(core): drop ɵ prefix from hook-facing memory types
Memory, NewMemory, MemoryChanges, MemoryKind, and MemoryScope are the
memory types surfaced by the useMemories / injectMemories hook result
shapes, so export them unprefixed as supported public API instead of
behind the ɵ "internal" marker. Internal memory plumbing (MemoryStore,
the selectMemories* selectors, state/context/event types,
createMemoryStore) keeps the ɵ prefix.

Updates the react-core and angular hook signatures, the web-inspector
Memories tab, and the affected tests to the unprefixed names.
2026-06-30 13:49:48 +02:00
Markus Ecker 0c1acf30c7 test(core): cover core-owned memory store singleton + context wiring 2026-06-29 15:34:54 +02:00
Markus Ecker 8650aa1129 feat(core): core owns a single user-scoped memory store (drop agentId registry) 2026-06-29 15:29:53 +02:00
Markus Ecker 35950615cf test(core): cover memory silent-degrade on unconfigured routes
Add three flat test cases verifying the silent-degrade contract:
404/501 list response sets available:false with no error; 500 response
sets error and keeps available:true; 404 subscribe response is silent
with no console.warn emitted.
2026-06-29 15:22:10 +02:00
Markus Ecker 4eadf9cbb5 feat(core): memory fetch/credentials tolerate unconfigured routes (404/501) 2026-06-29 15:19:51 +02:00
Markus Ecker 44147ff03a feat(core): add ɵselectMemoriesAvailable selector 2026-06-29 15:16:54 +02:00
Markus Ecker 8656aae530 feat(core): add listUnavailable/credentialsUnavailable actions and available state
Adds listUnavailable and credentialsUnavailable to memoryRestEvents, adds
available: boolean to MemoryState (defaulting to true), resets available to
true on contextChanged and listRequested, and handles listUnavailable by
clearing memories and setting available: false with a session guard.
2026-06-29 15:11:54 +02:00
Markus Ecker bb117b1ef7 Merge remote-tracking branch 'origin/main' into mme/memory-core
# Conflicts:
#	packages/core/src/index.ts
2026-06-29 13:37:52 +02:00
Markus Ecker 99b221d9e5 fix(core): memory socket never joined its channel (no realtime deltas)
The memory store's socket effect created the `user_meta:memories:<code>`
channel and observed its events, but never subscribed the join-outcome
stream — and `ɵphoenixChannel$` only calls `channel.join()` when that stream
is subscribed. So the socket connected but no `phx_join` was ever sent: the
gateway saw the connection, the channel was never joined, and saved memories
never pushed to the client (REST snapshot worked; live deltas silently never
arrived). The thread store joins because its merged `joinOutcome$` subscribes
the stream.

Merge `ɵjoinPhoenixChannel$(channel$)` into the socket effect's output so the
join actually fires; swallow a failed/timed-out join so a transient rejection
doesn't tear down the metadata stream (Phoenix re-attempts on reconnect). Add
a `joinCount` spy to MockChannel and assert the realtime test actually joins —
this regression passed before because the mock delivered events without a join.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:38:33 +02:00
Austin Merrick ca920066ac build(core): raise build heap ceiling to 8GB via cross-env
The @copilotkit/core build (tsdown with dts generation) has a working set
of about 3.45GB. Node's default old-space ceiling is roughly 4GB and CI pins
NODE_OPTIONS to 4096, leaving almost no headroom. Under nx run-many the build
competes for CPU with sibling builds, GC falls behind, and the process tips
over the heap limit. nx flags it as a flaky task and pre-commit/CI builds fail
intermittently with a V8 heap OOM.

Bake the ceiling into the core build script with cross-env so every invocation
path gets consistent headroom: local lefthook hooks, nx run-many, CI, and
direct pnpm build, on every platform including Windows. 8192 matches the value
already used by the e2e workflow and gives roughly 2x headroom over the working
set.

Scoped to core only; it is the single package that OOMs.
2026-06-25 14:01:39 -07:00
Markus Ecker 4211bd58d8 chore: format memory SDK files with oxfmt 2026-06-25 19:49:34 +02:00