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.
## 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.
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.
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)
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
- 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)
## 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
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.
## 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)
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.
## 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)
## 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)
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.
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`.
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.
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).
`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.
## 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.
## 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)
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.
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.
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.
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.
## 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)_
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.
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.
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.
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.
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.
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).
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