Commit Graph

1093 Commits

Author SHA1 Message Date
Mike Ryan 79e1bebece fix(runtime): require identifyUser name in intelligence mode 2026-04-22 09:55:59 -05:00
Benjamin Taylor bbe23e604e fix(threads): skip /connect for absent threads, stabilize switch UX (ENT-314)
- Skip copilotkit.connectAgent when CopilotChat lacks a caller-supplied
  threadId — a locally-minted UUID has no backend record, so /connect
  would always 404 on the intelligence platform.
- Suppress the welcome screen while a connect is in flight and
  unconditionally when the caller has supplied a threadId
  (hasExplicitThreadId). Prevents the "How can I help you today?"
  flash on thread switch.
- Gate suggestions on !isConnecting && !isRunning to avoid painting
  them against a mid-replay message tree.
- Defer the isConnecting release by one animation frame so trailing
  bootstrap renders commit before the flag flips.
- Reserve room for the "Powered by CopilotKit" license badge via a
  new --copilotkit-license-banner-offset CSS var published by the
  banner on mount; chat input consumes it only when bottom-anchored.
- Sort and display threads by lastRunAt (fallback to updatedAt →
  createdAt) so metadata-only actions like archive/rename don't
  reshuffle the list.
- useThreads waits for runtimeConnectionStatus === Connected before
  dispatching the store context, eliminating the speculative /threads
  fetch that fired before /info returned wsUrl.

Threads example polish: restore button + tooltips on
archive/restore/delete, segmented Active/All filter, graceful error
state, skeleton rows on initial load, stable scrollbar gutter,
pre-paint dark-mode class, logo position stable across app/chat
modes, drop dynamic-import drawer wrapper that caused null first
paint, archived-row dimming via child colors instead of opacity.

Tests:
- CopilotChat.absentThreadConnect: connect is skipped without a
  threadId, fires when supplied via prop or config.
- CopilotChatView.connectingGate: isConnecting suppresses welcome;
  hasExplicitThreadId suppresses welcome on empty chat.
- threads (core): lastRunAt sort fallback ordering.
- use-threads: Connecting-state gate defers /threads until Connected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 09:42:34 -05:00
github-actions[bot] 6a04464bb0 style: auto-fix formatting 2026-04-21 16:25:11 -07:00
Mike Ryan 25f6f15418 refactor(runtime): Support durable compaction of threads 2026-04-21 16:25:11 -07:00
Martha Schumann 346618e601 fix(angular-demo): resolve @copilotkit/angular module not found
- angular.json: fix CSS path from @copilotkit/angular → @copilotkitnext/angular
- tsconfig.json: fix @copilotkit/angular paths entry to use correct mjs filename
- package.json: add link: alias so pnpm creates the missing node_modules symlink

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 16:12:38 -07:00
Martha Schumann d40ff22767 fix(angular-demo): add web-inspector-angular dep and tsconfig path
The headless demo component imports from @copilotkit/web-inspector-angular
but the package was missing from package.json and the tsconfig paths,
causing the Angular build to fail with TS2307.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 15:29:16 -07:00
Martha Schumann 0c287c65f3 chore: merge origin/main
Excludes showcase/shell-docs and showcase/shell-dojo demo-content.json from
the size check in lefthook.yml — these data files were added by main but
weren't in the exemption list, causing the pre-commit hook to reject them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 15:17:06 -07:00
Jordan Ritter b60ce9d31b fix(examples/crewai-crews): bump ag-ui-crewai pin to 0.2.x
ag-ui-crewai 0.1.5 contains three defects that took down crewai-crews
in prod for 9h on 2026-04-21: unguarded .messages access, orphan
asyncio.create_task, and sync completion() calls. All three are fixed
in 0.2.0 (ag-ui PR #1550).

Showcase already moved to 0.2.x in PR #4115. Dojo is the user-facing
reference — leaving it on 0.1.5 means every reader clones the broken
version. This closes the validate-pins drift.

Pip dry-run resolves ag-ui-crewai-0.2.0 cleanly with no conflicts.
Grep of examples/integrations/crewai-crews/ confirms no consumer code
touches the 0.1.5 defect paths (.state.messages, create_task,
completion sync).
2026-04-21 10:41:52 -07:00
Martha Schumann 0e77affe14 Merge main: remove langgraph_agent.py (deprecated), resolve lock conflict
- Keep deletion of sdk-python/copilotkit/langgraph_agent.py (deprecated LangGraphAgent
  removed in this PR; main's unrelated bug fixes are superseded by our removal)
- Resolve poetry.lock conflict by taking main's ag_ui_langgraph 0.0.33

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 12:10:19 -07:00
Mike Ryan 48afe59260 fix(examples): Pin version number and simplify example 2026-04-18 21:25:41 -05:00
Mike Ryan 1fcd3f205a refactor(examples): Switch Threads to use GHCR 2026-04-18 13:44:02 -07:00
Max Korp 0b19b31ae5 fix(examples/langgraph-python-threads): load .env + use runtime with thread-name fix
The scaffolded BFF was hitting two issues out of the box:

1. tsx doesn't auto-load .env, and the template's .env lives at the
   monorepo root. process.env.COPILOTKIT_LICENSE_TOKEN was undefined
   at runtime so the runtime logged 'No license token configured'
   even when the user had populated .env via `copilotkit license`.
2. @copilotkit/runtime: next resolved to 1.55.0-next.9, which
   predates the thread-naming UUID fix (v1.55.3). The BFF blew up
   creating LangGraph threads with 'Invalid thread ID: must be a
   UUID' because the runtime passed a compound thread-name:<uuid>:
   <uuid> string.

Fix both:
- Switch dev script to `tsx watch --env-file=../../.env src/server.ts`
  so tsx loads the monorepo root .env.
- Pin @copilotkit/runtime to `latest` so scaffolds get the
  thread-naming fix. (The next dist-tag is still stale on npm.)
2026-04-17 17:25:04 -07:00
Max Korp 6127ac01d6 chore(langgraph-python-threads): use published intelligence images
Switch docker-compose to pull app-api, db-migrations, and realtime-gateway
from public.ecr.aws/cpk/intelligence/* at tag 0.1.0-rc.5 instead of locally
built cpki/*:local images, and drop the build-local-images prerequisite
from the README and compose header.
2026-04-17 15:24:41 -07:00
Alem Tuzlak 321454b823 fix: pin langgraph-python to stable deps, fix mastra dev, restore Windows .bat fallback
- langgraph-python: replace ephemeral pkg.pr.new URLs with stable @copilotkit/*@1.56.2
- mastra: wire dev to run ui + agent via concurrently (was only starting UI)
- Restore `|| scripts\setup-agent.bat` / `|| scripts\run-agent.bat` fallback across
  12 starter templates so npm install + npm run dev work on Windows without Git Bash
2026-04-17 18:04:18 +02:00
Alem Tuzlak 332f518a63 Merge branch 'main' into worktree-lucky-popping-wren 2026-04-17 10:21:32 +02:00
Jordan Ritter d1928cdb67 fix: address CR findings on aimock validate-on-load hardening
- Add --validate-on-load to all aimock invocations (4 workflows/scripts
  + 13 integration docker-compose files)
- Replace hardcoded 2-file fixture list with dynamic discovery across
  showcase/, examples/integrations/*/, scripts/doc-tests/ (16 fixtures)
- Add sanity check to prevent silent zero-test pass when discovery fails
- Extend showcase_validate.yml path filter to trigger on
  examples/integrations/**/fixtures/** and scripts/doc-tests/fixtures/**
- Import and use ValidationResult type for callback parameters
- Fix scripts/doc-tests/fixtures/default.json to use { fixtures: [...] }
  envelope shape
2026-04-16 13:00:01 -07:00
Jordan Ritter f00c040f15 fix: keep playwright install stderr for debugging
Playwright install stderr is diagnostic signal — version/network errors,
missing system libs, or browser download failures all surface here. Only
suppress stderr on the noisy npm install step. Also pin the image-tag /
client-version relationship with a code comment on one compose file so
future bumps know to keep them aligned.
2026-04-16 12:07:43 -07:00
Jordan Ritter e05181265a fix: drop --with-deps from starter-smoke Playwright install
The Playwright Docker image (mcr.microsoft.com/playwright:v1.52.0-noble)
ships with all Chromium system libraries and browsers pre-installed, so
`--with-deps` adds no runtime value — it only forces a redundant
`apt-get update && apt-get install` inside the tests container.

That apt-get call is the sole source of the intermittent
"Installation process exited with code: 100" / "Failed to install
browsers" failures that rotate across the 12 smoke matrix entries. The
underlying cause is transient Ubuntu archive mirror hash/size mismatches
("File has unexpected size ... Mirror sync in progress?", "Hash Sum
mismatch"), which cause apt to abort with exit 100. Because each matrix
job races apt against archive.ubuntu.com independently, the failing
subset rotates per run (run 24526747926 hit 5 starters; run 24509673514
hit a different 5; run 24495760568 hit 3) — classic flake, not a per-
starter regression.

Dropping --with-deps eliminates the apt-get call entirely. The browsers
themselves are already present at /ms-playwright/chromium-* in the base
image, and `npx playwright install chromium` remains as a cheap no-op
that self-heals if the pinned Playwright version ever drifts from the
image's bundled browser build.
2026-04-16 11:39:02 -07:00
Alem Tuzlak d5cab97c84 chore: update langgraph-js starter to @copilotkit/*@1.56.0
This version removes the unused @langchain/community peer dep from
sdk-js, fixing dependency resolution conflicts with @langchain/core@1.x.
2026-04-16 18:14:50 +02:00
Alem Tuzlak 07e864b99a Merge remote-tracking branch 'origin/main' into worktree-lucky-popping-wren
# Conflicts:
#	examples/integrations/langgraph-python/apps/app/package.json
#	examples/integrations/langgraph-python/pnpm-lock.yaml
2026-04-16 16:13:44 +02:00
Alem Tuzlak f47b9e9775 fix: remove unused @langchain/community peer dep, add langchain to langgraph-js agent, add postcss config to mcp-apps threejs-server
- Remove @langchain/community from sdk-js peerDependencies (unused,
  was blocking @langchain/core@1.x resolution)
- Add langchain@^1.0.0 to langgraph-js agent deps to prevent
  transitive resolution to 0.3.x
- Add postcss.config.mjs to mcp-apps threejs-server
2026-04-16 16:02:24 +02:00
Alem Tuzlak 41e57ed74b fix: remove .bat fallback pattern, fix README typos and phantom scripts
- Remove '|| .bat' fallback from all starter package.json scripts so
  real errors on Linux/macOS are not masked by a failing .bat attempt
- Fix typos: 'isseus' -> 'issues', 'interactin' -> 'interacting'
- Fix crewai-crews README title/body saying 'Flow' instead of 'Crew'
- Fix a2a-a2ui README wrong agent name and file path
- Remove phantom lint/dev:debug scripts from README Available Scripts
  sections where those scripts don't exist in package.json
- Add missing dev:ui and dev:agent to mastra README
2026-04-16 14:00:52 +02:00
Alem Tuzlak 0d4b887d8b fix: set execute bit on .sh scripts, fix langgraph-js Docker builds
- chmod +x all new .sh scripts so they work on Linux/macOS
- Use --ignore-scripts in langgraph-js Dockerfiles to avoid postinstall
  failure (agent/ dir not yet copied during npm install stage)
- Install agent deps in production Dockerfile after COPY agent/
- Fix hardcoded pnpm commands in agent-spec README
2026-04-16 13:51:53 +02:00
Alem Tuzlak 96ed9151d7 fix: default to npm in all starter READMEs, support any package manager
Reorder package manager instructions to show npm first as the default.
Remove stale 'ignores lock files' notes since lock file entries were
removed from .gitignore. All starters now work with npm, pnpm, yarn,
or bun — user's choice.
2026-04-16 13:37:10 +02:00
Alem Tuzlak 4f49da19e0 fix: remove lock file entries from all starter .gitignore files
Starters should not constrain users to a specific package manager.
The .gitignore gets cloned into the user's project, so ignoring
certain lock files would prevent them from committing their chosen
package manager's lock file.
2026-04-16 13:28:28 +02:00
Alem Tuzlak 453097ff18 fix: convert starter templates from pnpm/Turborepo to flat npm projects
Flatten langgraph-python, langgraph-js, and mcp-apps starters so
npm install && npm run dev works out of the box. Replace Turborepo
with concurrently, move apps/* to root, update Dockerfiles, READMEs,
and entrypoints. Also remove stray pnpm-lock.yaml from a2a-a2ui and
ms-agent-framework-dotnet starters.
2026-04-16 13:23:30 +02:00
Markus Ecker 9945d892e5 chore: update langgraph starter lockfile for 1.56.0 2026-04-15 20:41:05 +02:00
Markus Ecker 097bc7ac6c fix: update langgraph starter to use released @copilotkit packages 1.56.0
Replace pkg-pr-new preview URLs with published 1.56.0 versions.
2026-04-15 20:19:30 +02:00
Ran Shemtov d74e32c824 Merge branch 'main' into chore/example-state-streamin 2026-04-15 19:24:23 +02:00
Max Korp 246448120a feat: add langgraph-python-threads example 2026-04-15 09:50:03 -07:00
Ran Shem Tov 65500c5fb8 chore: fix state streaming on langgraph prebuilt agents in demos 2026-04-15 18:35:55 +02:00
Ran Shem Tov c8d4b273aa chore: add state streaming to langgraph example 2026-04-15 17:54:05 +02:00
Markus Ecker c61ebc5d15 chore: use pkg-pr-new preview packages in langgraph starter 2026-04-15 16:13:47 +02:00
Jordan Ritter 14eef93d20 fix: scope .dark CSS selectors to CopilotKit elements (#3850)
## Summary

- **console.css + input.css:** Scope `.dark` CSS selectors to CopilotKit
container elements (`.copilotKitDevConsole
.copilotKitDebugMenuTriggerButton` and `.poweredBy` respectively). The
original selectors had bare `.dark,` as standalone entries in
comma-separated selector lists, which applied styles to *any* element
with class `.dark` instead of scoping to CopilotKit elements.
- **colors.css:** Remove broken `:root` pseudo-element from
`body[style*="color-scheme: dark"] :root` — `:root` is `<html>`, which
cannot be a descendant of `<body>`, so this selector never matched
anything.
- **E2E tests:** 4 Playwright regression tests verifying dark mode
styles don't leak into host application elements.

Prevents CopilotKit dark-mode styles from leaking into the host
application.

Closes #2920

---
*Split from #3847*
2026-04-14 14:25:57 -07:00
Markus Ecker c8ff9d7bf6 fix: update langgraph example model to gpt-5.4 2026-04-14 16:24:34 +02:00
Alem Tuzlak 6c05c8e3aa Merge branch 'main' into worktree-nested-tinkering-quail 2026-04-14 15:39:32 +02:00
Alem Tuzlak cbd220ab23 chore: use latest langgraph and fix deployment (#3889) 2026-04-14 14:41:27 +02:00
Ran Shem Tov eef4ac7fd0 chore: use latest langgraph and fix deployment 2026-04-14 14:20:16 +02:00
Alem Tuzlak 983274f7c3 Merge branch 'main' into worktree-nested-tinkering-quail 2026-04-14 14:11:42 +02:00
Alem Tuzlak 19b99dd2ae fix(runtime): widen TanStack message content type for adapter compat (#3747)
## Summary

- Widen `TanStackChatMessage.content` from `TanStackContentPart[]`
  to `any[]` so messages from `convertInputToTanStackAI` are directly
  passable to any TanStack AI adapter without `as any` casts
- Split `TanStackContentPart` into a proper discriminated union with
  separate variants per modality
- Add `env.d.ts` with `vite/client` reference for CSS import types
- Fix `onError` callback shape in the example

## Test plan

- [x] All 17 multimodal TanStack tests pass
- [x] All 294 agent tests pass
- [ ] Verify no TS errors in react-router example IDE

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-14 14:11:18 +02:00
Jordan Ritter 15e096dd6b fix: starter-crewai-crews ignore TS build errors in Docker
HttpAgent type doesn't fully implement AbstractAgent, causing TS type
error during next build. Use ignoreBuildErrors like other starters.
2026-04-13 21:51:09 -07:00
Jordan Ritter 2a5e62d8a5 fix: starter-langgraph-python copy showcase.json into Docker context
The import ../../../../showcase.json from apps/app/src/hooks/ resolves
to the context root, but only apps/app/ was copied. Add COPY for
showcase.json.
2026-04-13 21:50:06 -07:00
Jordan Ritter cf75ec58b1 fix: resolve remaining 3 deploy failures
- starter-langgraph-python: use next build --webpack (Turbopack default
  in Next 16 can't handle serverExternalPackages)
- starter-crewai-crews: bump ag-ui-protocol>=0.1.10 to match
  ag-ui-crewai 0.1.5 requirement
- shell-dojolike: add recharts dependency (used by shared frontend)
2026-04-13 21:41:50 -07:00
Jordan Ritter 5aed8ee088 fix: resolve 4 remaining showcase deploy failures
- Remove test-integration-tmp from workflow (package was deleted)
- starter-langgraph-python: disable Turbopack for Next.js build
  (serverExternalPackages incompatible with Turbopack)
- starter-crewai-crews: pin crewai-tools~=0.47.1 to avoid version
  conflict with crewai==0.130.0
- shell-dojolike: add missing zod dependency (required by shared
  frontend modules)
2026-04-13 21:37:03 -07:00
Martha Schumann 14ae28cfd1 feat(inspector): add thread store registry, runtime handlers, and useThreads hook
- CopilotKitCore gains a ThreadStoreRegistry (register/unregister by agentId)
  and a new onAgentRunStarted subscriber event so the inspector can subscribe
  before agent.runAgent() snapshots the subscriber list
- Runtime gains handleListThreads, handleUpdateThread, handleArchiveThread,
  handleDeleteThread, handleSubscribeToThreads, and handleGetThreadMessages
  handlers; all mutations are authenticated via identifyUser (request body
  userId is ignored)
- InMemoryAgentRunner now stores thread history for the local-dev fallback
  path; debug console.log removed; InMemoryThread uses literal types for
  constant-value fields (organizationId: "", createdById: "", archived: false)
- useThreads hook registers its store with CopilotKitCore on mount and
  unregisters on unmount so the inspector can read thread state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:43:27 -07:00
Tyler Slaton 9554d5886c fix(langgraph-python): update deps and lockfile
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-04-13 15:07:49 -07:00
Jordan Ritter 50439f5e12 fix: remove unused variables and prevent silent test pass in dark mode tests
Remove captured-but-never-asserted colorBefore and markerColorLight
variables. Replace silent if-guard in poweredBy test with explicit
test.skip so missing elements surface in test reports instead of
silently passing.
2026-04-13 14:33:20 -07:00
Jordan Ritter f30f001f83 test: add Playwright regression test for dark mode CSS scoping (#2920)
Verifies that .dark CSS selectors in console.css and input.css are
properly scoped to CopilotKit elements and do not leak into the host
application. Tests detect the specific rgb(69, 69, 69) color leak that
occurred when .dark was used as a standalone selector.
2026-04-13 09:17:41 -07:00
Alem Tuzlak 327d134ecd Merge remote-tracking branch 'origin/main' into worktree-nested-tinkering-quail
# Conflicts:
#	packages/angular/package.json
#	packages/core/package.json
#	packages/demo-agents/package.json
#	packages/react-core/package.json
#	packages/runtime/package.json
#	packages/shared/package.json
#	packages/sqlite-runner/package.json
#	packages/web-inspector/package.json
#	pnpm-lock.yaml
2026-04-13 11:12:25 +02:00
Martha Schumann c27b162589 fix: pin @ag-ui/client to 0.0.52 in CLI templates
Templates were pinned at old @ag-ui/client versions (0.0.40–0.0.46).
@copilotkit/runtime@1.55.2 ships 0.0.52, which added private fields to
AbstractAgent. The version split caused a nominal type error on build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 17:22:14 -07:00