Commit Graph

12110 Commits

Author SHA1 Message Date
github-actions[bot] 113d900702 style: auto-fix formatting 2026-05-19 16:41:33 +00:00
Alem Tuzlak 5cd77233b7 feat(showcase/ms-agent-python): LGP parity sweep — 33/37 cells green
Brings ms-agent-python to one-to-one parity with langgraph-python (the D5
north star). Playwright e2e suite goes from 49/108 (~26%) → 164/178 (~92%),
33 of 37 cells fully green.

Manifest parity:
- Drop 4 MAF-only cells with no LGP analog: agentic-chat-reasoning,
  hitl-in-chat-booking, shared-state-write, reasoning-default-render.
  Reasoning is handled by reasoning-default + reasoning-custom (LGP);
  booking pill folds into hitl-in-chat; shared-state-write was a TODO stub.
- Rename byoc-hashbrown → declarative-hashbrown and byoc-json-render →
  declarative-json-render. Demo dir, API route dir, and frontend agent id
  follow LGP's naming. Python module files retain the legacy `byoc_*`
  prefix and FastAPI paths stay `/byoc-hashbrown` / `/byoc-json-render`
  (matches LGP's "module name retains legacy graph id" convention).
- Port LGP `_shared/`, `_shared/interrupt-fallback-slots.ts`, and
  `demos/layout.tsx` for one-to-one parity.

Cells ported verbatim from LGP (page + spec):
- agentic-chat, auth, beautiful-chat, chat-customization-css, chat-slots,
  declarative-gen-ui, declarative-hashbrown, declarative-json-render,
  frontend-tools, frontend-tools-async, gen-ui-agent, gen-ui-interrupt,
  gen-ui-tool-based, headless-complete, headless-simple, hitl-in-app,
  hitl-in-chat, shared-state-read, shared-state-read-write,
  shared-state-streaming, subagents, tool-rendering, plus all four
  tool-rendering* variants, a2ui-fixed-schema, agent-config, mcp-apps,
  multimodal, open-gen-ui, open-gen-ui-advanced, prebuilt-popup,
  prebuilt-sidebar, readonly-state-agent-context, reasoning-default,
  reasoning-custom, voice.

Backend infrastructure:
- Swap shared `OpenAIChatClient` (Responses API) → `OpenAIChatCompletionClient`
  (ChatCompletions). Root cause of the cross-cell post-tool ChatClientException
  family: Responses API is stateful and only sends NEW items per leg,
  relying on `previous_response_id` for history. aimock has no view of
  that server-side state, so second-leg requests arrived without the
  user message — fixture matchers keyed on `userMessage` couldn't fire
  and the run fell through to real OpenAI. ChatCompletions sends full
  history every leg, matching the LGP wire shape.
- Bump @ag-ui/client ^0.0.43 → ^0.0.53 (matches google-adk/LGP). Fixes
  the REASONING_* Zod discriminator trap on the catch-all agent.
- Regenerate package-lock.json in isolation outside the pnpm monorepo so
  npm-arborist doesn't resolve transitives against pnpm's hoisted
  symlinks (avoid 40+ `../../../node_modules/.pnpm/...` paths in the
  lockfile that break `npm ci` inside Docker).
- Add `yaml` (^2.8.4) for the new `src/app/demos/layout.tsx` that reads
  manifest.yaml for per-cell page titles (LGP parity).

New / re-added MAF agent backends with LGP-equivalent behavior:
- reasoning_agent.py (uses Responses API explicitly — the only chat
  client that emits AG-UI REASONING_MESSAGE_* events; rest of the
  integration stays on ChatCompletions).
- tool_rendering_agent.py (non-reasoning sibling of the existing
  reasoning_chain variant; shares tool surface via direct imports so
  they can never drift apart; routes the three catchall cells to a
  non-reasoning backend so the default renderer spec stops failing on
  leaked reasoning blocks).
- gen_ui_agent.py — `set_steps` tool + `steps` state schema +
  `predict_state_config` mirrors LGP's StateStreamingMiddleware shape.
- shared_state_streaming.py — `write_document` tool with
  `predict_state_config` that streams the `document` arg into
  `state.document` per-token.
- readonly_state_agent_context.py — minimal agent that consumes
  frontend-provided `useAgentContext` entries; no tools.
- headless_complete_agent.py — three deterministic tools (`get_weather`,
  `get_stock_price`, `get_revenue_chart`) mounted at /headless-complete
  on the mcp-apps runtime (was routing to catch-all sales agent, which
  returned seeded-random weather instead of the deterministic 68°F the
  test asserts on).

Wiring:
- copilotkit/route.ts: register the new agents, drop the stale
  shared-state-write entry, route all three tool-rendering variants to
  the non-reasoning backend (the reasoning-chain cell keeps its own
  dedicated path), register reasoning-default + reasoning-custom on
  /reasoning, register gen-ui-agent on /gen-ui-agent,
  shared-state-streaming on /shared-state-streaming,
  readonly-state-agent-context on its dedicated path.
- copilotkit-mcp-apps/route.ts: register headless-complete agent (was
  missing — the strict useAgent runtime sync in the newer
  @copilotkit/react-core surfaced the gap).
- copilotkit-declarative-hashbrown/route.ts + copilotkit-declarative-json-render/route.ts:
  new dedicated runtimes; agent IDs and runtime URLs follow LGP.
- copilotkit-declarative-gen-ui/route.ts: drop non-LGP `openGenerativeUI:
  false` for parity.

A2UI tool rename — `render_a2ui` → `_design_a2ui_surface`:
- Ported LGP's `tools/generate_a2ui.py` (LGP renamed the secondary-LLM
  tool to `_design_a2ui_surface` to avoid the A2UI middleware's bypass;
  shared d5-all.json fixtures key the response on this name).
- Renamed every `render_a2ui` occurrence in src/agents/{a2ui_dynamic,
  agent,beautiful_chat}.py and `tools/__init__.py`.
- Updated 4 declarative-gen-ui aimock fixtures to pass `context` arg in
  the first-leg `generate_a2ui` tool call (agent_framework doesn't
  auto-inject AgentSession into our @tool function so `session=None` and
  the secondary-LLM `user_content` was defaulting to a catch-all string
  containing "KPI dashboard" — every pill matched the KPI fixture).

Aimock router patch persisted alongside the integration changes:
hasToolResult matcher restricted to scan only messages after the last
user message (was global). The patch lives in F:/projects/cpk/aimock —
upstream PR pending.

Test infrastructure:
- playwright.config.ts: cap local workers at 4 + retries at 1. CI keeps
  workers=1, retries=2. `agent_framework.Agent` is reused across requests
  and the shared OpenAI HTTP client serialises concurrent SSE streams;
  >4 workers makes 30s timeouts inevitable on a few cells. Confirmed
  with hard data: workers=1 = 164 passed (16.8 min), workers=4+retries=1
  = 164 passed (7.2 min), workers=undefined = 159 passed. Same green
  set, ~2x faster. Long-term upstream fix is per-request Agent
  instantiation in agent_framework_ag_ui.

Remaining 14 failures across 4 cells documented per-cell in the Notion
D5 sweep doc (declarative-gen-ui A2UI surface mounting, multimodal
attachment forwarding, tool-rendering-default-catchall multi-pill chain,
tool-rendering-reasoning-chain multi-leg chains). Each has a specific
next-pass action.
2026-05-19 18:36:01 +02:00
Jordan Ritter 4e1b5ad373 chore: release monorepo v1.57.3 (#4922)
## Release monorepo v1.57.3

**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.57.3`
   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.57.3`
   - Creates git tag `monorepo/v1.57.3`
   - 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.
v1.57.3
2026-05-19 09:08:48 -07:00
Ran Shem Tov 4de3562bc8 chore: revert docker route override change 2026-05-19 11:07:17 -05:00
github-actions[bot] 499740952b style: auto-fix formatting 2026-05-19 11:06:47 -05:00
Ran Shem Tov 70b4d28063 chore: use latest agui strands integration 2026-05-19 11:06:47 -05:00
Ran Shem Tov a6c3fcbc2a test(showcase): strands-python uses showcase shell, set hasAppMode true
starter-smoke @interaction branches on `starter.hasAppMode`: when true it
clicks the App/Chat toggle and asserts the canvas + textarea; when false
it assumes a CopilotSidebar layout and asserts "Popup Assistant".

Strands now renders the same showcase shell as langgraph-python (App/Chat
toggle + ExampleCanvas), so the smoke test must take the `hasAppMode:
true` branch. Without this flag the test waits for "Popup Assistant" text
that never appears and times out.
2026-05-19 11:06:47 -05:00
Ran Shem Tov d07c058b33 chore(strands): drop langgraph naming from docker smoke stack
Previous commit wired LANGGRAPH_DEPLOYMENT_URL into the strands route.ts
to satisfy the verbatim langgraph-python docker-compose.test.yml — that
leaks the wrong runtime's name into a strands-only file.

Instead, mark docker-compose.test.yml as allowed-divergence for strands
(parity manifest) and give strands its own compose stack:
  - agent on port 8000 (matches `npm run dev:agent` locally)
  - healthcheck on /health (already exposed by main.py)
  - app reads AGENT_URL (strands-native), no LANGGRAPH_DEPLOYMENT_URL

Reverts:
  - Dockerfile.agent: EXPOSE/uvicorn back to 8000
  - main.py: drop the /ok endpoint added in 2994b3a96
  - route.ts: drop the LANGGRAPH_DEPLOYMENT_URL fallback

Keeps:
  - Dockerfile.agent: COPY src/ ./src/ (needed for db.csv + a2ui schemas)
2026-05-19 11:06:47 -05:00
Ran Shem Tov 4341880dec chore(strands): align agent with verbatim docker smoke stack
The smoke-test docker-compose.test.yml is a verbatim copy of the canonical
langgraph-python stack, which expects:
  - agent listening on port 8123
  - readiness probe at /ok
  - app reading LANGGRAPH_DEPLOYMENT_URL for the agent URL

Bring the strands agent in line:
  - Dockerfile.agent: COPY src/ so main.py can find db.csv +
    a2ui/schemas/flight_schema.json; expose 8123 and bind uvicorn to it
  - main.py: add /ok alongside existing /health endpoint
  - route.ts: read LANGGRAPH_DEPLOYMENT_URL as a fallback so the verbatim
    compose env wires through; AGENT_URL / STRANDS_AGENT_URL still win
    for local dev overrides
2026-05-19 11:06:47 -05:00
github-actions[bot] 2db98e69ee style: auto-fix formatting 2026-05-19 11:06:47 -05:00
Ran Shem Tov d94cb38178 chore(strands): fix CI on canonical demo renovation
- Drop local editable uv.sources for ag_ui_strands; pin agent deps to
  exact resolved versions so CI resolves from PyPI
- Switch docker-route-override.ts to type-only NextRequest import across
  strands-python and the three langgraph integrations to satisfy
  oxlint + restore parity-check
- Pin showcase/integrations/strands deps to exact versions matching the
  upgraded agent (ag-ui-protocol, strands-agents, ag_ui_strands, copilotkit,
  langchain, langchain-openai, openai, @copilotkit/* @ 1.56.5, @ag-ui/client
  @ 0.0.52); add missing @copilotkit/react-ui and @copilotkit/shared
- Ratchet validatePinsFailCount baseline 98 -> 87 (drift decreased)
2026-05-19 11:06:44 -05:00
Ran Shem Tov 2d1ede341c chore: renovate aws strands canonical demo 2026-05-19 11:06:28 -05:00
tylerslaton efae3dfb5b chore: release monorepo v1.57.3 2026-05-19 15:59:44 +00:00
Tyler Slaton e02908d688 Fix rAF teardown errors in CopilotChat perf tests and lefthook script (#4921)
## What does this PR do?

This PR addresses two issues:

1. **CopilotChat perf test flakiness**: Fixes unhandled errors from
`@tanstack/virtual-core` 3.13.18's `scrollToIndex` method, which
schedules nested `requestAnimationFrame` callbacks without null-checking
`targetWindow`. When the virtualizer unmounts and sets `targetWindow =
null`, pending rAF callbacks throw "Cannot read properties of null
(reading 'requestAnimationFrame')". The fix wraps both
`globalThis.requestAnimationFrame` and `window.requestAnimationFrame` to
catch and swallow this known tanstack teardown error while allowing
other errors to propagate.

2. **Lefthook script robustness**: Fixes the pre-commit
oxlint/oxfmt/ruff hook to properly handle staged files with spaces or
special characters. The old `[ -n "{staged_files}" ]` check failed with
"unexpected operator" errors because lefthook interpolates file lists as
space-separated words. The fix uses `set --` to convert the file list
into positional arguments, enabling proper shell-portable testing and
quoting.

## Related PRs and Issues

- Addresses flakiness in `CopilotChat perf — re-render regression` test
suite
- Improves reliability of pre-commit linting hooks

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] Changes are covered by existing test infrastructure (perf tests
now pass reliably)
- [x] "Allow edits by maintainers" is checked

https://claude.ai/code/session_01MvPWxQAVmUmZRB6dTnJyjU
2026-05-19 08:57:32 -07:00
Claude ce3084700c fix(release): swallow tanstack/virtual rAF teardown error in perf test
The release-PR workflow's pre-commit hook ran the full test suite and
failed because @tanstack/virtual-core 3.13.18 has a latent bug — its
scrollToIndex schedules a nested rAF that calls
`this.targetWindow.requestAnimationFrame(verify)` with no null-check.
The virtualizer's cleanup nulls `targetWindow` on React unmount, so the
queued rAF fires post-unmount and throws. All 1170 tests passed, but
vitest exited non-zero from the unhandled error.

Wrap rAF on both globalThis and window (separate bindings in
vitest+jsdom; tanstack uses `targetWindow.rAF` which resolves to
`window.rAF`) so callbacks hitting this specific error are swallowed.

Also fix the lint-fix lefthook command — `[ -n "{staged_files}" ]`
broke on multi-file expansion ("[: <path>: unexpected operator")
because lefthook interpolates files as space-separated words, not a
quoted string. Use `set --` to put them in positional args.
2026-05-19 15:28:07 +00:00
Jordan Ritter 3981a7e6fb fix(showcase): un-skip declarative-gen-ui KPI + StatusReport tests (#4918)
## Summary
- Un-skip KPI dashboard and Status report tests in declarative-gen-ui
- Fix CSS selector mismatch: tests used inline-style selectors but
components use Tailwind classes
- Switch to existing `data-testid` attributes (`declarative-metric`,
`declarative-status-badge`)

## Root cause
Tests were skipped citing "Railway slowness" (W8-7) but the real issue
was CSS selector mismatch — inline-style queries never matched
Tailwind-rendered components.

## Test plan
- [x] 6/6 declarative-gen-ui tests pass on LGP (port 3100)
- [x] 6/6 pass on LGT (port 3101)
- [x] Specs byte-identical between LGP and LGT

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-19 07:58:50 -07:00
Jordan Ritter 19271bf5c9 Un-skip KPI dashboard and Status report declarative-gen-ui tests
The two tests were skipped (W8-7) under the assumption that Railway
agent slowness caused timeouts. The actual root cause was twofold:

1. Fixture content+toolCalls split (already fixed in 2436adba6 for all
   four pills including KPI and StatusReport).

2. CSS selector mismatch: the tests used inline-style selectors
   (letter-spacing: 0.12em, border-radius: 999) but the renderers use
   Tailwind classes (tracking-wider, rounded-md). Switched both tests
   to use the data-testid attributes already present on the components
   (declarative-metric, declarative-status-badge).

Verified 6/6 pass on both LGP (3100) and LGT (3101). LGP and LGT
test specs are byte-identical.
2026-05-19 06:01:31 -07:00
Jordan Ritter 379923f984 fix(showcase): un-skip hitl-in-app downgrade + fix beautiful-chat networkidle (#4917)
## Summary
- Un-skip hitl-in-app downgrade test — upstream bug is fixed, test
passes on both LGP and LGT
- Remove `page.waitForLoadState("networkidle")` from beautiful-chat Task
Manager test — persistent SSE connections prevent networkidle from ever
resolving

## Test plan
- [x] 16/16 tests pass on LGP (port 3100) — hitl-in-app + beautiful-chat
specs
- [x] 16/16 tests pass on LGT (port 3101)
- [x] All specs byte-identical between LGP and LGT

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-19 05:47:43 -07:00
Jordan Ritter c804fb7f51 fix(showcase): un-skip hitl-in-app downgrade test + remove networkidle from beautiful-chat 2026-05-19 05:39:50 -07:00
Alem Tuzlak cd6300cd68 fix(showcase): lockfile-pinned npm ci in all integration Dockerfiles + reclaim BuildKit cache on build (#4915)
## Summary

Fixes the disk-bloat root cause that crashed Docker repeatedly during
yesterday's MAF showcase port session — eventually ballooning the WSL2
`docker_data.vhdx` past 300 GB on the Windows host.

**Root cause:** 17 of 18 integration Dockerfiles copy `package.json` but
ignore the existing `package-lock.json`, then run `npm install
--legacy-peer-deps` instead of `npm ci`. Despite a ~700 KB lockfile
sitting in every integration directory, none of them inform the build.

## Effects

1. `npm install` re-resolves package versions from scratch on every
rebuild, downloading ~1.1 GB into the build container's writable layer
plus hundreds of MB of `~/.npm/_cacache` *inside the same layer*
(BuildKit can't dedupe across builds because the layer hash varies with
each non-deterministic resolution).
2. The install layer's BuildKit cache key is just `package.json`'s hash
+ base image — but with `npm install` (not `npm ci`) the install itself
is non-deterministic, so a cached layer that resolved successfully can
produce a different node_modules tree than a fresh resolution. Even when
the layer is reused, interrupted rebuilds (host OOM during install)
leave dangling cache that's only reclaimed after 24 h.
3. WSL2's `docker_data.vhdx` grows monotonically — it never shrinks
until `wsl --shutdown` + `Optimize-VHD`. Repeated rebuilds compound into
a VHDX file that can reach hundreds of GB on the Windows host before any
reclaim happens.

Only `built-in-agent` had the correct pattern; the other 17 were
copy-pasted from each other.

## Changes

1. **Lockfile-pinned, deterministic install** in all 18 Dockerfiles:
   ```dockerfile
   COPY package.json package-lock.json ./
   RUN npm ci --legacy-peer-deps
   ```
- `npm ci` is faster, deterministic, and writes ~half the temporary
state of `npm install`.
- With the lockfile in the COPY, BuildKit's layer cache key is stable
across rebuilds — once warm, it stays warm.
   - Matches the pattern `built-in-agent` already uses.

2. **Reclaim dangling BuildKit cache in `bin/showcase build`** with
`docker builder prune --filter "until=24h"`. Keeps the warm cache for
day-of work, reaps orphans from interrupted builds.

## Verification

After the patch every integration shows the same install header:

```bash
for d in showcase/integrations/*/; do
  grep -E "^(COPY package|RUN npm)" "$d/Dockerfile" | head -2
done
```

returns identical:
```
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
```

for all 18.

## Out of band (already done locally, not in this diff)

- `docker volume prune -af` — reclaimed **16.11 GB** from 236 orphaned
anonymous Postgres volumes from 2023.
- `Optimize-VHD F:\Docker\wsl\disk\docker_data.vhdx -Mode Full`
(elevated PowerShell, after `wsl --shutdown`) — each developer runs this
on their own host when disk gets tight; not something CI or this script
can do.

## Test plan

- [ ] CI green
- [ ] `bin/showcase build ms-agent-python` from clean cache succeeds +
cold-build time roughly matches pre-PR baseline
- [ ] Second `bin/showcase build ms-agent-python` (warm cache) is faster
than first (because lockfile-pinned layer now actually hits cache)
- [ ] `docker images | grep showcase-` produces same image sizes as
before (~2.3-3 GB per integration)
2026-05-19 13:00:30 +02:00
Alem Tuzlak a98c591044 chore(showcase): ratchet validate-pins baseline 95 -> 105
Main has been red on Validate Showcase since #4912 landed
("bump deps to v1.57.2") -- that PR bumped Dojo's @copilotkit/*
pins to 1.55.2 which exposed 10 new showcase=next vs Dojo=1.55.2
mismatches across ms-agent-python, pydantic-ai, and strands.

The count on origin/main is also 105 (verified against run
26082332924's logs); my branch produces an identical 105 FAIL set
with matching hash. So this ratchet absorbs unrelated drift from
#4912 -- needed to unblock CI for this PR (and every other PR
that touches showcase/).

Sign-off: this is a documented baseline ratchet per the fail
threshold instructions in fail-baseline.json's _comment field.
2026-05-19 12:50:28 +02:00
Alem Tuzlak 03bed3b76b fix(showcase): regenerate 18 lockfiles in isolation; switch to npm ci
Lockfiles committed in 8ba692c42 were generated inside the monorepo
while pnpm's hoisted node_modules tree was present. npm-arborist
resolved transitive deps against pnpm's symlinks and wrote ~40
`../../../node_modules/.pnpm/...` paths into each lockfile's
`packages` map.

npm 10 can parse the JSON, but its arborist bombs out walking the
tree at those pnpm-relative entries with the misleading error:

    npm error code EUSAGE
    npm error The `npm ci` command can only install with an
    npm error existing package-lock.json or npm-shrinkwrap.json
    npm error with lockfileVersion >= 1.

`npm install --dry-run` surfaces the real cause:

    Cannot read properties of undefined (reading 'extraneous')

A fresh lockfile generated in an isolated container works.
- broken: 1259 packages, 43 with `../../../node_modules/.pnpm/...`
- fresh:  1321 packages, all `node_modules/...` paths

This commit regenerates every integration's lockfile inside an
isolated `node:22-slim` container via `npm install
--package-lock-only --legacy-peer-deps` and verifies with `npm ci`.
2026-05-19 12:12:57 +02:00
Alem Tuzlak 4b5f976016 fix(showcase): split COPY into two explicit lines + probe to diagnose CI failure
Glob form 'COPY package*.json ./' didn't fix CI -- only package.json
ended up in /app, despite the build context transferring 1.38 MB
(lockfile is 705 KB so it's clearly in the source).

This commit:
1. Splits the COPY into two unambiguous lines.
2. Adds a 'RUN ls -la /app/' probe before npm ci.

If the probe shows package-lock.json present in /app, the issue is in
npm ci discovery. If absent, the issue is in build context upload.
Probe to be reverted once root cause is known.
2026-05-19 11:38:08 +02:00
Alem Tuzlak 8ebd7dfe36 fix(showcase): use glob COPY package*.json ./ to bust poisoned Depot cache
CI failed on the 16 integrations whose explicit two-file COPY
`COPY package.json package-lock.json ./` hit a poisoned Depot remote
BuildKit cache entry: the cached layer reported CACHED but only
contained `package.json`, so the subsequent `npm ci` failed with
"command can only install with an existing package-lock.json".

Depot's cache had a layer indexed against the prior `COPY package.json
./` instruction; the new two-file instruction was matching it by some
internal cache-key collision. Two of 18 integrations (langgraph-python,
langgraph-typescript) passed only because they had a fully-cached
`RUN npm ci` layer from a sibling build that short-circuited the
broken COPY.

The glob form `COPY package*.json ./` produces an instruction string
that has never appeared in Depot's cache, so the layer is computed
fresh against the actual build context and includes both files. It
also reads cleaner than the explicit two-file enumeration.

No-Op when no cache poisoning is present -- the glob expands to exactly
package.json and package-lock.json on every integration (verified
locally; only those two files match per directory).
2026-05-19 11:19:24 +02:00
Alem Tuzlak 604ea658ec fix(showcase): drop bin/showcase build cache prune (out of scope for shared daemon)
`docker builder prune` operates on the entire Docker daemon, not on a
specific project's images. Reaping cache that's older than 24h would
also reap unrelated projects' cache that a teammate happens to share
the daemon with -- a colleague rebuilding a sibling Node project the
next day would face an unnecessary cold-cache build.

BuildKit doesn't expose a filter that's scoped to a project's cache
entries (only `until=<time>`, `type=<cachetype>`, `label=<k>=<v>` --
and labels can't be applied to cache entries from inside a Dockerfile).

Drop the prune. The lockfile-pinned `npm ci` change in the prior commit
is the actual root-cause fix and is enough on its own -- every rebuild
now hits a stable cache layer instead of redoing a 1.1 GB `npm install`
from scratch. Per-developer manual housekeeping (`docker builder prune
--filter "until=168h"`) remains the right escape hatch for accumulated
orphans.
2026-05-19 11:05:15 +02:00
Alem Tuzlak 998be411bd fix(showcase): use lockfile-pinned npm ci in all integration Dockerfiles + reclaim BuildKit cache on build
## Root cause

17 of 18 integration Dockerfiles copy `package.json` but NOT
`package-lock.json`, then run `npm install --legacy-peer-deps`. Despite a
~700KB lockfile sitting in every directory, none of them are consulted at
build time. Only `built-in-agent` was already doing it right.

Effect on Windows / WSL2:

1. `npm install` re-resolves package versions from scratch on every
   rebuild, downloading ~1.1 GB into the build container's writable layer
   plus ~hundreds of MB of `~/.npm/_cacache` that lives in the same
   layer (BuildKit can't dedupe across builds because the layer hash
   varies with each non-deterministic resolution).
2. The npm install layer's BuildKit cache key is just `package.json`'s
   hash + base image — but with `npm install` (not `npm ci`) the install
   itself is non-deterministic, so a cached layer that resolved
   successfully can produce different node_modules trees than a fresh
   resolution. Worse, intermediate state from interrupted rebuilds
   (e.g. host OOM during `npm install`) is not reclaimed by `docker
   builder prune` until 24h later.
3. WSL2's `docker_data.vhdx` grows monotonically — it never shrinks
   until `wsl --shutdown` + `Optimize-VHD`. Repeated rebuilds compound
   into a VHDX that can reach hundreds of GB on the Windows host
   filesystem before any reclaim happens.

## Fix

Two-part:

1. **Lockfile-pinned, deterministic install** in all 18 Dockerfiles:
   ```
   COPY package.json package-lock.json ./
   RUN npm ci --legacy-peer-deps
   ```
   - `npm ci` is faster, deterministic, and writes ~half the temporary
     state of `npm install`.
   - The lockfile in COPY makes the install layer's BuildKit cache key
     stable across rebuilds, so once the layer is warm it actually stays
     warm.
   - Matches the pattern `built-in-agent` already uses.

2. **Reclaim dangling BuildKit cache in `bin/showcase build`** with a
   24h-window `docker builder prune --filter "until=24h"`. Keeps the
   warm cache for day-of work, reaps orphans from interrupted builds.

## Verification

```
for d in showcase/integrations/*/; do
  grep -E "^(COPY package|RUN npm)" "$d/Dockerfile" | head -2
done
```

now prints identical:
```
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
```

for every integration.

## Out of band (cannot land in this PR)

- `docker volume prune -af` -- one-time recovery, ran locally, reclaimed
  16.11 GB from 236 anonymous Postgres volumes dating back to 2023.
- `Optimize-VHD` to compact the WSL2 docker_data.vhdx -- requires elevated
  PowerShell after `wsl --shutdown`. Each developer runs this themselves
  when their host drive gets tight; not something CI or this script can
  do.
2026-05-19 10:47:18 +02:00
Jordan Ritter 4749ac138c fix(showcase): replace networkidle with timed wait for LangGraph state persistence (#4913)
## Summary
- Replace `page.waitForLoadState("networkidle")` with
`page.waitForTimeout(1000)` in hitl-in-chat back-to-back test
- `networkidle` never resolves because the SPA maintains persistent
connections (CDN polling, telemetry)

## Root cause
After HITL resolution, CopilotKit AG-UI emits `RUN_FINISHED` before the
LangGraph server finishes persisting thread state. Starting Flow 2
immediately hits an active interrupt state → `UserInterrupt` /
`RUN_ERROR`. The 1-second delay gives the server time to complete async
state persistence.

## Test plan
- [x] 5/5 hitl-in-chat tests pass on LGP (port 3100)
- [x] 5/5 hitl-in-chat tests pass on LGT (port 3101)
- [x] Test specs byte-identical between LGP and LGT

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-19 00:16:33 -07:00
Jordan Ritter 2b5e4a6620 fix(showcase): replace networkidle with timed wait for LangGraph state persistence 2026-05-18 23:53:38 -07:00
Jordan Ritter a83d8d288f fix(showcase): resolve remaining test failures + bump deps to v1.57.2 (#4912)
## Summary
- Fix 4 non-release-blocker test failures (declarative-gen-ui,
open-gen-ui-advanced, reasoning-default, hitl-in-chat back-to-back)
- Bump all @copilotkit deps to v1.57.2 (unblocks 6
tool-rendering-default-catchall tests via
data-testid="copilot-tool-render")
- Work around web-inspector workspace:* leak with npm/pnpm overrides

## Changes
- **declarative-gen-ui**: Split content+toolCalls fixtures to prevent
frontend turn-closure race
- **open-gen-ui-advanced**: Replace `fill()` with `pressSequentially()`
for sandboxed iframe input
- **reasoning-default (LGT)**: Add missing route registration for
reasoning-default agent
- **hitl-in-chat back-to-back (LGT)**: Add networkidle wait between
sequential HITL flows
- **deps**: All @copilotkit/* packages 1.56.5 → 1.57.2 in both LGP and
LGT

## Test plan
- [x] 12/12 tool-rendering-default-catchall + reasoning-chain pass on
LGP (port 3100)
- [x] 12/12 same specs pass on LGT (port 3101)
- [x] All 4 targeted failures verified green on both ports

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-18 23:20:42 -07:00
Jordan Ritter 13df3107a2 fix(showcase): update @copilotkit deps to v1.57.2 for tool-render testid
Bumps all @copilotkit packages from 1.56.5 to 1.57.2 in both
langgraph-python and langgraph-typescript showcase integrations.
v1.57.2 adds data-testid="copilot-tool-render" needed by the
tool-rendering-default-catchall e2e tests.

Adds npm/pnpm overrides to work around a publish bug in
@copilotkit/web-inspector@1.57.2 where workspace:* leaked
into the published package.json for its @copilotkit/core dep.
2026-05-18 23:04:24 -07:00
Jordan Ritter 2436adba61 Fix intermittent declarative-gen-ui test failures (PieChart + BarChart)
The generate_a2ui aimock fixtures were returning content+toolCalls in a
single response. When aimock streams this, content text is emitted first,
then the tool call. The CopilotKit frontend sometimes processes the
content text and closes the assistant turn before the tool call (and its
subsequent A2UI operations) can be processed, causing the chart to never
render.

Split the fixture response: generate_a2ui now returns only toolCalls
(the tool invocation), and the descriptive text content moves to the
toolCallId follow-up fixture (the post-tool-result response). This
ensures the runtime processes the tool call first, executes generate_a2ui,
receives A2UI operations, and only then emits the text response.

Verified 10/10 passes on LGP (3100) and 5/5 on LGT (3101), vs ~40%
failure rate before the fix.
2026-05-18 22:29:41 -07:00
Jordan Ritter f1f18650c4 fix(showcase): fix reasoning-default and hitl back-to-back tests on LGT
Two LGT-only test failures fixed:

1. reasoning-default: The demo page sends agent="reasoning-default" but
the LGT route.ts only registered "reasoning-default-render". Added the
missing "reasoning-default" -> "agentic-chat-reasoning" mapping (same
graph used by reasoning-custom and reasoning-default-render).

2. hitl-in-chat back-to-back: After the first HITL flow completes on
LGT, sending a second message immediately triggers a RUN_ERROR race
condition in the CopilotKit runtime ("Cannot send event type: The run
has already errored"). Root cause is the LangGraph TypeScript server
takes slightly longer to finalize thread state after the interrupt ->
resume -> confirmation cycle. Fix adds page.waitForLoadState
("networkidle") between flows so all in-flight SSE streams are closed
before the next message is sent. Applied to both LGP and LGT test
copies for consistency.
2026-05-18 22:14:37 -07:00
Jordan Ritter 6e6878349a fix(showcase): use pressSequentially instead of fill for sandboxed iframe input
fill() silently no-ops inside sandbox="allow-scripts" iframes on some
Playwright/Chromium combos because the null origin blocks the
set-value protocol message. The input.value stays empty, so the
host-side evaluateExpression handler rejects it with "Unsupported
characters" and the test never sees a console log.

pressSequentially sends individual key events that always reach the
input regardless of sandbox restrictions.
2026-05-18 21:41:37 -07:00
Tyler Slaton 5d14af973c chore(vue): bump package version to match mono-repo (#4910) 2026-05-18 21:31:49 -07:00
Tyler Slaton ca86c3623e chore(vue): bump package version to match mono-repo
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-05-18 21:21:05 -07:00
Jordan Ritter 861e56b90e fix(showcase): LGT remaining delta — 16 test fixes + component extraction + cleanup (#4906)
## Summary
Closes the LGT-vs-LGP delta from PR #4879. Fixes 16 of 17 LGT-only test
failures, extracts inlined components to match LGP's factored pattern,
removes orphan demos, and ports infrastructure.

## Changes

### Test fixes (16 of 17 LGT-only failures)
- **headless-complete**: `normalizeResponse()` for
additional_kwargs.tool_calls + missing `get_revenue_chart` tool
- **readonly-state**: Removed aimock `systemMessage: "Atai"` gate
(gpt-5.4 sends role:developer)
- **reasoning-custom**: Created missing demo page + wired route to
existing reasoning graph
- **reasoning-default**: Renamed from `reasoning-default-render` + added
`suggestions.ts`
- **declarative-gen-ui**: Fixed A2UI tool name (`render_a2ui` →
`_design_a2ui_surface`) + state-aware ToolNode wrapper
- **beautiful-chat**: A2UI v0.9 operation format + ExampleCanvas agentId
+ manage_todos Command + copilotkitEmitState

### Component extraction (inlining → LGP pattern)
- **hitl**: 7 inlined components extracted to separate files
(step-selector, steps-feedback, suggestions, 4 shadcn components)
- **declarative-hashbrown**: All files aligned to LGP
- **declarative-json-render**: All files aligned to LGP
- **shared-state-read**: Extracted recipe-card.tsx + types.ts from
460-line page.tsx
- **reasoning-default**: Extracted suggestions.ts
- **beautiful-chat**: Extracted home-page.tsx

### Cleanup
- Removed `agentic-chat-reasoning` (deprecated, untested, covered by
reasoning-custom)
- Removed `shared-state-write` (unimplemented stub, superseded by
shared-state-read-write)
- Ported `layout.tsx` from LGP (per-demo title metadata)

## Variance after this PR
- Frontend files: 240 identical (96%), 10 justified diffs, 0 functional
gaps
- Tests: 37 identical (100%)
- API routes: 15 identical (100%)

## 1 remaining LGT-only failure
- reasoning-default "Show reasoning pill" — fixture doesn't produce
reasoning tokens for LGT pipeline

## Test plan
- [ ] Full LGP suite on production-parity local cluster
- [ ] Full LGT suite on production-parity local cluster
- [ ] CI checks
v1.57.2
2026-05-18 21:02:44 -07:00
github-actions[bot] c03c65df15 style: auto-fix formatting 2026-05-19 03:56:11 +00:00
Jordan Ritter 3682b24f3b fix(showcase/langgraph-typescript): fix stale manifest entries for renamed/missing demos 2026-05-18 20:54:36 -07:00
Jordan Ritter b475431570 fix(showcase/langgraph-typescript): add missing UI components from LGP 2026-05-18 20:49:52 -07:00
Tyler Slaton da6cfaf0b1 fix(ci): exclude node_modules from release artifact to avoid OOM (#4909)
## Summary

The release/publish workflow's build job uploads the entire workspace as
an artifact for the publish job to download. With `node_modules`
included, this monorepo produces **~6.4M files**, which OOMs
`upload-artifact`'s Node process at its 4 GB heap limit during file
enumeration:

```
With the provided path, there will be 6392019 files uploaded
...
FATAL ERROR: Ineffective mark-compacts near heap limit
Allocation failed - JavaScript heap out of memory
```

This was uncovered when the `workflow_dispatch` escape hatch added in
#4808 was first exercised — the upload step hung for 12+ minutes and
then crashed.

## Fix

1. **`Upload workspace` exclusions** — exclude `**/node_modules/**`,
`**/.next/**`, `**/.turbo/**`, `**/.nx/**`. Drops the file count by
orders of magnitude (almost all of those 6.4M files are pnpm's hoisted +
nested `node_modules`).
2. **`Install Dependencies` in the publish job** — runs `pnpm install
--frozen-lockfile` after `Download workspace`, so the publish step
operates against exactly the same resolved tree the build job used
(`pnpm-lock.yaml` is carried in the artifact).

The published `packages/*/dist/` outputs from the build job are
unaffected by the exclusions, so npm publish still has everything it
needs.

## Test plan

- [ ] Merge to main
- [ ] Dispatch `release / publish` against `monorepo` (or wait for the
next merged release PR)
- [ ] Confirm `Upload workspace` and `Download workspace` both finish in
seconds (not minutes), and `Install Dependencies` runs in the publish
job before `Publish to npm`
- [ ] Confirm the published tarballs on npm are byte-identical to what
the previous flow would have produced (same lockfile → same install →
same build outputs already in the artifact)


---
_Generated by [Claude
Code](https://claude.ai/code/session_01VnqgZdq8QaS15yknCKKcff)_
2026-05-18 20:49:40 -07:00
Jordan Ritter 74691ff119 fix(showcase/langgraph-typescript): add missing yaml dependency 2026-05-18 20:45:25 -07:00
Claude bbff324aaf fix(ci): exclude node_modules from release artifact to avoid OOM
The release/publish workflow's build job uploads the entire workspace
as an artifact for the publish job to download. With node_modules and
build caches included, this monorepo produces ~6.4M files, which OOMs
upload-artifact's Node process at its 4GB heap limit during
enumeration:

  FATAL ERROR: Ineffective mark-compacts near heap limit
  Allocation failed - JavaScript heap out of memory

Excluding node_modules, .next, .turbo, and .nx cuts the file count by
orders of magnitude. The publish job runs `pnpm install --frozen-lockfile`
after download to restore node_modules deterministically from
pnpm-lock.yaml (carried in the artifact), so the publish step still
runs against exactly the resolved dependency tree the build job used.

Fixes the upload step that hung for 12+ minutes and then OOM'd when
the workflow_dispatch trigger added in #4808 was first exercised.
2026-05-19 03:44:30 +00:00
Jordan Ritter 68482898a9 fix(showcase): sync agentic-chat spec — add race guard to LGT
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-18 20:39:53 -07:00
Jordan Ritter 872760e205 fix(showcase/aimock): remove stale recorded hitl fixtures that shadow feature-parity
Two recorded fixtures from a d5 run (2026-05-15) had wrong data
(attendee: "User" instead of "Sales team") and random toolCallIds
with no matching confirmation fixtures. They intercepted hitl-in-chat
requests before the correct feature-parity.json fixtures could match.
2026-05-18 20:39:52 -07:00
Jordan Ritter e69e67ea12 Fix 5 shared test failures in auth, chat-customization-css, and chat-slots
Two root causes:

1. Tests used messages ("Hello", "Hi", "hello", "Say something short")
   that don't match any aimock fixture. With --proxy-only mode, unmatched
   requests fall through to real OpenAI which rejects the mock API key
   (sk-mock-local-dev) with 502/401. Replaced all test messages with
   exact d5-all.json fixture entries: "Say hello in one short sentence",
   "Tell me a one-line joke", "Give me a fun fact".

2. The "second assistant turn" test in chat-slots sent its second message
   immediately after the first assistant bubble appeared. The assistant
   message becomes visible on the first streaming chunk, but the chat
   input stays disabled until the full stream ends (aimock streams at
   60ms/8-char-chunk). Added a text-stabilization poll between turns to
   wait for streaming to finish before sending the next message.

All tests copied identically to both LGP and LGT. Verified 16/16 pass
on both ports (3100 and 3101) across multiple runs.
2026-05-18 20:39:11 -07:00
Jordan Ritter 54717e61bf fix(showcase/aimock): fix shared-state-read + hitl multi-pill fixture gaps
Two aimock fixture issues caused e2e test failures on both LGP and LGT:

1. shared-state-read: no fixture matched "What recipe am I making?" —
   added a new fixture in feature-parity.json keyed on that substring.

2. hitl-in-app multi-pill test: the second pill's first-turn request
   failed because hasToolResult: false on the 1st-turn fixtures rejected
   conversations that already contained tool results from earlier pills.
   Removed hasToolResult: false from refund/downgrade/escalate 1st-turn
   fixtures — the more-specific post-tool-result fixtures (with
   toolCallId + hasToolResult: true) still win on the 2nd turn.
2026-05-18 20:39:11 -07:00
Jordan Ritter e7ebc786c3 fix(showcase): simplify agent-config route + fix race condition in test
Remove custom AgentConfigLangGraphAgent wrapper that broke SSE stream
lifecycle (data-copilot-running stuck at true). Use plain LangGraphAgent
matching LGP pattern — useAgentContext via ConfigContextRelay handles
config forwarding without the wrapper.

Test fix: filter out agent/stop POST bodies from captured requests and
wait for data-copilot-running=false between sends to prevent race.
2026-05-18 20:39:10 -07:00
Jordan Ritter c8187e3788 fix(showcase): gen-ui-agent 'message list container' test needs a message first
CopilotChat v2 renders a welcome screen when messages are empty,
which means the messageView.children callback (where the
copilot-message-list testid lives) is not invoked until the first
message is sent. Send "Hello" before asserting the container exists.

Fixes the test on both LGP (port 3100) and LGT (port 3101).
2026-05-18 20:39:10 -07:00
Jordan Ritter 31c536020f fix(showcase): add aimock fixtures for agentic-chat e2e + fix
multi-turn race on LGT

Two shared agentic-chat tests failed on both LGP and LGT because
the test messages had no matching aimock fixtures, and the
multi-turn test had a race condition on LGT where the second
Enter keypress was swallowed during a component re-render.

- Add 3 fixtures to feature-parity.json for the agentic-chat e2e
  test messages (hello, Alice turn 1, Alice turn 2)
- Wait for suggestion pills to reappear before sending the
  follow-up message in the multi-turn test
2026-05-18 20:39:10 -07:00
Jordan Ritter b90dc89833 fix(showcase/langgraph-typescript): extract components matching LGP for reasoning-default + shared-state-read + beautiful-chat
reasoning-default: add suggestions.ts, use extracted hook in page.tsx
shared-state-read: extract types.ts, recipe-card.tsx from 460-line
  inlined page.tsx; add README.md
beautiful-chat: extract HomePage to home-page.tsx matching LGP pattern
2026-05-18 20:39:10 -07:00