Skip to content

Commit 7602085

Browse files
authored
feat(showcase): per-framework D4/D6 aimock fixtures + D6 probe driver + harness scoping (CopilotKit#5022)
## Summary Lands the per-framework fixture reorg + D6 probe driver + harness scoping work that was parked behind the ag-ui header-forwarding chain (now shipped via CopilotKit#4984, CopilotKit#4951, CopilotKit#5015, CopilotKit#5016). This is the foundational data layer the D6 dashboard needs to populate. Slice 1 (CopilotKit#5018) shipped the rendering plumbing earlier today; this PR makes d6:<slug>/<featureId> PB rows start flowing. ## What ships - 477 per-integration aimock fixtures organized under `d4/`, `d6/`, `shared/` directories (flat `d5-all.json` / `feature-parity.json` deprecated) - Every fixture keyed by `match.context` to enforce per-integration isolation (server-side routing already merged in aimock CopilotKit#226) - D6 all-pills probe driver + per-integration scoping in showcase-harness - X-AIMock-Context header propagation in 18 integration Playwright configs - D6-ceiling chip color algorithm (D6 is integration-scoped aggregate, maxPossible raised from 5 to 6) - Docker-compose updates for the new fixture dir layout - 12 HITL fixtures migrated from main's d5-all.json additions into shared/_migrated-from-d5-all-hitl.json ## Why this is safe to ship now - ag-ui/LangGraph configurable+context HTTP 400 blocker is fixed (CopilotKit#5015 + CopilotKit#5016) - sdk-python 0.1.91 with `_extract_forwarded_headers_from_config` is on PyPI and pinned across showcase - aimock server-side context routing is already live (aimock CopilotKit#226) - The SDK overlay hacks the branch carried locally are now redundant — discarded before rebase ## Pre-existing CI note `@copilotkit/web-inspector:test` has a pre-existing failure (`window.localStorage.clear is not a function` in telemetry tests) — verified on clean main checkout. Not introduced by this PR. ## Follow-ups - Distribute migrated HITL fixtures from shared/_migrated-from-*.json into per-integration d6/<slug>/ files - Slice 2: D6 drilldown DIMENSIONS + AdaptiveStatsBar rollup section - LGP gen-ui-interrupt second-pill framework bug (Hypothesis B in useInterrupt hook)
2 parents 072de65 + ef3e596 commit 7602085

545 files changed

Lines changed: 88891 additions & 4177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "copilotkit",
1414
"source": "./",
1515
"description": "AI agent skills for CopilotKit — setup, develop, integrate, debug, upgrade, and contribute to CopilotKit projects",
16-
"version": "1.57.4",
16+
"version": "1.58.0",
1717
"author": {
1818
"name": "CopilotKit",
1919
"url": "https://copilotkit.ai"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "copilotkit",
33
"description": "AI agent skills for CopilotKit — setup, develop, integrate, debug, upgrade, and contribute to CopilotKit projects",
4-
"version": "1.57.4",
4+
"version": "1.58.0",
55
"author": {
66
"name": "CopilotKit",
77
"url": "https://copilotkit.ai"

.github/workflows/plugin-skills-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ concurrency:
3333
jobs:
3434
check:
3535
runs-on: ubuntu-latest
36+
timeout-minutes: 10
3637
steps:
3738
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3839
with:

.oxfmtrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
".github/actions/changesets-action/src/run.ts",
1010
"examples/v1/_legacy/copilot-anthropic-pinecone/src/app/api/copilotkit/route.ts",
1111
"examples/v1/_legacy/copilot-openai-mongodb-atlas-vector-search/src/app/api/copilotkit/route.ts",
12-
"packages/web-inspector/src/styles/generated.css"
12+
"packages/web-inspector/src/styles/generated.css",
13+
"showcase/aimock/shared/**",
14+
"showcase/aimock/d4/**",
15+
"showcase/aimock/d6/**"
1316
]
1417
}

lefthook.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ pre-commit:
3737
# the commit.
3838
exclude:
3939
- "docs/**"
40+
- "showcase/aimock/shared/**"
41+
- "showcase/aimock/d4/**"
42+
- "showcase/aimock/d6/**"
4043
# Use `set --` so the staged files become positional args; this is the
4144
# only shell-portable way to test "are there any" without breaking on
4245
# multi-file expansion. The old `[ -n "{staged_files}" ]` form failed

showcase/GOTCHAS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ What we learned from getting all 18 integrations to D5 green. Many of these are
120120

121121
---
122122

123+
## Fixture Authoring Gotchas
124+
125+
**`context` field is required for D4/D6 fixtures.** Context routing (aimock `--context-field`) uses `match.context` to isolate fixtures per integration. Omitting `context` means the fixture matches globally -- every integration hits it, and the first match wins regardless of which integration made the request. Always set `match.context` for any fixture loaded through per-integration routing.
126+
127+
**`match.context` must equal the integration slug.** The slug is the directory name under `showcase/integrations/` (e.g., `langgraph-python`, `mastra`, `spring-ai`). A mismatch between the context value and the slug silently drops the fixture from that integration's match pool -- aimock falls through to the next fixture or returns an unmatched response.
128+
129+
**Never combine `content` and `toolCalls` in a single fixture.** A fixture must return either text (`content`) or tool calls (`toolCalls`), not both. Combining them produces undefined behavior: some providers stream the text, others stream the tool call, and the order is non-deterministic. Split into two fixtures with `sequenceIndex` if you need text followed by a tool call (or vice versa).
130+
131+
**`hasToolResult: false` breaks multi-pill flows.** When a fixture returns `toolCalls` with `hasToolResult: false`, aimock treats the conversation as complete after the tool call -- it will not match a follow-up turn where the client sends back the tool result. In multi-pill flows (D6), the agent cycles through multiple tool calls and text responses. Use `hasToolResult: true` (or omit it, since `true` is the default) so aimock expects the client to send tool results and continues matching subsequent turns.
132+
133+
---
134+
123135
## What Was "Green" But Still Wrong
124136

125137
1. **18 copies of identical frontend code** — every fix was a blitz. One missed integration = one regression.

showcase/QA-COVERAGE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ This matrix tracks what testing exists for each demo and the Sales Dashboard sta
7979
- `showcase_deploy.yml` -- deployment pipeline
8080
- **Gap:** No automatic Playwright E2E in CI on every PR; aimock E2E requires manual trigger
8181

82+
## Probe Depth Coverage
83+
84+
| Depth | Probe Name | Cadence | What "Green" Means |
85+
| ----- | ---------------- | ---------- | ------------------------------------------------- |
86+
| D5 | e2e-demos | hourly :10 | All per-integration smoke probes pass |
87+
| D6 | d6-all-pills-e2e | hourly :40 | All demo cells pass across every integration pill |
88+
8289
## Recommended Next Steps
8390

8491
1. **Add aimock fixtures** for gen-ui-tool-based (haiku), gen-ui-agent (task steps), shared-state (recipe/deals/document), subagents (travel), and HITL (interrupt with steps)

showcase/aimock/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM ghcr.io/copilotkit/aimock:latest
2-
COPY d5-all.json /fixtures/d5-all.json
3-
COPY smoke.json /fixtures/smoke.json
4-
COPY feature-parity.json /fixtures/feature-parity.json
2+
3+
# Depth-organized fixture directories
4+
COPY shared/ /fixtures/shared/
5+
COPY d4/ /fixtures/d4/
6+
COPY d6/ /fixtures/d6/

showcase/aimock/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ aimock ([`@copilotkit/aimock`](https://www.npmjs.com/package/@copilotkit/aimock)
1010

1111
The showcase deployment runs aimock in proxy mode — `--proxy-only` with real upstream URLs configured for each provider. Unmatched requests are forwarded to the real API; matched requests short-circuit with the fixture response. This makes the sidecar safe to deploy as a general-purpose smoke-test aid: tests that hit fixture-matched prompts get deterministic responses, and anything else just falls through.
1212

13+
## Directory Structure
14+
15+
```
16+
showcase/aimock/
17+
shared/ Fixtures loaded by ALL integrations (smoke, universal prompts)
18+
d4/ D4-depth fixtures — per-integration, single-demo coverage
19+
<slug>/ One directory per integration slug (e.g. langgraph-python/)
20+
d6/ D6-depth fixtures — per-integration, all-pills coverage
21+
<slug>/ One directory per integration slug
22+
feature-parity.json Legacy flat fixture file (pre-context-routing)
23+
smoke.json Minimal smoke fixture
24+
README.md This file
25+
```
26+
27+
**Context routing.** D4 and D6 fixtures use aimock's `--context-field` flag to scope fixture matching by integration. Each integration's dev server passes its slug as the `context` value in LLM requests (via `X-AIMock-Context` header or request body field). Aimock only considers fixtures whose `match.context` equals the incoming context value, so `d4/langgraph-python/` fixtures never interfere with `d4/mastra/` fixtures even if they share the same `userMessage` pattern.
28+
29+
**Per-integration isolation.** Every `<slug>/` directory contains fixtures specific to that integration. This prevents cross-contamination: if `mastra` needs a different tool name than `langgraph-python` for the same demo, each has its own fixture file. The `shared/` directory holds fixtures that apply regardless of context (e.g., smoke checks, universal greeting prompts).
30+
1331
## Fixtures in this directory
1432

1533
- **`feature-parity.json`** — 35+ fixtures covering the nine showcase demos across 17 packages: agentic chat (weather, backgrounds, themes), tool rendering (pie/bar charts, weather cards), HITL (plans, steps, approvals), Sales Dashboard (deals, pipelines, todos), and assorted meeting/flight/greeting prompts. Consumed by the per-package `test_e2e-showcase-on-demand` Playwright suites and loaded at Railway boot via GitHub raw URL.

0 commit comments

Comments
 (0)