Commit Graph

449 Commits

Author SHA1 Message Date
Mark f452699510 Merge branch 'main' into fix/issue-5533-agentid-runtime-sync 2026-07-07 11:21:43 -07: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
Benjamin Taylor edd5dc1915 fix(threads-drawer): keep confirm dialog above chat input; fix stuck "Loading threads…" on cold load
Two related bugs in the React <CopilotThreadsDrawer> surface.

Bug 1 (web-components): the delete-confirm dialog's backdrop is
`position:absolute; inset:0; z-index:10`, but `.root` was not a positioning
context, so on desktop it resolved against the viewport and its low z-index
lost to the chat composer (`position:relative; z-index:20`), painting the
dialog UNDER the input. Anchor `.root` with `position:relative` to confine the
modal to the drawer column. Framework-agnostic (Angular wraps the same element).

Bug 2 (react-core): the provider's immediate runtime-info catch-up read grabbed
`a2uiEnabled` but omitted `licenseStatus`. The core starts its `/info` fetch
during construction, so on a cold first load (incognito/hard refresh) the
`Connected` event can fire before the passive subscribe effect runs; the event
is missed and license status stays null forever, pinning the drawer to
"Loading threads…". Read all three values immediately, mirroring the subscriber.
Angular/Vue already read licenseStatus in their catch-up, so they are unaffected.

Adds a deterministic regression test for the provider race (red before, green after).

ENT-1046

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 17:00:37 -05:00
Nathan 🔶 Tarbert 196ffd577d Merge branch 'main' into fix/issue-5533-agentid-runtime-sync 2026-07-02 14:58:05 -04: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
Nathan 🔶 Tarbert dedb3183d6 Merge branch 'main' into fix/issue-5533-agentid-runtime-sync 2026-07-01 16:08:55 -04:00
Maximiliano Korp 12739f9b42 fix(core): gate idle reconnect fallback by cursor 2026-07-01 11:07:07 -07:00
Maximiliano Korp c8d1c3bc53 fix: suppress duplicate wake reconnects 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 e9df9898bd test: stabilize hitl passive replay regression 2026-07-01 11:07:06 -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 d57f9336d9 feat(react-core): reconnect native threads on run activity 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
Ran Shemtov d0f4f27458 Merge branch 'main' into claude/happy-dirac-f6ed5e 2026-07-01 16:48:12 +02:00
Benjamin Taylor 74b8a1981f feat(drawer): default Upgrade CTA URL + Angular license gate
Add a `licenseUrl` property to the shared element (default
https://docs.copilotkit.ai/intelligence). The locked view's Upgrade CTA now
dispatches a cancelable `licensed` event carrying the url and, unless the
host calls preventDefault(), opens it in a new tab; a blank url suppresses
navigation. React and Angular wrappers expose an optional `licenseUrl` prop.

License-gate the Angular drawer like React: surface `licenseStatus` as a
signal on the CopilotKit service and gate the wrapper on
status valid|expiring && checkFeature("threads"), skipping the thread fetch
while unlicensed and showing the loading state (not the locked view) until
the status resolves. Reverses the earlier always-licensed Angular call.

Closes ENT-1027.
2026-06-30 17:34:39 -05: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
Benjamin Taylor eb3c20e865 refactor(drawer): rename unlicensed -> licensed across the public surface
Per review, settle the locked-view affordance on a neutral 'license'
name. Renames the event (unlicensed -> licensed), React prop
(onUnlicensed -> onLicensed), slot/part/class (licensed, licensed-cta),
LicensedDetail type, data-testid, render method, and identifier-referencing
comments/test names. The existing 'licensed' boolean gate is unchanged;
prose describing the not-licensed state still reads 'unlicensed'/'locked
view'. Behavior unchanged; Angular unaffected.
2026-06-30 17:34:39 -05:00
Benjamin Taylor d7cb0fded1 refactor(drawer): rename upsell -> unlicensed across the public surface
Per review, drop the 'upsell' monetization jargon. Renames the event
(upsell -> unlicensed), the React prop (onUpsell -> onUnlicensed), the
slot/part/class (upsell -> unlicensed, upsell-cta -> unlicensed-cta),
the UnlicensedDetail type, the data-testid, and all comments/test names.
Behavior unchanged. Angular is unaffected (always-licensed, no gate).
2026-06-30 17:34:39 -05:00
Benjamin Taylor cf4f00ecc1 feat(drawer): activate thread pagination (Load more + limit prop)
Wires up the previously-dormant pagination plumbing (ENT-1016):

- Element: render a 'Load more' button at the list bottom when hasMore
  (and not fetching / not errored), emitting a new load-more event
  (LoadMoreDetail). Distinct from retry{scope:'fetch-more'} (error
  recovery); both advance pagination.
- React CopilotDrawer: add a limit prop (forwarded to useThreads) and
  route load-more to fetchMoreThreads.
- Angular CopilotDrawer: add a limit input (forwarded to injectThreads)
  and route load-more to fetchMoreThreads.

Tests: element load-more render + emit + precedence; React limit
forwarding + load-more routing; Angular load-more routing.
2026-06-30 17:34:38 -05:00
Benjamin Taylor f1cc30cda0 feat(react): add configurable label prop to CopilotDrawer
Mirrors the Angular wrapper + the copilotkit-drawer element's label
property: sets the drawer region aria-label and default header text,
defaulting to the element's built-in "Threads" when omitted.
2026-06-30 17:34:38 -05:00
Nathan 🔶 Tarbert b50e2888a7 test(react-core): cover useCapabilities chat-config agent inheritance (#5533) 2026-06-30 16:43:45 -04:00
Nathan 🔶 Tarbert e55c958393 Merge remote-tracking branch 'origin/main' into fix/issue-5533-agentid-runtime-sync 2026-06-30 16:33:10 -04:00
Benjamin Taylor 79276a2d4f fix(chat): keep message padding in sub-viewport panes via container query
CopilotChat message wrappers used viewport-keyed `cpk:sm:px-0`, collapsing
horizontal padding to 0 at any viewport >=640px. The message column is
`max-w-3xl` (768px) centered; the design assumes the chat fills the viewport,
so at >=640px the column has side gutters and inner padding can drop to 0.

But when the chat lives in a sub-viewport-width pane (e.g. the threads drawer
rail beside the chat, ~580px on an 820px iPad-portrait viewport), `sm:px-0`
still fires on viewport width while the 768px column overflows the narrow
pane and sits flush against both edges. The input wrapper looked fine because
it is visually inset by its own pill, so only message text appeared broken.

Make the padding container-relative instead of viewport-relative:
- add `cpk:@container` (container-type: inline-size) to the chat root, and
- switch the message/input/suggestion wrappers from `cpk:sm:px-0` to the
  container variant `cpk:@3xl:px-0`.

Padding now tracks the chat's own width and drops to 0 only once the container
is at least as wide as the column's own max-width, so the column has real
gutters; in any narrower pane the `px-4` inner padding is retained. React,
Angular, and Vue kept in lockstep.

Note on the breakpoint: Tailwind v4 container-query breakpoints differ from
viewport breakpoints (`@sm` = 24rem/384px, not 640px). A mechanical
`sm:` -> `@sm:` swap would still collapse the ~580px repro pane. `@3xl`
(48rem/768px) is used because it exactly matches the column's `max-w-3xl`,
which is the width at which side gutters first appear.

Verified: full-width desktop chat unchanged (container >=768px -> px-0);
580px pane retains 16px padding; render-prop layouts without a container
ancestor degrade safely to `px-4`; sidebar/popup `data-*` padding overrides
are unaffected.

ENT-1020

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 14:26:15 -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 993a0f1322 docs(memory): align react/angular binding docs; re-export public memory types 2026-06-30 15:54:00 +02:00
Markus Ecker 47d40938da fix(react-core): add getServerSnapshot to useMemories for SSR safety 2026-06-30 15:06:12 +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
Ran Shemtov c45f471330 Merge branch 'main' into claude/happy-dirac-f6ed5e 2026-06-29 23:07:27 +02:00
Ran Shem Tov 8582f59381 fix(react-core): render nothing for unhandled tool calls instead of auto default card
- Revert the v2 useRenderToolCall fallback: when no per-tool or wildcard renderer is
  registered, return null instead of auto-painting DefaultToolCallRenderer. Showing the
  card is opt-in via useDefaultRenderTool().
- The auto-card default shipped silently in v1.57.2 (commit ba60df5d33, buried in a
  showcase per-tool-testids commit, no CHANGELOG entry) and leaked internal tool names +
  raw args/result JSON (e.g. generate_a2ui) into every v2 app's chat in production.
- Remove the now-dead defaultToolCallRenderAdapter + __testOnly_ export + unused imports.
- Rewrite the resolver test to assert the 3-state opt-in contract: useDefaultRenderTool()
  -> card, useDefaultRenderTool({render}) -> custom, no hook -> nothing.
2026-06-29 22:49:15 +02:00
Ran Shemtov ead9ed75ea Merge branch 'main' into claude/trusting-carson-933f4b 2026-06-29 20:37:40 +02:00
Markus Ecker ecbcd092ce feat(react-core): useMemories() is a no-arg consumer of the core memory store 2026-06-29 15:54:42 +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
Benjamin Taylor a4d129d8fa fix(react-core): render the CopilotModalHeader drawer launcher only on mobile
The in-header thread-drawer launcher toggles `drawerOpen`, which only drives the
off-canvas MOBILE drawer; on desktop the drawer is a persistent in-flow panel
that ignores `open`, so the launcher was a dead no-op there (it appeared to do
nothing on click). Gate it on a reactive mobile viewport check so it renders
only at ≤767px. On desktop the chat's own open/close — the toggle FAB + the
header close (both lucide X) — is the consistent pair; nothing masquerades as a
chat control.
2026-06-26 16:54:55 -05:00
Benjamin Taylor af854aa5ff fix(react-core): make CopilotDrawer thread switching work under <CopilotKit>
CopilotChatConfigurationProvider treated any `threadId` prop as controlled, so
the auto-minted non-explicit threadId that <CopilotKit>'s v1 bridge seeds
blocked the drawer's imperative setActiveThreadId/startNewThread — thread
switching and "+ New" were dead in every app wrapped in <CopilotKit>. A
non-explicit (`hasExplicitThreadId={false}`) threadId is now overridable; a
genuine caller-supplied threadId stays controlled.

Also, surfaced during the langgraph-js de-fork validation:
- CopilotChat clears messages when switching to a fresh non-explicit thread
  ("+ New") so the welcome screen shows instead of the prior thread — including
  when a still-loading /connect is superseded by the switch.
- CopilotDrawer treats a pending (null) license status as loading, not
  unlicensed, so the upgrade upsell no longer flashes or sticks before the
  runtime reports the license.
2026-06-26 16:54:55 -05:00
Ran Shem Tov 47e255f670 feat(react-core): add client-side onAction interceptor to v2 A2UI renderer
Add an optional onAction interceptor to createA2UIMessageRenderer so apps
can handle A2UI actions client-side (e.g. navigate) instead of forwarding
every action to the agent.

- onAction(action, forward) runs before forwarding. Return null to handle
  client-side and stop forwarding, return a modified action to forward it,
  or return undefined to forward unchanged.
- Threaded from createA2UIMessageRenderer options through ReactSurfaceHost.
- Extracted runA2UIAction helper for deterministic unit testing.
- Default behavior is unchanged when onAction is not supplied.
2026-06-26 15:57:28 +02:00
Lukas Moschitz 7ef6fa7f61 feat(react-core): useMemories hook on the core memory store 2026-06-26 11:30:36 +02:00
github-actions[bot] 21306d11e4 style: auto-fix formatting 2026-06-25 19:43:20 +00:00
Nathan 🔶 Tarbert 46beb253d9 fix: avoid getAgent probe warning in CopilotListeners for absent default agent (#5533) 2026-06-25 15:42:35 -04:00
Benjamin Taylor 47b7476702 feat(react-core): add CopilotDrawer wrapper and chat drawer-awareness
Add <CopilotDrawer> (interops with the shadow-DOM element, two-pronged license
gate, scoped chat-input focus return, registration-gated header launcher) and
extend CopilotChatConfigurationProvider with drawerOpen + mobile mutual
exclusion + a non-explicit active-thread setter so a bare drawer connects to the
picked thread and resets on New with no host wiring. useThreads gains an
{enabled} gate and a list-only error channel.
2026-06-25 10:42:46 -05:00
ranst91 bb69f55c98 chore: release monorepo v1.61.2 2026-06-25 07:54:33 +00:00
Nathan 🔶 Tarbert fdbfac26f8 Merge remote-tracking branch 'origin/main' into fix/issue-5533-agentid-runtime-sync
# Conflicts:
#	packages/react-core/src/v2/hooks/use-agent.tsx
2026-06-24 16:46:18 -04:00
Nathan 🔶 Tarbert 589fc5135b fix: prevent CopilotListeners from crashing when default agent is absent (#5533) 2026-06-24 10:57:15 -04:00