[pull] main from CopilotKit:main#372
Merged
Merged
Conversation
…racy The copilotkit-upgrade skill was the one skill skipped by the v2 migration. It routed migrators to packages that do not exist and documented many v2 APIs incorrectly, so following it produced non-installable / non-compiling code. This is a full accuracy pass, verified against the live source barrels. Package paths (phantom -> real /v2 subpaths): - `@copilotkit/react` (phantom) -> `@copilotkit/react-core/v2` - `@copilotkit/agent` (phantom) -> `@copilotkit/runtime/v2` (`BuiltInAgent`) - bare `@copilotkit/runtime` for v2-only APIs -> `@copilotkit/runtime/v2` - `createCopilotEndpointExpress` (phantom) -> `createCopilotExpressHandler` (/v2/express) - `LangGraphAgent` -> `@copilotkit/runtime/langgraph` (no separate @Ag-ui install) API accuracy: - `available` is a boolean (default true; false hides), not "enabled"|"disabled" - `useRenderToolCall()` / `useRenderActivityMessage()` are zero-arg, return a render function; renderers match by tool name, not call id - `LangGraphAgent` config field is `deploymentUrl`, not `url` (compile error) - `BuiltInAgent` model strings use slash form + real ids (openai/gpt-4o, anthropic/claude-sonnet-4.5, google/gemini-2.5-pro) - `GroqAdapter` / `BedrockAdapter` -> custom `AbstractAgent` (no such provider; vertex is Google, not AWS Bedrock) - `createCopilotEndpoint` / `createCopilotEndpointExpress` flagged @deprecated; canonical: `createCopilotHonoHandler` / `createCopilotExpressHandler` - `TextMessage` is not a v2 type; use the `Message` union / per-role types - `mcpApps.servers` entries are flat `{ type, url }`, not `{ transport: {...} }` - Next.js App Router needs `export const POST/GET = app.fetch` (not `export default`) - `useCopilotKit` returns `{ copilotkit, executingToolCallIds }` from `/v2/context` - `useDefaultTool` -> split: `useDefaultRenderTool` (render) + `useFrontendTool` (handler) - `LangGraphHttpAgent` is a distinct class, not merged into `LangGraphAgent` - `guardrails_c` is active for CopilotCloud topic restrictions on the compat provider (not a delete-me no-op); no effect on the v2 AG-UI runtime - `CopilotKitProps` extends `Omit<CopilotKitProviderProps, "children">` - tool-call render props include `toolCallId`; reconciled `ToolCallStatus` and `useInterrupt` render-prop wording; v1 Next.js handler is `copilotRuntimeNextJSAppRouterEndpoint` (not `copilotKitEndpoint`) - fixed a self-contradictory sentence in the Overview Also rewrites sources.md, which was generated against a non-existent `packages/v1/*` / `packages/v2/*` layout (the root cause of the phantom names), and corrects its file-path citations to the real flat layout.
The previous guide documented an older API (createTeamsAgentBot, a local "Teams DevTools" bridge) that shipped through copilotkitnext. Rewrite it for the new createBot + teams() PlatformAdapter, mirroring the Slack guide: M365 Agents Playground quickstart, interactive Adaptive Cards, a human-approval gate, splitting the bot from its agent over AG-UI, and Azure sideloading into real Teams. Also refresh the frontend picker summary (Playground, not DevTools).
… streamed replies, and HITL Adds the @copilotkit/bot-teams package: a PlatformAdapter that bridges the CopilotKit runtime to Microsoft Teams. Renders agent output as Adaptive Cards (including native <Chart> components via bot-ui), streams replies with a typing-indicator heartbeat, supports human-in-the-loop confirmations, and handles inbound files via the Graph API with channel file support.
…ads, and HITL Adds examples/teams: a runnable Teams bot built on @copilotkit/bot-teams. Demonstrates rendering charts from uploaded CSV files, inbound file handling over the Graph API, and human-in-the-loop confirmation flows, plus the Teams app manifest and packaging scripts.
The showcase-strands-typescript integration was staging-only: it had no production Railway serviceInstance, so the prod D6 dashboard column showed a uniform false-red (every cell errorClass=goto-error, backendUrl="") — the probe navigated a bare relative path because the harness had no prod health record / backendUrl to discover. Provisions the prod serviceInstance (8a50728e-6119-43c4-b59c-d9535b6717a4, domain showcase-strands-typescript-production.up.railway.app, healthcheck /api/health, image pinned to the GHCR @sha256 digest, OPENAI_BASE_URL at prod aimock) and brings the SSOT to the dual-env showcase-strands shape: - railway-envs.ts: add the prod env entry with the real instanceId, gateValidated:true, drop gateIgnore, remove the legacyJsonCompat prod-domain placeholder. - railway-envs.generated.json: regenerated (prod instanceId/domain, probe.prod true, prod healthcheck; moved into the promote closure, tier 2). - railway-envs.golden.json: regenerated to include the new prod (service,env) pair (intentional behavior change, not a refactor regression). - showcase_promote.yml: dropdown regenerated to list strands-typescript. - verify-railway-image-refs.test.ts / redeploy-env.test.ts: update the gateValidated/scope counts (39->40 gate targets, prod default 38->39) and the now-stale staging-only comments. RED->GREEN (live prod): BEFORE /api/health 404, prod PocketBase health:strands-typescript totalItems:0, the 3 named D6 cells all errorClass=goto-error backendUrl="". AFTER /api/health 200, prod PocketBase health:strands-typescript present (status:200, valid url), verify-railway-image-refs OK 80 instances.
`copilotkit-upgrade` was the one skill the v2 migration skipped. It routed users to packages that don't exist, so following it produces a non-installable app. Root cause: the skill was generated against a non-existent `packages/v1/*` / `packages/v2/*` layout. The repo is flat and v2 ships from the `/v2` subpath of the same packages. ## Fix (pure docs) Corrected every package/import reference across `SKILL.md` plus the three reference files against the live exports maps: | Phantom in skill | Real target | | --- | --- | | `@copilotkit/react` | `@copilotkit/react-core/v2` | | `@copilotkit/agent` | `@copilotkit/runtime/v2` (`BuiltInAgent`) | | bare `@copilotkit/runtime` for v2 APIs | `@copilotkit/runtime/v2` | | `createCopilotEndpointExpress` (doesn't exist) | `createCopilotExpressHandler` (`@copilotkit/runtime/v2/express`) | Also fixed the install commands and regenerated `sources.md` against the real flat layout. ## Verification Grep sweep shows zero remaining phantom references, and every v2 symbol the skill now cites was confirmed to exist in the live source barrels.
…T) (#5705) ## What The `showcase-strands-typescript` integration was **staging-only** — it had no production Railway serviceInstance. As a result the prod D6 dashboard column was a uniform **false-red**: every cell reported `errorClass=goto-error` with `backendUrl=""`, because the harness had no prod health record to hand the probe, so Playwright navigated a bare relative path (`page.goto("/demos/…")`) and Chromium rejected it as an invalid URL. This brings the service into production so the prod D6 column mirrors **staging's actual pattern** (the false goto-error reds disappear; whatever staging genuinely passes, prod passes). Fixing staging's ~7 genuinely-broken feature cells is **out of scope**. ## Infra provisioned (production) - **prod serviceInstance** `8a50728e-6119-43c4-b59c-d9535b6717a4` created (via `environmentStageChanges` + `environmentPatchCommitStaged`, mirroring the peer prod TS service `showcase-claude-sdk-typescript`). - **domain** `showcase-strands-typescript-production.up.railway.app`, **healthcheck** `/api/health`, image **pinned** to the GHCR `@sha256` digest, `restartPolicyType` `ON_FAILURE`, auto-updates `minor`. - **app vars** mirror staging's set with `OPENAI_BASE_URL` repointed at prod aimock (`https://showcase-aimock-production.up.railway.app/v1`). No real prod secret needed: the agent routes 100% to aimock and staging's `OPENAI_API_KEY` is the `sk-aim…` aimock placeholder — so nothing secret was sourced. - deployment **SUCCESS**. ## SSOT / code changes - `railway-envs.ts` — convert the `showcase-strands-typescript` block to the dual-env `showcase-strands` shape: add the `prod` env entry with the real instanceId, `gateValidated:true`, drop `gateIgnore`, remove the `legacyJsonCompat` prod-domain placeholder, update the leading comment. - `railway-envs.generated.json` — regenerated (real prod instanceId/domain, `probe.prod:true`, prod healthcheck; service moves into the promote closure, tier 2). - `railway-envs.golden.json` — regenerated to include the new prod `(service, env)` pair (intentional behavior change, not a refactor regression). - `showcase_promote.yml` — promote dropdown regenerated to list `strands-typescript`. - `verify-railway-image-refs.test.ts` / `redeploy-env.test.ts` — update the gateValidated/scope counts (39→40 gate targets; prod default scope 38→39) and the now-stale "staging-only" comments. ## RED → GREEN proof (live prod) | Check | RED (before) | GREEN (after) | |---|---|---| | prod `/api/health` | **404** (staging 200) | **200** `{"status":"ok","integration":"strands-typescript"}` | | prod PocketBase `health:strands-typescript` | **totalItems:0** | **present** — `status:200`, `url=…-production…/api/health` | | `d6:strands-typescript/agentic-chat` | `errorClass=goto-error`, `backendUrl=""` | _flips on next D6 tick_ (staging: fail_count:0, 3 turns) | | `d6:strands-typescript/prebuilt-popup` | `errorClass=goto-error`, `backendUrl=""` | _flips on next D6 tick_ (staging: fail_count:0) | | `d6:strands-typescript/chat-css` | `errorClass=goto-error`, `backendUrl=""` | _flips on next D6 tick_ (staging: fail_count:0) | `verify-railway-image-refs.ts` now reports **✓ 80 env-scoped instances verified**. The D6 cell flip lands on the prod harness's next hourly `d6-all-pills-e2e` tick (the harness already discovered the new prod health record); this comment will be updated with the post-flip payloads. ## Quality gates `scripts` vitest: **2110 passing**. `emit --check`, `sync-promote-service-options --check`, `verify-railway-image-refs.ts`: all clean. oxlint: 0. tsc: changed files clean (one pre-existing unrelated error in `generate-search-index.ts` on `main`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
…uction Adds a "Promoting a Staging-Only Integration to Production" section to showcase/RAILWAY.md — the staging-first -> promote-later procedure that was undocumented and caused the strands-typescript D6 false-red (PR #5705). The procedure previously survived only as a comment inside the SSOT (railway-envs.ts); there was no human-facing SOP. The new section is a start-to-finish checklist grounded in the PR #5705 worked example: - When it applies (gateValidated:false, gateIgnore:true, staging-only env map, legacyJsonCompat prod placeholder). - The critical gotcha up front: the promote pipeline (showcase_promote.yml / bin/railway promote) only moves digests to a prod service that ALREADY exists; it does NOT provision a new prod serviceInstance. Until that instance exists, D6 false-reds the whole column (404 -> empty backendUrl -> goto-error on every cell). - Ordered steps: provision the prod serviceInstance out-of-band (environmentStageChanges + environmentPatchCommitStaged, mirroring a peer prod TS service); edit the SSOT (add prod env block, gateValidated:true, drop gateIgnore, remove legacyJsonCompat); regenerate derived artifacts (emit-railway-envs-json.ts, golden fixture, sync-promote-service-options.ts) and run the gate (verify-railway-image-refs.ts + vitest); prod secrets via the prod env var set / aimock (no inline secrets); verify GREEN (/api/health 200, prod PocketBase health record, D6 flips on the next hourly :40 tick). Cross-links INTEGRATION-CHECKLIST.md §B (single-shot bring-up) both ways. Leaves a precise TODO that §B.3 still names the stale showcase_deploy.yml for the build matrix (the RAILWAY.md references were already corrected on main).
…uction (#5706) ## What Adds a **"Promoting a Staging-Only Integration to Production"** section to `showcase/RAILWAY.md` — the staging-first → promote-later procedure that was undocumented and caused the `strands-typescript` D6 false-red fixed in #5705. The procedure previously survived only as a comment inside the SSOT (`railway-envs.ts`); there was no human-facing SOP. Cross-links `INTEGRATION-CHECKLIST.md` §B (single-shot bring-up) both ways. ## Where placed `showcase/RAILWAY.md`, immediately after "Adding a New Railway Service" and before "Environment IDs" — the natural flow (provision a new service → promote a staging-only one to prod). Matches the file's existing `##`/`###` heading depth and voice. ## Accuracy gate — each prescribed step → its grounding evidence Verified against the post-#5705 repo state (branched off `origin/main`, which includes the #5705 merge `d78fc07afd`) and the #5705 diff. | Prescribed step / claim | Evidence | |---|---| | "When this applies": `gateValidated:false`, `gateIgnore:true`, staging-only env map, `legacyJsonCompat.domains.prod` placeholder | #5705 diff of `railway-envs.ts` (the removed lines) — borrowed staging host `showcase-strands-typescript-staging.up.railway.app` | | Gotcha: promote only moves digests to an EXISTING prod service, does not provision | `showcase_promote.yml` header "Promotes the staging-tested digest … to prod"; `bin/README.md` defers "new-service provisioning" to RAILWAY.md (line 6); no provisioning subcommand in `bin/railway` | | Gotcha: D6 false-reds whole column (404 → empty `backendUrl` → `goto-error`) | diag doc: prod `/api/health` 404, `health:strands-typescript` totalItems:0, `backendUrl:""`, `errorClass=goto-error` on every cell | | Provision via `environmentStageChanges` + `environmentPatchCommitStaged`, mirror peer prod TS `showcase-claude-sdk-typescript`; materialized instance `8a50728e…` | remediation doc Step 2; #5705 commit body | | SSOT edit: add `prod` env block w/ real `instanceId`, `gateValidated:true`, drop `gateIgnore`, remove `legacyJsonCompat` | #5705 diff of `railway-envs.ts` (exact before/after); `gateValidated` JSDoc at `railway-envs.ts:205-216` ("new SSOT services MUST land `gateValidated:true`"; `gateIgnore` only for untracked/domainless/single-env) | | `npx tsx showcase/scripts/emit-railway-envs-json.ts` (CI `--check`) | `emit-railway-envs-json.ts` header; `showcase_reconcile.yml:60`, `showcase_promote.yml:132` | | Regenerate golden fixture `__tests__/fixtures/railway-envs.golden.json`; intentional change | path exists; `railway-envs.golden.test.ts` is a behavior-preservation guard (header) | | `npx tsx showcase/scripts/sync-promote-service-options.ts` (CI `--check`) | `showcase_promote.yml:32` generated-block marker; `showcase_validate.yml:399`; `strands-typescript` now at `showcase_promote.yml:75` | | `npx tsx showcase/scripts/verify-railway-image-refs.ts` gate | `showcase_build.yml:341` | | `pnpm exec vitest run` from `showcase/`; `verify-railway-image-refs.test.ts` / `redeploy-env.test.ts` counts change | `showcase_validate.yml:362`; both test files exist | | Secrets via prod env var set / aimock, no inline secrets; `OPENAI_BASE_URL` asserted prod→prod | remediation doc Step 2 (no prod secret sourced, `sk-aim` placeholder); `railway-envs.ts:1167-1170` serviceRef comment | | Verify GREEN: `/api/health` 200, prod PocketBase `health:<slug>` record, D6 flips next hourly `:40` tick | remediation doc Steps 5-6 (health 404→200, record absent→present, cells flipped at 20:45 tick); diag doc dimension "d6", `d6-all-pills-e2e` hourly :40 | ## `showcase_deploy.yml` staleness — CONFIRMED, already fixed on main The doc-gap analysis flagged that docs referenced `showcase_deploy.yml` as the prod/build path. **Verified against the workflows:** `showcase_deploy.yml` is now "Showcase: Verify Deploy" (staging health-verification gate — "Push-to-main redeploys staging only"); the `ALL_SERVICES` build/push matrix lives in `showcase_build.yml` ("Build & Push"); the prod path is `showcase_promote.yml` ("Promote (staging → prod)"). **`RAILWAY.md` on main was already corrected** (it cites `showcase_build.yml` for the matrix and describes `showcase_deploy.yml` as the verify gate), so there is no stale reference left in RAILWAY.md to fix. The one remaining stale reference is **`INTEGRATION-CHECKLIST.md` §B.3**, which still names `showcase_deploy.yml` for the build job — left as a precise TODO in the new section (out of scope for this doc edit; flagged for a follow-up). ## Checks - Referenced file paths all verified to exist (bin/README.md, INTEGRATION-CHECKLIST.md, the 4 scripts, golden fixture + test, both `.test.ts`). - Commit passed commitlint (`docs(showcase):` prefix). lefthook's pre-commit oxlint/oxfmt excludes markdown, so no code-lint applies; no markdownlint config in repo. Does NOT merge. Branch only.
…5615) Rewrites the Microsoft Teams guide for the new `@copilotkit/bot-teams` adapter added in #5497. The existing guide documented an older API (`createTeamsAgentBot`, a local "Teams DevTools" bridge) that shipped through copilotkitnext and no longer matches the package. This rewrites it to mirror the Slack guide: - Quickstart with `createBot` + the `teams()` adapter, verified in the M365 Agents Playground (no Microsoft account) - Interactive Adaptive Cards with inline `onClick` handlers - A human-approval gate via `thread.awaitChoice` - Splitting the bot from its agent over AG-UI - Azure sideloading into real Teams (tunnel, Entra app, Azure Bot, manifest) Also refreshes the frontend picker summary (Playground, not DevTools). ### Merge ordering This depends on #5497. The Teams guide is an `earlyAccess` page, so it should not go live until `@copilotkit/bot-teams` actually publishes. **Merge this after #5497 ships the package.**
… streamed replies, and HITL (#5497) ## `@copilotkit/bot-teams` Microsoft Teams adapter for the platform-agnostic [`@copilotkit/bot`](../tree/main/packages/bot) engine, plus a runnable `examples/teams` demo. Same `PlatformAdapter` contract as [`@copilotkit/bot-slack`](../tree/main/packages/bot-slack): write the bot once with `createBot`, run it on Teams by adding `teams()`. Built on the Microsoft 365 Agents SDK, and reviewable in the M365 Agents Playground with no Microsoft credentials. It renders the `bot-ui` JSX vocabulary as Adaptive Cards (including native Teams charts via a `<Chart>` component, no headless browser), streams replies by edit, gates writes with HITL approval buttons, and reads/writes files. The `examples/teams` demo wires a `BuiltInAgent` that auto-renders cards, charts uploaded CSVs, and gates announcements. ## Files: how they reach the bot Teams hands a bot uploaded files differently per scope: - **1:1 (personal) chat**: delivered inline (`file.download.info`); needs `supportsFiles: true` (set). No extra setup. - **Channel / group chat**: Teams does **not** send the file to bots, so the adapter fetches it via Microsoft Graph (read the channel message for the SharePoint reference, download via `/shares`). Requires `Files.Read.All` (application, admin consent) + `ChannelMessage.Read.Group` (RSC, consented by a team owner at install). - **Anywhere**: pasting the data as text always works. Without Graph consent the bot degrades gracefully to this. ## Docs Microsoft Teams guide rewrite: #5615.
## What Bake a heap ceiling into the `@copilotkit/core` build script: ```diff -"build": "tsdown", +"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsdown", ``` (`cross-env` is already used elsewhere in the repo; added here as a core devDependency.) ## Why The core build (tsdown + dts generation) has a ~3.45GB working set and OOMs under `nx run-many`, where it competes with sibling builds and GC falls behind. This mostly bites **local development**. Agents (and humans) routinely have to prefix commits with `NODE_OPTIONS=--max-old-space-size=8192` just to get the build through pre-commit hooks. CI already sets this flag at the workflow level, so baking it into the build script means every invocation path gets the same headroom without anyone remembering to add it: local lefthook hooks, `nx run-many`, a direct `pnpm build`, CI, and Windows (hence `cross-env`). Scoped to core only, since it's the single package that OOMs.
## Summary - Add `bot-teams` to the canary, stable, and publish release workflows - Register `@copilotkit/bot-teams` in release configuration - Extend the release scope type to include `bot-teams` and `bot-whatsapp` ## Testing - Not run (not requested)
## Release bot-teams v0.1.0 **Scope:** `bot-teams` | **Bump:** `minor` --- ### How this release process works 1. **This PR was created automatically** by the "release / create-pr" workflow. It bumped the `bot-teams` packages to `0.1.0` 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 `bot-teams` packages to npm at version `0.1.0` - Creates git tag `bot-teams/v0.1.0` - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )