Commit Graph

362 Commits

Author SHA1 Message Date
Atai Barkai b6cb1d0866 chore(docs): drop unrelated formatting churn 2026-06-18 08:29:18 -07:00
Atai Barkai cab27e2b55 Merge remote-tracking branch 'origin/main' into codex/docs-local-iteration
# Conflicts:
#	showcase/shell-docs/src/components/framework-selector.tsx
2026-06-18 08:27:46 -07:00
Mike Ryan 237a176fbf chore: release monorepo v1.60.2 (#5517)
## Release monorepo v1.60.2

**Scope:** `monorepo` | **Bump:** `patch`

---

### How this release process works

1. **This PR was created automatically** by the "release / create-pr"
workflow.
   It bumped the `monorepo` packages to `1.60.2`
   and generated AI-enhanced release notes.

2. **CI runs on this PR** — the full test suite (unit tests, lint, type
checks, build)
   must pass before merging. This is the review gate.

3. **Review the release notes** in `release-notes.md` in this PR.
If a Notion draft was created, you can edit the release notes there
before merging.

4. **When this PR is merged**, the `release / publish` workflow
automatically:
   - Builds all packages
   - Publishes the `monorepo` packages to npm at version `1.60.2`
   - Creates git tag `monorepo/v1.60.2`
   - Creates a GitHub Release with the final release notes

### Before merging

- [ ] CI is green (tests, lint, types, build)
- [ ] Version bumps look correct
- [ ] Release notes are accurate (edit in Notion if a draft was created)

---

> **Do not merge until CI is fully green.** The full test suite runs
automatically on this PR.
2026-06-17 10:46:56 -07:00
davidmckayv 692e52244c chore: release monorepo v1.60.2 2026-06-17 16:59:44 +00:00
Tyler Slaton 8ec7d0d4e5 docs(shell-docs): restore enterprise intelligence product name 2026-06-17 09:16:29 -07:00
Atai Barkai 281c0c6156 docs(shell-docs): add frontend and backend docs picker 2026-06-17 08:19:00 -07:00
Tyler Slaton 449237af0c fix: rename premium docs to intelligence platform 2026-06-16 22:09:48 -07:00
Tyler Slaton 88588223af fix(react-core): add dark mode styling for default tool rendering (#5455)
## Summary
- Update the default tool-call renderer to use dark-theme-aware classes
for the card, header, status badge, and detail panels
- Add coverage for the dark theme styling path in unit tests
- Add a Storybook example that demonstrates the default tool renderer on
a dark CopilotKit surface

## Testing
- Added unit tests for the renderer’s dark-theme class output and
expanded details state
- Not run (not requested)
2026-06-16 10:04:54 -07:00
Jordan Ritter 7b80590f67 fix(react-core): await runAgent in useInterrupt::resolve
resolve() previously called copilotkit.runAgent(...) without await and
without return, so callers had no handle to sequence against the resume
run's settle. The harness DOM-settle check timed out for any consumer
awaiting the assistant confirmation bubble.

Changes:
- Make resolve async, return await copilotkit.runAgent(...) so callers
  receive a Promise that settles when the resume run settles.
- Update InterruptHandlerProps / InterruptRenderProps resolve return
  type from () => void to () => Promise<RunAgentResult>.
- Wrap runAgent in try/catch + setPendingEvent(null) + rethrow, so
  rejection clears the popup AND propagates to awaiting callers
  (mirrors onRunFailed handler symmetry; closes the case where
  runAgent rejects before any run-failed event fires, e.g. network
  error pre-RUN_STARTED).
- onRunFailed now also setPendingEvent(null) symmetric with
  onRunStartedEvent.
- Regression tests: RESUME-PATH asserts resolve() returns a Promise
  that settles 1:1 with runAgent; RESUME-PATH-REJECT asserts rejection
  propagates, popup clears, console.error logs.
2026-06-15 17:11:39 -07:00
Tyler Slaton bd2db6009a Add dark theme support to default tool renderer 2026-06-15 11:09:12 -07:00
jinhyuk9714 9639b8d4d6 fix(react-core): refresh thread headers on provider updates 2026-06-12 12:47:32 -05:00
Tyler Slaton 930e182d41 fix(react-core): stabilize pin-to-send scrolling (#5386)
## What does this PR do?

Fixes `pin-to-send` scrolling in the v2 chat view.

- Re-attaches the non-autoscroll scroll listener after the real scroll
element mounts by depending on `nonAutoScrollEl`, not the stable
`scrollRef` object.
- Lets the `usePinToSend` spacer adjust in both directions as content
below the pinned user message changes, so the user message stays
anchored after streaming finishes and layout height changes.
- Adds regression coverage for the scroll-to-bottom button and spacer
adjustment behavior.

## Related PRs and Issues

Fixes #5355

## Tests

- `corepack pnpm -C packages/react-core exec vitest run
src/v2/hooks/__tests__/use-pin-to-send.test.tsx
src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.tsx`
- `corepack pnpm exec oxfmt --check
packages/react-core/src/v2/components/chat/CopilotChatView.tsx
packages/react-core/src/v2/hooks/use-pin-to-send.ts
packages/react-core/src/v2/hooks/__tests__/use-pin-to-send.test.tsx
packages/react-core/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.tsx`
- `git diff --check`

Attempted:

- `corepack pnpm -C packages/react-core run check-types`
- This failed in the local workspace on existing/type-resolution issues
outside this diff, including `react-markdown` JSX namespace errors,
missing `@copilotkit/runtime-client-gql` declarations, and existing e2e
mock `AbstractAgent` private member mismatches.

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation (N/A: bug fix only, no API/docs change)
- [x] "Allow edits by maintainers" is checked (lets us help iterate on
your PR directly — faster turnaround for everyone)
2026-06-12 10:34:38 -07:00
Austin Merrick 9275ec2ce0 fix(react-core): cover mermaid-block + sub/superscript streamdown styles 2026-06-12 09:49:45 -07:00
Tushar-Khandelwal-2004 f90c3dcfd7 fix(react-core): scope streamdown markdown styles 2026-06-12 09:49:44 -07:00
ranst91 02c3a8aef0 chore: release monorepo v1.60.1 2026-06-12 13:03:45 +00:00
Ran Shem Tov 7805a9a57b fix: update cpk to use latest agui core packages 2026-06-12 11:16:19 +02:00
Austin Merrick de9d46d1df docs(skills): migrate CopilotKit skills to the v2 API
Bring the agent skills in line with the shipped v2 API so their examples
install, compile, and connect. Extends #5345 (which migrated the
copilotkit-setup SKILL.md body) to the rest of the skills.

- Imports: drop the nonexistent @copilotkit/react and @copilotkit/agent
  packages and the bare @copilotkit/runtime/express subpath; use
  @copilotkit/react-core/v2 and @copilotkit/runtime/v2 (+ /v2/express),
  and createCopilotHonoHandler / createCopilotExpressHandler rather than
  the deprecated createCopilotEndpoint aliases.
- Provider: CopilotKit from @copilotkit/react-core/v2 with
  useSingleEndpoint={false} on multi-route setups (the v1-compat bridge
  defaults to single transport and would 404 a multi-route backend).
- Routes: v2 catch-all Hono handler exporting GET/POST/PATCH/DELETE via
  handle() from hono/vercel, replacing the v1
  copilotRuntimeNextJSAppRouterEndpoint + ExperimentalEmptyAdapter.
- Integrations: per-framework agent classes matched to the shipped
  examples (LangGraphAgent/LangGraphHttpAgent from @copilotkit/runtime/
  langgraph, CrewAIAgent, MastraAgent, LlamaIndexAgent, HttpAgent from
  @ag-ui/client; Agno via HttpAgent, not @ag-ui/agno).
- Hooks/props: correct useAgent, useThreads, useRenderTool, identifyUser,
  and the chat-component props (defaultOpen, onSubmitMessage, the headless
  CopilotChatView render prop).

Validated across review rounds and a build test against the published
@copilotkit/*@1.60.0 packages (tsc passes, every /v2 subpath resolves).
Regenerated the skills/runtime and skills/react-core mirrors.
2026-06-11 14:43:45 -07:00
MikeRyanDev a6e8000c94 chore: release monorepo v1.60.0 2026-06-11 16:27:00 +00:00
SeoyeonKim 8e440a9e7d fix(react-core): stabilize pin-to-send scrolling 2026-06-11 22:56:07 +09:00
Benjamin Taylor 8d68a95bc9 docs(packages): drop client license-key prop references; Angular no longer needs a key
Follow-up correction. The client publicLicenseKey/publicApiKey prop is the
header→cloud path and is NOT what activates the Intelligence runtime (that's
the server-side COPILOTKIT_LICENSE_TOKEN). So:

- Remove the `npx copilotkit@latest license` guidance from all client-prop
  contexts — that CLI yields the server-side license token, not the client
  prop value.
- Revert the client-prop docstrings (copilotkit-props, v2 CopilotKitProvider)
  to bare one-liners; drop the premium/"requires a license key" framing from
  the headless hook, react-ui observability docs, and runtime logging/onError
  JSDoc rather than reframing.
- Angular: remove all `licenseKey` mentions from the README — it is no longer
  a premium feature (the license watermark is disabled) and the key is not
  needed to function.

Server-side license-token documentation remains deferred to the example/runtime
setup pass (Bucket B).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 07:22:37 -05:00
Benjamin Taylor 8956c668bc docs(packages): retire Copilot Cloud framing in SDK doc references, point to the license key
Cloud is no longer promoted; the Intelligence license key is its replacement.
Scrub the old Copilot Cloud system from SDK JSDoc / doc-comments / console
messages / README prose so code references reflect how the license key is
obtained and used, mirroring examples/integrations/*:

- publicApiKey/publicLicenseKey docstrings (react-core props + v2 provider,
  vue legacy types, copilot-context) describe the CopilotKit public license
  key, acquired via `npx copilotkit@latest license` or the dashboard;
  publicApiKey framed as the legacy alias of publicLicenseKey.
- Premium-feature docs (headless hook, react-ui Chat/Popup/Sidebar
  observability, runtime logging/onError) drop "Copilot Cloud"/"requires a
  publicApiKey" wording and the publicApiKey examples in favor of the public
  license key + publicLicenseKey.
- console-styling messages and the angular README point at the license key
  and the `npx copilotkit@latest license` command.

Defunct features (guardrails_c, authConfig_c, useCopilotAuthenticatedAction_c)
keep their code but lose their JSDoc (marked @internal defunct).

Functional surfaces untouched: api.cloud.copilotkit.ai endpoint, the
X-CopilotCloud-Public-Api-Key header, prop names, gating logic, tests,
CHANGELOGs. Example-app migration (Bucket B) deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 07:22:37 -05:00
Mark Fogle c036a97efa fix(react-core): scope the A2UI catalog context to the runtime's a2ui agents (#5369) 2026-06-11 05:07:11 +00:00
Austin Merrick 0518414f0a docs(skills): recommend CopilotKit from /v2 everywhere and scrub CopilotCloud mentions
Follow-up to #5345 per review feedback:

- Propagate the provider change to all remaining skills: every example,
  props table, eval check, and prose mention now recommends CopilotKit
  imported from @copilotkit/react-core/v2 (the compatibility bridge and
  strict superset) instead of CopilotKitProvider. Migration docs in
  copilotkit-upgrade now point at the /v2 import path as the target and
  explicitly warn against migrating to CopilotKitProvider.
- Scrub CopilotCloud / Copilot Cloud / CopilotKit Cloud branding from
  skills, replacing it with CopilotKit Intelligence where the hosted
  platform is meant. Literal endpoint URLs and real identifiers like
  MissingPublicApiKeyError are unchanged.
- Fix react-core provider-setup.md which claimed publicApiKey was the
  canonical prop; publicLicenseKey is canonical and publicApiKey is a
  deprecated alias, matching #5345.
- Edits made in the packages/*/skills source dirs for the three mirrored
  skills, with skills/ regenerated via pnpm sync:plugin-skills (this also
  re-pins the plugin version fields to 1.59.5).
2026-06-09 13:53:55 -07:00
Ran Shem Tov e5d3963db6 fix(core): bump @ag-ui core packages to 0.0.56 and adapt runHttpRequest
Bump @ag-ui/core, @ag-ui/client, @ag-ui/encoder from 0.0.53 to 0.0.56
across all packages.

@ag-ui/client 0.0.56 changed runHttpRequest from (url, requestInit) to a
fetch-thunk signature (() => Promise<Response>). Update the single-route
and connect transport paths in ProxiedCopilotRuntimeAgent to wrap the
request in () => this.fetch(url, init), restoring the broken envelope
transports.

Add @ag-ui/core, client, encoder, proto to minimum-release-age-exclude
in .npmrc so the freshly published 0.0.56 (under the 24h release-age
gate) installs in CI.
2026-06-09 17:47:43 +02:00
lukasmoschitz 6756eac460 fix(react-core): render intelligence-indicator icon cross-browser (#5316)
## Problem

The "CopilotKit Intelligence" indicator's icon (spinner → checkmark)
rendered **blank in Safari and Firefox**. Its geometry was defined
through the CSS `d:` property, which is Blink-only (Chrome/Edge) — so in
any other engine the stylesheet-driven path drew nothing.

## Fix

- **Geometry in the `d` attribute, not CSS `d:`** — renders in every
browser.
- **Two overlaid paths instead of one morphing path.** A spinning
**arc** that fades out, and a **checkmark** that draws itself in via
`stroke-dashoffset`, upright. Cross-fading two static shapes is more
robust than path-morphing (the old `d:` morph was Chrome-only anyway).
- **Arc spins via `transform-box: fill-box; transform-origin: center`**
— the Safari-safe way to rotate an SVG sub-element about its center.
(`transform-box: view-box` is mis-resolved by WebKit and spins
off-center; a SMIL `<animateTransform>` fixes Safari but stalls for a
beat on first paint in Chrome — `fill-box` + `center` is correct and
instant in both.)
- **Spin isolated to the arc**, so the checkmark always renders upright
regardless of where the spin was when the turn finished, and the arc
keeps spinning as it fades (no abrupt stop / snap-back).
- **`pathLength="1"` on both paths** so dashes are expressed as plain
fractions — one consistent, self-documenting idiom for both shapes.
- **`prefers-reduced-motion` support** added: the arc doesn't spin and
the in-progress → finished states swap instantly.
- Both stale design docblocks rewritten to describe the actual
implementation.

## Scope

Two files — `IntelligenceIndicatorView.tsx` and `globals.css`. No
behavior/runtime changes; purely the indicator's presentation. The
settle choreography (glass chrome, hue shift, faux-italic label) is
unchanged.

## Testing

- `nx test react-core` — 24 intelligence-indicator tests pass (the suite
asserts DOM structure/behavior; cross-browser rendering itself isn't
observable in jsdom and was verified manually in Chrome + Safari).
- oxlint / oxfmt clean; type-check clean for the changed files.
- Manually verified in **Chrome and Safari**: icon renders, spins
centered, fades out mid-spin, checkmark draws in upright; no Chrome
startup stall, no Safari wobble.
2026-06-09 13:36:38 +02:00
Lukas Moschitz a22796a822 fix(react-core): render intelligence-indicator icon cross-browser
The icon geometry was defined via the Chrome-only CSS `d:` property, so
the spinner/checkmark rendered blank in Safari and Firefox. Move the
geometry into each path's `d` attribute and split the single morphing
path into two overlaid paths — a spinning arc that fades out and a
checkmark that draws itself in (stroke-dashoffset) upright.

Spin the arc with `transform-box: fill-box; transform-origin: center` so
it stays centered in WebKit (view-box is mis-resolved there; a SMIL
animateTransform stalls on first paint in Chrome). Both paths use
`pathLength="1"` so dashes read as fractions, and all motion is gated
behind `prefers-reduced-motion`.
2026-06-08 14:54:42 +02:00
Jordan Ritter 19f8ef89c8 fix(react-core): correct useCoAgent JSDoc link and stale run description 2026-06-06 16:09:52 -07:00
Benjamin Taylor 1c92a69f58 fix(links): point cloud.copilotkit.ai web links at the Intelligence dashboard
New users were still discovering cloud.copilotkit.ai through docs pages,
the README, example READMEs, and in-app banners/console messages. Replace
all user-facing web links with dashboard.operations.copilotkit.ai (the
destination the marketing-site CTAs already use). Functional API endpoints
(api.cloud.copilotkit.ai) are deliberately untouched since existing cloud
customers depend on them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 11:20:44 -05:00
contextablemark 9bfeb74bc9 chore: release monorepo v1.59.5 2026-06-05 05:21:08 +00:00
Mark 9fda7e634d Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-04 17:58:58 -07:00
Mark Fogle 943c1421fe fix(react-core): hold the A2UI loader until the surface can paint a card (OSS-162)
onReady fired after the first processMessages, but a data-bound list paints
nothing until its data model arrives — so at high stream latency the skeleton
dropped ~1s before the first card (blankness). Gate onReady on the surface
actually being renderable: for data-bound surfaces (components reference data via
`path`), wait for the first non-empty updateDataModel; static surfaces are
renderable from components alone. Latency-independent — fires exactly when the
first card can exist. Fallback timer bumped to 8s (backstop only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:57:43 +00:00
Mark Fogle 195de1fc6a fix(react-core): swap the A2UI loader on actual paint, not a fixed delay (OSS-162)
A fixed cross-over delay can't be right — the time from ops-arrive to first card
varies with stream latency, payload size, and machine speed. Instead, the surface
processor fires onReady the moment it has processed its first operations; the
renderer swaps one animation frame later. The timer is demoted to a 1.5s safety
fallback. Latency-independent true replacement, no magic number to tune.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:45:04 +00:00
Mark Fogle 5977a58836 fix(react-core): keep the A2UI surface mounted across the cross-over swap (OSS-162)
The prior cross-over returned a different tree shape once ready (top-level
`surfaces` vs the held wrapper), so React unmounted+remounted ReactSurfaceHost at
the swap — throwing away the offscreen-painted surface and reintroducing the gap
at the swap point. Keep ReactSurfaceHost in ONE stable position and only toggle
its wrapper styling (offscreen→in-flow) + the loader overlay, so the painted
surface is preserved. Also track the last pre-paint snapshot from content (not the
lagging operations state) so the paint snapshot can't clobber it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:43:12 +00:00
Mark Fogle 33cbb4183d fix(react-core): cross-over the A2UI skeleton into the painted surface (OSS-162)
The skeleton unmounted the instant a2ui_operations arrived, but the A2UIProvider
needs a couple ticks to process the ops and paint — leaving a visible empty gap
between skeleton and first card. Hold the loader in-flow while the surface mounts
and paints OFFSCREEN (absolute, opacity 0), then swap, so the first card truly
replaces the skeleton. Keep showing the last pre-paint snapshot during the
hand-off so the building count / retry status carries through without a flicker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:34:43 +00:00
github-actions[bot] 6d24d630e1 style: auto-fix formatting 2026-06-04 21:46:32 +00:00
Mark Fogle a3d46c72b8 feat(react-core): unify A2UI generation lifecycle into the surface renderer (OSS-162)
The pre-paint A2UI experience was split across three uncoordinated render
paths: a per-tool-call skeleton (render_a2ui), the a2ui-surface activity, and a
separate a2ui_recovery activity. That caused a duplicate "Building interface…"
skeleton (one per tool call / retry) and a skeleton that lingered after the
surface painted, and left retry/failure UI floating beside the loader.

Collapse the whole lifecycle onto the a2ui-surface activity as the single
owner, swapped in place on one stable messageId:
  building -> retrying -> failed -> (painted card)

- New A2UIRecoveryStates.tsx: shared building/retrying/failed subcomponents +
  the animated skeleton (ported from the retired tool-call renderer) + the
  threshold-gated retry label + debugExposure resolution.
- A2UIMessageRenderer now branches: a2ui_operations present -> paint surfaces;
  else status failed/retrying/building. Recovery options (showAfterMs,
  showAfterAttempts, debugExposure) flow in via `a2ui.recovery`. Server-stamped
  content.debugExposure still wins. Lifecycle metadata lives on the AG-UI
  activity-content wrapper, never inside an A2UI envelope (op elements stay
  {version, <one op>}, per v0.9).
- Retire the render_a2ui tool-call skeleton: it now renders nothing (still
  registered, so raw args are suppressed). Kills the duplication at the root.
- Drop createA2UIRecoveryRenderer + the separate a2ui_recovery registration;
  the surface renderer owns it. Tests moved to A2UIRecoveryStates.test.tsx.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 21:45:49 +00:00
Benjamin Taylor e2cb8e3d1c Merge remote-tracking branch 'origin/main' into ben1/intelligence-threads-examples-rollout
# Conflicts:
#	examples/integrations/crewai-crews/package-lock.json
#	examples/integrations/crewai-crews/package.json
2026-06-04 15:27:53 -05:00
Mark c8094de0e5 Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-04 11:41:42 -07:00
Mark Fogle dce8fe85cc feat(react-core): honor server-stamped debugExposure on recovery activity (OSS-162)
The A2UI middleware now stamps recovery.debugExposure onto every a2ui_recovery
activity, so the server (covering Python and TS agents alike, since the middleware
is the single emitter) can drive how much retry/error detail the renderer surfaces.

Resolve debugExposure per-activity inside render() with precedence
content > client option > "collapsed" default, and declare it on
RecoveryContentSchema. Adds a test asserting the server value wins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 18:37:14 +00:00
ranst91 47fcb30d0f chore: release monorepo v1.59.4 2026-06-04 17:26:49 +00:00
Markus Ecker 4d324338ce feat(react-core): per-turn persistent intelligence indicator + finished tag
Render a per-turn persistent intelligence indicator that stays stable
across multi-step turns and settles into a "finished" tag. Splits the
component into IntelligenceIndicator (logic) + IntelligenceIndicatorView
(presentation), wires it into CopilotChatView / CopilotChatMessageView,
adds the slot styles to globals.css, and a Storybook story plus
timer-free logic tests.
2026-06-04 17:56:30 +02:00
Markus Ecker e5ae1b23b7 feat(react-core): useLearningContainers sets thread learning containers
Add `useLearningContainers` / `...InCurrentThread`, which emit
`set_learning_containers` annotations (defaulting to the `project`
container) for the active thread, and export the new hooks from the
react-core hooks barrel.
2026-06-04 17:56:29 +02:00
Markus Ecker 139ffcdd6a feat(react-core): useLearnFromUserAction records user actions via recordAnnotation
Add the `recordAnnotation` client (posts to the runtime `/annotate`
endpoint; no client-side userId) and the `useLearnFromUserAction` /
`...InCurrentThread` hooks that record `user_action` annotations for the
self-learning loop.
2026-06-04 17:56:29 +02:00
Benjamin Taylor 5071060eac Merge ben1/intelligence-threads-examples-rollout into codex/ent-734-strands-python
Conflict resolutions:
- contract test: keep the rollout's parameterized version and add
  strands-python to migratedIntegrations/appRoots (60/60 passing) in
  place of her bespoke MIGRATED_INSTANCES file
- parity manifest: rollout's version with strands' three threads-shield
  allowances removed (mirrors the langgraph-fastapi migration); parity
  verify green — strands now 88 tracked files, zero drift
- package-lock: regenerated at 1.59.3 (a2ui-renderer stays 1.56.5,
  the family-wide pin shared with the north-star)

Also rides: her react-core A2UIMessageRenderer test flake fix
(act -> waitFor), kept intentionally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:22:53 -05:00
Mark 81e97e66e9 Merge branch 'main' into mark/oss-162-a2ui-recovery-client-ux 2026-06-03 23:26:36 -07:00
Jordan Ritter 8f9aeb8096 test(react-core): pin the Enter-vs-button routing contract while running
CopilotChatInput intentionally diverges while a run is in flight: Enter with
sendable text routes to SEND (the consecutive-interrupt unblock from #5195),
while the send/stop button always routes to STOP. Only a comment bound these
two behaviors together. Add a regression test asserting BOTH at once so a
future refactor cannot silently re-converge them (verified red against both a
button-sends-while-running and an Enter-also-stops mutation).
2026-06-03 19:47:38 -07:00
Jordan Ritter 32551f2bdb fix(react-core): type the active-run completion contract and serialize the suggestion send path
Replace the brittle `"activeRunCompletionPromise" in agent` probe + double
`as unknown as` casts in CopilotChat with a typed `RunCompletionAware`
contract plus an `isRunCompletionAware` type guard, both exported from core.
IntelligenceAgent now declares the property and implements the interface, so
the in-flight-run await is reachable without a cast and non-Intelligence
agents still degrade safely. Cast sites in the attachments/e2e tests and the
MockStepwiseAgent helper are updated to the typed accessor.

Factor the await-then-send logic into a shared `waitForActiveRunToSettle`
helper and call it from BOTH onSubmitInput and handleSelectSuggestion. This
closes the suggestion-path in-flight gap: selecting a suggestion mid-run no
longer pre-empts/aborts the active run (e.g. an interrupt RESUME) — the same
regression PR #5195 fixed for the typed-Enter path. Adds a red-green
regression test that parks the suggestion send on the in-flight promise.
2026-06-03 19:47:38 -07:00
Mark Fogle 51945013c2 feat(react-core): A2UI recovery status renderer (OSS-162)
Render the `a2ui_recovery` activity the middleware emits — as a pure DATA
CONTRACT, no @ag-ui/a2ui-toolkit dependency on the React client (mirrors how
a2ui-surface / a2ui_operations are consumed by activityType + content keys):

- createA2UIRecoveryRenderer() -> ReactActivityMessageRenderer for
  activityType "a2ui_recovery":
  - "retrying": a non-disruptive, collapsed "Retrying UI generation…" hint that
    only appears once perceptible (after showAfterMs, or once attempts cross
    showAfterAttempts) so a fast first retry never flashes; never replaces the
    surface, never shows noisy errors inline.
  - "failed": a clean, tasteful hard-failure message for end users, with the
    structured developer detail tucked into an expandable <details>.
  - "resolved"/unknown: renders nothing (the surface renderer owns the UI).
- Timing + debugExposure are client-configurable (A2UIRecoveryRendererOptions),
  surfaced via CopilotKitProvider's `a2ui.recovery`.
- Registered as a built-in renderer when runtime A2UI is enabled; exported.

7 renderer unit tests green (jsdom).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 21:57:10 +00:00
jpr5 be20a389cf chore: release monorepo v1.59.3 2026-06-03 14:53:22 -07:00
Jordan Ritter 63fd2f0b0f fix(react-core): route turn-2 Enter to send during interrupt-resume instead of aborting the run
On consecutive interrupts, pressing Enter for the second turn (turn-2) while
the resumed run from turn-1 was still in flight routed the keystroke to the
STOP action, aborting the in-flight resume instead of sending the new message.

The fix gates the Enter handler on `canSend` so a pending/running state no
longer maps Enter to STOP, and `onSubmitInput` now awaits the in-flight run's
completion before dispatching the queued message — the message is sent after
the current run finishes rather than aborting it.

Also hardens the queuing and attachment tests to cover the consecutive-
interrupt path and the send-after-run-completes behavior.
2026-06-03 14:36:05 -07:00