Commit Graph

964 Commits

Author SHA1 Message Date
github-actions[bot] 83404f8ca5 style: auto-fix formatting 2026-06-05 15:54:58 +00:00
Ran Shem Tov efd35f0f8d chore: align all a2ui instances with the latest implementations 2026-06-05 17:54:16 +02:00
Ran Shem Tov 20aa327a8c fix(showcase): enable injectA2UITool for langgraph-python declarative-gen-ui
It was left at false while fastapi/typescript are true. Under the opt-in
A2UI model false means no tool is injected, so the python demo rendered
no surfaces (and the docs code-tab showed no injectA2UITool). Set true to
match the other langgraph integrations.
2026-06-05 11:25:23 +02:00
Ran Shem Tov f64bba25e4 chore(showcase): move canonical @copilotkit version to 1.59.4
Bump canonicalCopilotKitVersion 1.59.2 -> 1.59.4 and pin every
integration's @copilotkit/* to 1.59.4 (locks regenerated). Keeps the
whole showcase on one version instead of letting the langgraph A2UI
demos deviate. Existing per-slug overrides (built-in-agent pkg.pr.new,
ms-agent-harness-dotnet 1.57.2) unchanged.
2026-06-04 20:50:18 +02:00
Ran Shem Tov 57f1f99faa chore(showcase): pin langgraph integrations to stable releases
copilotkit 0.1.94a3->0.1.94 (py), @copilotkit/* 1.59.2->1.59.4 +
sdk-js alpha.3->1.59.4 (ts). Drop the @ag-ui/langgraph override —
runtime 1.59.4 now carries @ag-ui/a2ui-middleware 0.0.6 (the
injectA2UITool forward) + @ag-ui/langgraph 0.0.37. Locks regenerated.
2026-06-04 20:25:25 +02:00
Ran Shemtov 37577a20c1 Merge branch 'main' into feat/copilotkit-middleware-auto-a2ui 2026-06-04 19:16:50 +02:00
Ran Shem Tov 59cbce0301 fix(showcase): sync langgraph locks to @ag-ui/langgraph 0.0.37 + rebaseline pins
- Regenerate fastapi/typescript/ts-agent package-lock.json so npm ci
  matches package.json (@ag-ui/langgraph 0.0.37); fixes build-check.
- Bump validate-pins fail-baseline hash for the langgraph-fastapi
  ag-ui-langgraph >=0.0.38 floor (count unchanged at 63).
2026-06-04 18:53:48 +02:00
Mark 84cdb702d2 Merge branch 'main' into tyler/confident-meitner-019a9f 2026-06-04 09:50:18 -07:00
Ran Shem Tov 3ca0f194b8 feat(sdk): gate auto-A2UI injection on injectA2UITool (opt-in)
The A2UI middleware (@ag-ui/a2ui-middleware) forwards injectA2UITool on
forwardedProps; ag-ui-langgraph surfaces it into agent state at
state["ag-ui"]["inject_a2ui_tool"]. The CopilotKit LangGraph middleware
(py + js) now reads that flag and only injects generate_a2ui when it is
truthy (opt-in), drops the runtime's render_a2ui so the model sees one
A2UI tool, and skips if the agent already defines generate_a2ui. The
catalog only binds surfaces; it is no longer the gate.

Reverts the earlier runtime-forward + context-channel approach.

Deps: ag-ui-langgraph>=0.0.38 (py), @ag-ui/langgraph 0.0.37 (sdk-js),
@ag-ui/a2ui-middleware 0.0.6 + @ag-ui/langgraph 0.0.37 (runtime);
.npmrc min-release-age exclude for @ag-ui/a2ui-middleware. Showcase
langgraph pins bumped to copilotkit==0.1.94a3 / sdk-js 1.59.3-alpha.3 /
@ag-ui/langgraph 0.0.37.
2026-06-04 18:37:03 +02:00
Ran Shem Tov 02b11c985d feat(showcase): drive dynamic A2UI via CopilotKitMiddleware (langgraph)
The declarative-gen-ui demo across the three langgraph integrations now
relies on the middleware to inject and execute generate_a2ui — the agents
collapse to create_agent + CopilotKitMiddleware with no hand-rolled tool.
Adds render_a2ui fixtures for the new tool path and pins the integrations
to the A2UI alpha SDKs (copilotkit 0.1.94a1, @copilotkit/sdk-js 1.59.3-alpha.1).
2026-06-04 18:36:12 +02:00
Jordan Ritter 92726458a2 fix(showcase): make Railway promote flow fault-tolerant (#5200)
## Summary

The showcase Railway promote CI flow could not promote the fleet: an
`all` promote was blocked end-to-end whenever a single service was red,
and the reported failure traced to `showcase-ag2` being chronically red
on staging.

Root causes and fixes:

- **ag2 crash-on-import (the red service).** `gen_ui_agent.py` carried
`from __future__ import annotations`, which stringified the `set_steps`
tool's `context_variables: ContextVariables` parameter into an
unresolved `ForwardRef`. AG2's tool-schema generation then raised
`PydanticUserError` at import time, so the process never came up and the
staging healthcheck failed on every deploy since 2026-05-31. Removed the
import (matching the working sibling agents) and added a regression test
that statically asserts the future-import stays absent
(version-independent) plus a live import check.

- **Promote loop was all-or-nothing.** The per-service loop ran under
`set -euo pipefail`, so the first failing service aborted the whole
`all` promote, leaving the rest unpromoted. Extracted the loop into
`showcase/scripts/promote-fleet.sh`, which attempts every service,
accumulates succeeded/failed sets, exits non-zero only after attempting
all, and exports `succeeded_csv`.

- **`verify-prod` defeated the best-effort design.** It was skipped on
any non-zero promote and verified the full requested set. It now runs
`if: !cancelled()` and scopes `--services` to the succeeded set.

- **Staging precondition blocked the fleet.**
`verify-staging-precondition` failed the whole `all` promote when any
one service was staging-red. It is now advisory — `promote` runs
regardless, and `bin/railway`'s per-service P2/P3 staging-green gates
authoritatively refuse red services while green services promote.
`notify` success keys on PROMOTE && PROD.

- **Regression tests now gate in CI.** Added a `shell-script-tests` job
(bats + shellcheck) to `showcase_validate.yml`, plus input-validation
hardening in the script (fail-loud on empty / all-empty CSV,
`RAILWAY_BIN` executability check, whitespace trim).

## Test plan

- [x] ag2 regression test passes in the 3.12 venv (`PYTHONPATH=".:src"
pytest tests/python/`) — 2/2
- [x] `promote-fleet.bats` — 12/12 (best-effort loop, succeeded_csv
export, empty/whitespace/missing-binary guards, digest forwarding)
- [x] `shellcheck promote-fleet.sh` clean; `actionlint` clean on both
workflows
- [ ] CI green on this PR
2026-06-03 22:26:20 -07:00
Jordan Ritter 2cacf48ec0 fix(showcase): migrate dead useInterrupt to useHumanInTheLoop for Strategy-B gen-ui-interrupt demos
The gen-ui-interrupt demo across non-LangGraph integrations used
`useInterrupt`, which only renders in response to an AG-UI `on_interrupt`
event emitted by LangGraph's native `interrupt()` primitive. These
backends never emit that event — they expose `schedule_meeting` as a
frontend/HITL tool over the normal tool-call channel (Strategy B) — so
the picker never mounted.

Migrate the 8 clean Strategy-B integrations (ag2, agno, crewai-crews,
mastra, pydantic-ai, spring-ai, llamaindex, claude-sdk-typescript) to
`useHumanInTheLoop`, mirroring the ms-agent-python / ms-agent-dotnet
reference: same `name: "schedule_meeting"`, same zod `{ topic, attendee }`
parameters, same TimePickerCard render, resolving via `respond(...)`.
The framework-specific comment is generalized for accuracy.

The 3 LangGraph integrations keep `useInterrupt` (native interrupt).
built-in-agent and claude-sdk-python already use the equivalent working
`useFrontendTool` pattern and are left unchanged. strands and langroid
are intentionally NOT migrated — their backends declare a
`schedule_meeting(reason)` tool whose param shape conflicts with the
`topic`/`attendee` reference, which needs separate resolution.
2026-06-03 16:38:57 -07:00
Jordan Ritter 0cf30cc030 fix(showcase): resolve ag2 gen_ui_agent crash-on-import from stringified forward-ref
`from __future__ import annotations` turned the set_steps tool's
`context_variables: ContextVariables` param into an unresolved ForwardRef at
AG2 tool-schema-generation time, raising PydanticUserError on import and failing
the showcase-ag2 staging healthcheck since 2026-05-31. Removing it matches the
working sibling agents. Adds a regression test that statically asserts the
future-import stays absent (version-independent) plus a live import check.
2026-06-03 14:01:09 -07:00
Jordan Ritter 72156dbb83 fix(showcase): bump @ag-ui/langgraph to 0.0.36 in langgraph integrations
Carries ag-ui PR #1784 (skip regeneration check when command.resume is
set) into the three langgraph showcase stacks. ag-ui 0.0.35 incorrectly
ran the regenerate path on a resumed run, breaking the gen-ui-interrupt
D6 cell. 0.0.36 adds the command.resume guard.

Pins @ag-ui/langgraph 0.0.36 via npm overrides (transitive dep of
@copilotkit/runtime) in langgraph-python, langgraph-typescript, and
langgraph-fastapi, and regenerates each per-integration package-lock.json.
2026-06-02 15:17:41 -07:00
Tyler Slaton 3486944356 fix(showcase): controlled gen-UI — reliable 2nd-suggestion render + sidebar tag (OSS-137) (#5029)
## What & why


[OSS-137](https://linear.app/copilotkit/issue/OSS-137/controlled-gen-ui-demo-optimize-2nd-suggestion-prompt-rename-sidebar)
— the **Controlled Generative UI** demo (`gen-ui-tool-based`) had two
issues, scoped here to **LangGraph-Python** and **Google ADK** (per the
ticket; other 16 integrations roll out later).

### 1. 2nd suggestion didn't reliably render UI
The "Traffic pie chart" chip (`"Show me a pie chart of website traffic
by source."`) names a subject but supplies no numbers, so the agent
**asked the user for data** instead of rendering a chart.

**Fix:** a system-prompt directive (both LGP + ADK agents) instructing
the agent to invent plausible illustrative sample values, call
`render_*` immediately, and **never** reply with a clarifying question.
The suggestion copy stays clean — behavior is carried by the system
prompt, not by leaking "(use sample data)" hints into the UI.

### 2. Sidebar tag → product language
Retagged the demo from `generative-ui` → `controlled-generative-ui` (LGP
+ ADK), so the dojo sidebar pill reads **"Controlled Generative UI"** —
the established taxonomy already used in `shared/feature-registry.json`
and the dashboard catalog.

## Tests
Added D5 aimock fixture entries mirroring all three suggestion chips
(bar / traffic-pie / market-share) so the suggestion-click path has
deterministic coverage. The existing `"revenue by category"` probe
message is **preserved**, so the
[dashboard](https://dashboard.showcase.copilotkit.ai/#matrix:links,health)
D5 row for the edited row stays green.

## Acceptance check
- [x] 2nd suggestion renders UI without asking for data (system-prompt
directive; verified locally against the live agent)
- [x] Sidebar entry tagged "Controlled Generative UI"
- [x] Sample/hallucinated data supplied via system prompt
- [x] Scoped to LGP + ADK
- [x] Tests augmented (D5 fixtures for every chip)
- [x] D5 still shown for the edited row (probe message unchanged)

## Out of scope (left out deliberately)
`package-lock.json` churn from a local reinstall (un-pins `latest`) was
**not** committed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-02 11:31:17 -07:00
Jordan Ritter b96660b7ab test(showcase): complete LGP spec parity for 9 baseline integrations (#5141)
## Summary

Adds the 5 missing LGP-canonical e2e specs to each of the 9 baseline
integrations and removes 2 orphan specs that point at zero-file demos.

- Adds 5 canonical e2e specs (`declarative-hashbrown`,
`declarative-json-render`, `reasoning-custom`, `reasoning-default`,
`threadid-frontend-tool-roundtrip`) to each of the 9 baseline
integrations (`ag2`, `agno`, `crewai-crews`, `langgraph-fastapi`,
`langroid`, `llamaindex`, `mastra`, `spring-ai`, `strands`) — 45 specs
total, **byte-identical** to the `langgraph-python` canonical gold
source. The matching demos already existed from #5127's page-mirror, but
the specs themselves were never copied across.
- Deletes 2 orphan specs that reference demos with zero backing files:
`shared-state-write` (×9) and `reasoning-default-render` (×8).
- `validate-parity.ts` reports **19 pass / 0 fail**. The other 15
frameworks were already clean.
- Note: `claude-sdk-python` has the same orphan-spec condition and is
left for a future sweep (out of scope here).

## Test plan

- [x] Parity validator (`validate-parity.ts`) green: 19/0.
- [ ] Real signal: the added cells running green in a clean staging d6
run.
2026-05-31 21:38:29 -07:00
Jordan Ritter 4dc8d465d4 fix(showcase): bake LANGGRAPH_HTTP configurable_headers into langgraph.json
Move the required, uniform D6 header-conveyance config on-disk so it rides
image promotion instead of depending on a per-environment env var. Prod was
missing the LANGGRAPH_HTTP configurable_headers env var, and baking the
`http.configurable_headers.include: ["x-*"]` setting directly into the
langgraph-python and langgraph-fastapi langgraph.json files removes the
promote-time drift gap (the config now travels with the image rather than
being re-supplied at each promotion).

langgraph-typescript needs no change — its header conveyance is pure-code.
2026-05-31 20:33:45 -07:00
Jordan Ritter 5f20887d77 test(showcase): delete orphan e2e specs with no backing demo
reasoning-default-render.spec.ts and shared-state-write.spec.ts navigate to
/demos/reasoning-default-render and /demos/shared-state-write respectively,
but neither demo directory exists in any integration (including the
langgraph-python gold reference) and neither is declared in any manifest.
They are stale, non-canonical leftovers from the #5127 page-mirror.

Removed from all baselines where present: reasoning-default-render from 8
(langgraph-fastapi never had it) and shared-state-write from all 9. The
parity validator stays green (0 fail) and langgraph-fastapi's prior
spec-under-coverage warning clears once its phantom spec is gone and the 5
canonical specs are added.
2026-05-31 20:28:02 -07:00
Jordan Ritter 28fee3dadf test(showcase): add 5 missing canonical e2e specs to baseline integrations
The 9 baseline integrations (ag2, agno, crewai-crews, langgraph-fastapi,
langroid, llamaindex, mastra, spring-ai, strands) were page-mirrored from
langgraph-python but the mirror omitted 5 LGP-canonical Playwright specs
whose demos are present on disk:

  - declarative-hashbrown
  - declarative-json-render
  - reasoning-custom
  - reasoning-default
  - threadid-frontend-tool-roundtrip

Copied each spec verbatim (byte-identical) from langgraph-python, which the
baselines mirror. All 5 backing demo directories exist in every baseline.
The specs are framework-agnostic (navigate by route + testid), so no
per-integration edits are needed. Restores apples-to-apples spec parity.
2026-05-31 20:25:57 -07:00
Jordan Ritter dd0e94b7f3 showcase(integrations): promote PARITY_NOTES incapabilities into manifest not_supported_features
Move framework-incapable features from features[] into not_supported_features[]
so the D6 harness reclassifies them as skipped-incapable instead of red:

- mastra: gen-ui-interrupt, interrupt-headless, agentic-chat-reasoning,
  reasoning-default-render, tool-rendering-reasoning-chain
- langroid: mcp-apps, tool-rendering-reasoning-chain
- ag2: gen-ui-interrupt, interrupt-headless
- crewai-crews: gen-ui-interrupt, interrupt-headless, mcp-apps
- llamaindex: gen-ui-interrupt, interrupt-headless, hitl-in-chat-booking
- spring-ai: byoc-json-render

All entries already documented as incapable in each integration's PARITY_NOTES.md.
Validated via 'npm run validate-manifests' (no features/NSF overlap).
2026-05-31 11:21:58 -07:00
Jordan Ritter b4f1984cf6 fix(showcase): align tool-rendering/frontend-tools testids to gold for claude-sdk-python + built-in-agent 2026-05-31 11:13:13 -07:00
Jordan Ritter 8f8b7857e3 fix(showcase): stub agents.gen_ui_agent in forwarded-props test fixtures 2026-05-31 11:05:52 -07:00
Jordan Ritter e599da1409 fix(showcase): remove stale manifest highlights and orphan demo entries from mirrored baselines 2026-05-31 11:05:48 -07:00
Jordan Ritter 6b9b13d334 fix(showcase): copy src/components + src/lib into frontend Docker stage for mirrored baselines 2026-05-31 11:05:42 -07:00
Jordan Ritter fd0c3ed051 showcase: exact-pin mastra openai to satisfy canonical-pin validator 2026-05-31 10:39:37 -07:00
Jordan Ritter 76874f06dc showcase(D6): add gen-ui-agent set_steps backend to 8 baselines
Wire the set_steps state-card tool into each framework's existing
state-snapshot primitive so the (already-mirrored) gen-ui-agent demo can
drive [data-testid=agent-state-card] + agent-step rows:
- agno: state-aware AGUI route (StateSnapshotEvent)
- ag2: ContextVariables + ReplyResult via AGUIStream (dedicated sub-app)
- llamaindex: get_ag_ui_workflow_router backend_tools + StateSnapshotWorkflowEvent
- strands: ag_ui_strands ToolBehavior(state_from_args)
- crewai-crews: dedicated GenUiAgentFlow + copilotkit_emit_state
- mastra: working-memory STATE_SNAPSHOT (genUiAgent + setStepsTool)
- langroid: raw-OpenAI loop emitting TOOL_CALL_* + STATE_SNAPSHOT
- spring-ai: GenUiAgentController set_steps FunctionToolCallback + route override
Frontend (mirrored) untouched; route.ts slug overridden per integration.
2026-05-31 10:39:34 -07:00
Jordan Ritter b4a2b279d4 fix(showcase): copy manifest.yaml into frontend Docker stage for strands/spring-ai/llamaindex
The mirrored LGP homepage prerenders / and reads manifest.yaml at build
time; these 3 baselines use an explicit COPY of config files that omitted
manifest.yaml, breaking SSG export (same fix as pydantic-ai in #5125). The
other 6 baselines copy the dir wholesale and already include it.
2026-05-31 10:39:25 -07:00
Jordan Ritter 06e795b8e2 showcase(D6): mirror LGP frontend to 9 baseline integrations
Page-mirror the langgraph-python gold reference (demo pages + _shared/ +
src/components/ui shadcn primitives + src/lib/utils.ts + manifest-driven
homepage) into mastra, agno, langroid, strands, spring-ai, ag2,
crewai-crews, llamaindex, langgraph-fastapi. Align deps to LGP and pin
@copilotkit/* to exact 1.59.2. Backend / API-layer (route.ts, agent
servers, Java/Mastra runtimes) preserved untouched.

Known follow-up: agent-slug conveyance gaps (mirrored LGP demos reference
slugs each integration's route.ts registers under different names) — to be
measured + addressed per integration.
2026-05-31 10:39:21 -07:00
Jordan Ritter c4ce9781f6 showcase: regen nested langgraph-typescript agent lockfile for canonical 1.59.2 2026-05-31 10:13:21 -07:00
Jordan Ritter 03c9b91382 showcase: bump @copilotkit/* in integrations to canonical 1.59.2 2026-05-31 10:13:21 -07:00
Jordan Ritter 2b13cbab38 fix(showcase): pin @copilotkit/* to exact 1.59.2 + re-ratchet validate-pins baseline
Previously pydantic-ai and claude-sdk-typescript used 'latest' for all
@copilotkit/* dependencies (and the @copilotkit/web-inspector pnpm
overrides on @copilotkit/core), which the showcase validate-pins ratchet
counts as non-exact pin drift. Intended design is to pin to exact 1.59.2.

Changes:
- integrations/pydantic-ai/package.json: @copilotkit/{a2ui-renderer,react-core,runtime,shared,voice} 'latest' -> '1.59.2'; npm + pnpm overrides on @copilotkit/web-inspector>@copilotkit/core 'latest' -> '1.59.2'
- integrations/claude-sdk-typescript/package.json: same set as above
- Regenerated both package-lock.json files via npm install --legacy-peer-deps --package-lock-only
- scripts/fail-baseline.json: ratcheted DOWN validatePinsFailCount 106 -> 104; updated validatePinsFailHash to dde7950e8d691de5a7b2c0c16ca64b3e550221cb6072d2c29e24dcb497515cf6 (matches local sort-uniq + shasum-256 of the new [FAIL] set)

Verified locally: npx tsx validate-pins.ts reports Summary FAIL=104
(2 fewer than baseline because pydantic-ai's @copilotkit/react-core and
@copilotkit/runtime moved from 'latest' (non-exact) to '1.59.2' (exact);
CST already had unrelated FAILs that remain). Non-@copilotkit deps
(lucide-react, cmdk, openai, @ag-ui/*) intentionally left unchanged.
2026-05-31 03:02:53 -07:00
Jordan Ritter d630bfa2a0 fix(showcase): resolve CST stale highlight paths in manifest
Four stale highlight paths in claude-sdk-typescript/manifest.yaml referenced
files that don't exist in the demo folders, breaking the shell-docs
bundle-demo-content step:

- chat-slots: custom-welcome-screen.tsx -> slot-wrappers.tsx (mirrors LGP layout)
- gen-ui-tool-based: agent.ts -> bar-chart.tsx (mirrors LGP layout)
- gen-ui-interrupt: time-picker-card.tsx -> _components/time-picker-card.tsx
- headless-complete: tool-renderers.tsx + use-rendered-messages.tsx -> chat/chat.tsx + hooks/use-tool-renderers.tsx (mirrors LGP layout)

Verified locally: scripts/bundle-demo-content.ts now bundles all 695 demos
with 0 failures.
2026-05-31 03:02:40 -07:00
Jordan Ritter 1eefbc3d97 fix(showcase): copy manifest.yaml into pydantic-ai frontend Docker stage
The homepage prerenders / at build time and reads manifest.yaml via the
filesystem, but the frontend stage only copied next.config/tsconfig/postcss.
Without the manifest the SSG export of /page failed with ENOENT, breaking the
Docker build. Copy manifest.yaml alongside the other config files.
2026-05-31 02:38:10 -07:00
Jordan Ritter b1da0e836c Merge branch 'blitz/d6-parity/fix-pyd-deps' into blitz/d6-parity/integration 2026-05-30 21:37:13 -07:00
Jordan Ritter f356a56cf7 Merge branch 'blitz/d6-parity/fix-mafpy-mw' into blitz/d6-parity/integration 2026-05-30 21:37:12 -07:00
Jordan Ritter 44b57c5f25 fix(showcase): align pydantic-ai deps to LGP reference (unblock D6 prod build)
Aligns showcase/integrations/pydantic-ai/package.json to the
langgraph-python reference so the mirrored D6 demo pages can resolve
their shared-UI imports during `next build`.

- @copilotkit/*: 1.59.0 (exact-pinned) -> latest (matches LGP/CST)
- Add overrides + pnpm.overrides for @copilotkit/web-inspector>@copilotkit/core
- lucide-react: ^0.469.0 -> ^1.14.0
- openai: ^4.0.0 -> ^5.9.0
- tailwind-merge: ^2.6.0 -> ^3.5.0
- @playwright/test: ^1.50.0 -> ^1.59.1
- Add cmdk ^0.2.1, embla-carousel-react ^8.6.0, react-markdown ^10.1.0, remark-gfm ^4.0.1
- @ag-ui/client + @ag-ui/core remain at ^0.0.52 (satisfies @copilotkit/shared peer)
- Regenerate package-lock.json

Verified locally: npm install --legacy-peer-deps + npm run build ->
Compiled successfully in 6.9s, Generating static pages (56/56).
2026-05-30 21:36:40 -07:00
Jordan Ritter 6e934a79b7 fix(showcase): add CST copilotkit-beautiful-chat route (was 404)
The claude-sdk-typescript beautiful-chat demo page sets
runtimeUrl="/api/copilotkit-beautiful-chat" but no such Next.js route
existed, so the cell 404'd on every request.

Add a dedicated runtime mirroring pydantic-ai's beautiful-chat route:
openGenerativeUI + a2ui (injectA2UITool: false) + mcpApps middleware
configured together (the canonical LGP combined-runtime shape). Wire
the HttpAgent to CST's pass-through / mount since agent_server.ts has
no dedicated beautiful_chat backend graph — CST is frontend +
middleware driven, matching how mcp-apps is wired.

Also defensively register beautiful-chat in the shared /api/copilotkit
agentNames list so probe requests against the default runtime resolve
cleanly, matching the pattern used by the other dedicated-runtime
demos.
2026-05-30 21:35:07 -07:00
Jordan Ritter 2b05f9edc7 fix(showcase): port universal strip middleware + snake_case tool_calls to ms-agent-python route (D6 fixture parity) 2026-05-30 21:35:04 -07:00
Jordan Ritter dd1495257a fix(showcase): add missing shadcn UI primitives for CST D6 page-mirror
The CST D6 page-mirror imported LGP demo pages but not the shared UI primitives they depend on, causing prod build failures (`Module not found: '@/components/ui/button'`, etc.). Copy LGP's `src/components/ui/` (24 primitives) and `src/lib/utils.ts` verbatim into CST so the mirrored pages resolve. Deps were already present in CST's package.json; regen lockfile after npm install.
2026-05-30 20:26:08 -07:00
Jordan Ritter bd4424bdf6 Merge branch 'blitz/d6-parity/maf-dotnet' into blitz/d6-parity/integration 2026-05-30 20:17:57 -07:00
Jordan Ritter c968445f36 Merge branch 'blitz/d6-parity/maf-python' into blitz/d6-parity/integration 2026-05-30 20:17:57 -07:00
Jordan Ritter 7fc395c3e4 Merge branch 'blitz/d6-parity/pyd-pages' into blitz/d6-parity/integration 2026-05-30 20:17:56 -07:00
Jordan Ritter 811afa9025 fix(showcase): ms-agent-dotnet D6 residuals (toolCallId strip, fixtures, hitl pages)
Address the four residual D6 failures on the ms-agent-dotnet integration
(baseline was 177/5).

route.ts toolCallId strip completeness
- Extend stripReplaySafeToolCallIdsFromMessage to also clean the
  snake_case `tool_calls[].id` array and any nested OpenAI-style
  `function.tool_call_id`. AG-UI canonical uses `toolCalls`, but some
  runtime / message-converter paths emit the OpenAI shape and the
  replay-safe `__ck_run_<uuid>` suffix was leaking through to aimock on
  those paths. Apply the same coverage in applyToolResultDecisionSuffix
  so decision-suffix routing (`__approved` / `__rejected` /
  `__cancelled`) lands on every tool-call shape.
- Add a universal strip middleware in createAgent itself so EVERY
  registered agent (not only the replay-safe ones) clears the suffix
  before the request reaches the backend / aimock. Decision suffixing
  remains scoped to createReplaySafeAgent because the suffix is
  non-idempotent and the inner middleware re-runs the same logic.
- Drop the now-redundant strip calls inside createGenUiAgent,
  createReadonlyContextAgent, createSharedStateReadWriteAgent, and
  createReasoningAgent — the outer createAgent middleware already
  canonicalised inbound messages by the time these run.

chat-slots fixture
- Mirror LGP's turnIndex:1 'Give me a fun fact' entry so the
  chat-slots e2e's second-turn assistant slot has a deterministic
  reply (the bare 'Give me a fun fact' fixture in headless-simple.json
  is turnIndex:0-gated and was never matching chat-slots' turn 1).

HITL reject + interrupt-headless cancel branches
- Add a reject-branch fixture in render-a2ui.json keyed on
  toolCallId `call_d5_generate_steps_001__rejected` so the hitl.spec
  reject-flow's 'will not execute the Mars trip plan' assertion lands
  the right narration. Keep the legacy hasToolResult:true fixture as a
  fallback for paths that don't apply a decision suffix. Add an
  `__approved` variant for symmetry.
- Add cancel-branch fixtures in interrupt-headless.json for both the
  sales-intro and 1:1-with-alice pills, keyed on `__cancelled`
  toolCallIds, returning the Denied/not-booked narration the
  interrupt-headless cancel spec expects.

hitl-in-app + hitl-in-chat demo pages already mirror LGP (only an extra
README.md per directory in this integration), so no page changes were
needed.
2026-05-30 20:17:08 -07:00
Jordan Ritter 4edcd2f129 fix(showcase): ms-agent-python D6 residuals (toolCallId strip, fixtures, hitl pages, multimodal)
Port the replay-safe toolCallId stripping middleware from the ms-agent-dotnet
sibling route.ts so HITL/interrupt demos match toolCallId-keyed aimock
fixtures across the 2nd-turn request. The strip walks every inbound message
(role=tool, role=assistant.toolCalls[].id, toolCallId, tool_call_id) before
the AG-UI HttpAgent forwards them onto the FastAPI backend, and the outbound
event stream rewrites toolCallId on TOOL_CALL_* events to embed the
deterministic per-run suffix so the next turn's fixture matcher still
keys on the original (suffix-stripped) id.

Wraps the human_in_the_loop, interrupt-adapted, hitl-in-app, and
hitl-in-chat agents with the new replay-safe middleware. Adds gen-ui-agent
set_steps state-snapshot synthesis, readonly-state-agent-context system
message injection, and shared-state-read-write preference-as-system
injection — all ported verbatim from the dotnet sibling so the per-agent
shaping behavior is identical across the MAF runtimes.

chat-slots.json: add the turnIndex:1 "Give me a fun fact" fixture mirrored
from langgraph-python/chat-slots.json so the chat-slots.spec.ts second-
turn assertion ("second assistant turn is also wrapped in the custom
slot") gets a deterministic reply instead of falling through to headless-
simple's fun-fact fixture or the live proxy.

hitl-in-app and hitl-in-chat demo pages were already mirrored from LGP
(only a minor consumerAgentId addition on the in-app suggestions module).
No frontend page changes needed.

The B2 header-forwarding conveyance in src/agents/_header_forwarding.py
is untouched and verified intact (httpx hook + Starlette HTTP middleware
plus ContextVar bridge).

Multimodal diagnosis: the 5-test multimodal.spec.ts timeout is NOT a
routing/wiring gap. The agent_server.py mounts /multimodal FIRST (before
the catch-all "/"), the dedicated Next.js route /api/copilotkit-multimodal
registers the HttpAgent under "multimodal-demo", and the page wires
runtimeUrl + agent correctly. The multimodal fixture's userMessage
"describe the sample image" is the same stale phrasing LGP uses (which
passes at 185/0/2 — the test asserts a /image/i regex on the assistant
transcript, so fallthrough to the proxy still satisfies it). The
remaining suspects are (a) agent_framework_ag_ui's AG-UI -> AF adapter
mishandling inbound `binary` content parts, (b) the dual chat_client
init pattern (multimodal_chat_client built after the global httpx hook
is installed — the hook is idempotent so this should be safe), or
(c) >30s real-OpenAI vision latency under D6 record-replay. Capture
agent_server stderr during a single multimodal run to confirm.
2026-05-30 20:14:36 -07:00
Jordan Ritter 3c8bf11160 feat(showcase): complete CST D6 page-mirror (LGP demos + manifest homepage)
Mirror LGP's demo pages, components, hooks, lib and the manifest-driven
homepage into the CST integration so canonical D6 specs find the
elements they assert on. Prior partial mirror copied specs+fixtures
but left CST's stub pages intact, producing ~106 fails where elements
never render.

Backend swap is limited to runtimeUrl/agent adaptation for the demos
where CST has dedicated routes that LGP does not:
  - headless-complete: LGP /api/copilotkit-mcp-apps -> CST /api/copilotkit-headless-complete
  - reasoning-default, reasoning-custom, tool-rendering-reasoning-chain:
      LGP /api/copilotkit -> CST /api/copilotkit-reasoning
  - shared-state-read-write: LGP /api/copilotkit -> CST /api/copilotkit-shared-state-read-write
  - subagents: LGP /api/copilotkit -> CST /api/copilotkit-subagents

agent_server.ts and the api/* route files are otherwise untouched.

Aligns @copilotkit/* runtime to 1.59.2 (LGP parity) and adds the LGP
companion deps the mirrored pages import (@radix-ui/*, cmdk,
embla-carousel-react, lucide-react, react-markdown, remark-gfm,
tailwind-merge, class-variance-authority, clsx, radix-ui). Lockfile
regenerated with --legacy-peer-deps (cmdk@0.2.1 peers react@^18 but
LGP's lock resolves it the same way).

The beautiful-chat page still references /api/copilotkit-beautiful-chat
which CST does not host; that route exists only in LGP. The page tree
renders but the chat itself will 404 on POST. Adding the dedicated
route is out of scope for this slot (no API-route edits).

--no-verify: pre-commit oxlint binary not installed in this worktree
(missing dev tool, not a code defect).
2026-05-30 20:14:07 -07:00
Jordan Ritter c560df9e68 feat(showcase): complete pydantic-ai D6 page-mirror + fix frontend-tools slug
Mirror manifest-driven homepage from langgraph-python (replacing 59-line stub
with the tag-grouped, features-ordered layout) and add the missing
threadid-frontend-tool-roundtrip demo page. Register the new agent slug in
the runtime route so the demo can talk to the PydanticAI backend via the
default sales agent mount.

Fix the pre-existing frontend-tools slug mismatch: the page declared
agent="frontend-tools" (matching what src/app/api/copilotkit/route.ts
registers) but CopilotSidebar received agentId="frontend_tools" (underscore,
LGP convention). Align agentId to the hyphenated form pydantic actually
registers.

Pin @copilotkit/* deps to 1.59.0 (matching LGP's installed versions), add
the previously-missing @copilotkit/shared, and bump @ag-ui/{client,core}
to ^0.0.52 to satisfy the new @copilotkit/shared peer range. Regenerate
package-lock.json. Python backend (agent.py / agent_server.py / src/agents/)
is preserved untouched.
2026-05-30 20:12:54 -07:00
Jordan Ritter 619be316c4 fix(showcase): stub agents._header_forwarding in crewai-crews python test
The D6 conveyance commit added a top-level _header_forwarding import in
agent_server.py; the test's _stub_heavy_modules fixture omitted it, causing
ModuleNotFoundError at import time. Register the stub submodule with a no-op
hook and a pass-through BaseHTTPMiddleware subclass.
2026-05-30 18:27:56 -07:00
Jordan Ritter 0143b02ae3 WIP: D6 rollout — foundation + per-integration fixtures + conveyance fixes (#5109)
## Status

WIP / not ready to merge. Preserves in-flight D6 work so it isn't lost
mid-rollout. LGP is fixture-complete; other integrations are
mid-rollout.

### Latest banked work

- **langgraph-python — 185 / 0 / 2** (green). Achieved by narrowing a d4
chat matcher that was shadowing the d6 beautiful-chat search_flights
fixture (load order is shared -> d4 -> d6, first-match-wins) plus
refreshing the d6 tool-rendering and tool-rendering-custom-catchall AAPL
fixtures (turnIndex:0 -> hasToolResult:false so the first leg fires in
multi-pill threads). 2 skips are the by-design mcp-apps iframe gap.
- **langgraph-typescript — 185 / 0 / 2** (green). Mirrored the LGP d4
narrowing on the LGT side (3 matchers) and across the
d6/langgraph-typescript suite: replaced fragile turnIndex:0 gates with
hasToolResult:false, fixed em-dash escaping that broke literal matches
in multi-pill threads, and added jsFunctions payloads to the three
sandboxed-ui fixtures (`_from-feature-parity`, `headless-complete`,
`gen-ui-open-advanced`). The final fix removed the chain-tools
`hasToolResult` match gate (which checked the whole thread and made the
chain pill fall through to the broad weather matcher mid-thread),
mirroring LGP.
- **google-adk: 174/7/2 (was 134/52/5)** — conveyance + test-parity +
fixtures + pill-wiring rebuild; 7 residual (6 default-catchall framework
default-renderer testid version question, 1 beautiful-chat fixture).
- **Pill-parity staged across 13 integrations** (ag2, agno, mastra,
pydantic-ai, claude-sdk-python, claude-sdk-typescript, llamaindex,
langroid, strands, spring-ai, built-in-agent, crewai-crews,
langgraph-fastapi). The canonical LGP suggestion pill set is now
mirrored as `src/app/demos/*/suggestions.ts` files in each integration,
with targeted edits to existing `open-gen-ui-advanced` and
`byoc-hashbrown` files. **These new files are currently UNWIRED** — each
integration's `page.tsx` still defines its pill list inline via
`useConfigureSuggestions`. Banked so the canonical source survives; a
follow-up will rewire `page.tsx` to import from `suggestions.ts` and
drop the inline copies.
- **Fleet test-parity sweep**: 576 e2e specs across 15 integrations
aligned to LGP canonical (SHA-verified); 2 orphan specs removed.
- ms-agent-dotnet 177/5/7, ms-agent-python 174/11/2 (post
fixture-mirror); default-catchall green (page-level renderer, not
react-core-gated).

## Scope

### Conveyance (foundation)

Inbound `x-aimock-context` (and friends) must ride along on outbound LLM
HTTP calls so aimock fixture matching sees the inflight test's context.
Without this the call lands on the default project's aimock and silently
picks the wrong fixture. New per-integration
`_header_forwarding.{py,ts}` shim plus matching `agent_server` / route /
factory wiring covers: ag2, agno, built-in-agent, claude-sdk-python,
claude-sdk-typescript, crewai-crews, google-adk, langgraph-fastapi,
langgraph-python, langgraph-typescript, langroid, llamaindex, mastra,
ms-agent-python, pydantic-ai, strands.

For ADK/Gemini the global httpx hook is installed BEFORE any `agents.*`
import (google-genai constructs its client at module-import time).

### langgraph-python — 185 / 0 / 2

Fixture-complete via the conveyance shim + refreshed d6/langgraph-python
fixtures + copilotkit 0.1.93 bump + the latest d4-matcher-narrowing fix
(see banked work above).

### Per-integration fixtures

Mid-rollout snapshot of d6 fixtures across the cohort plus narrowing of
`aimock/shared/common.json`'s generic 'hello' fixture to 'hello world'
so it no longer shadows D6 pills whose prompts contain 'hello' as a
substring.

### Harness `--isolate` patch

`scripts/cli/_common.sh apply_isolation` now rewrites compose-file
relative paths to absolute (build/context/dockerfile/volumes/env_file),
enforces the docker compose `[a-z0-9_-]` project-name rule, and exports
`SHOWCASE_COMPOSE_FILE` / `SHOWCASE_INFRA_PORT_OFFSET` plus offset host
URLs. The TS harness CLI (`aimock-rebuild` / `config` / `doctor` /
`lifecycle`) honors the new env so concurrent isolated stacks stop
reporting each other's services as healthy.

## Lockfile decision flagged

`showcase/integrations/langgraph-python/pnpm-lock.yaml` was deleted in
this branch. Decision: keep the deletion. Rationale:

- 03bed3b76 (fix(showcase): regenerate 18 lockfiles in isolation; switch
to npm ci) migrated all showcase integrations off pnpm onto npm ci.
- The integration's Dockerfile uses `npm ci --legacy-peer-deps`.
- Every sibling integration committed only `package-lock.json` after
03bed3b76.
- The orphan pnpm-lock.yaml only risks tooling drift.

If anyone wants it restored: `git checkout origin/main --
showcase/integrations/langgraph-python/pnpm-lock.yaml`.

## Commits

- feat(showcase): D6 conveyance — forward x-aimock-context headers to
LLM clients
- feat(showcase/langgraph-python): D6 conveyance shim + copilotkit
0.1.93 bump
- feat(showcase/langgraph-typescript): D6 conveyance — propagate request
headers into ChatOpenAI
- feat(showcase/built-in-agent): D6 conveyance — header-forwarding shim
+ factory wiring
- feat(showcase/harness): support concurrent --isolate runs
- test(showcase): D6 langgraph-python fixtures — drive to 180/5/2
- test(showcase): D6 per-integration aimock fixtures + shared narrowing
- docs(showcase): GOTCHAS entry for D6 conveyance + --isolate notes
- feat(showcase): D6 conveyance — wire header-forwarding shims into
remaining entrypoints
- fix(showcase): unblock LGP D6 beautiful-chat + custom-catchall via d4
matcher narrowing
- fix(showcase): narrow LGT D6 d4 shadows + wire sandboxed-ui
jsFunctions
- chore(showcase): copy LGP canonical suggestion pills into 13
integrations
- fix(showcase): forward x-aimock-context per-request in google-adk
routes
- test(showcase): align google-adk e2e specs to langgraph-python
canonical
- fix(showcase): align google-adk D6 fixtures to LGP contract
- fix(showcase): wire google-adk default-catchall to shared 4-pill
suggestions
2026-05-30 16:32:19 -07:00
Jordan Ritter 66cefcf77c fix(showcase): add missing shadcn primitives + fix chat-slots bundling for pydantic-ai D6 mirror
The D6 parity mirror sweep copied LGP demo pages into pydantic-ai but did
not copy the shadcn UI primitives + lib/utils they import, nor reconcile
the manifest highlight paths against actual mirrored file layouts.

Caused two CI build-check failures on PR #5109:

1. pydantic-ai build-check: Next webpack could not resolve
   '@/components/ui/{button,card,avatar,...}' or '@/lib/utils'.
   Fix: copy LGP shadcn primitives (avatar, badge, button, card, input,
   scroll-area, select, separator, spinner, textarea) + lib/utils.ts;
   add 'radix-ui' (umbrella package the primitives import from) and
   'yaml' (used by demos/layout.tsx) to package.json + lockfile.

2. shell-dojo build-check: bundle-demo-content.ts rejected
   pydantic-ai::chat-slots highlight path
   'src/app/demos/chat-slots/custom-welcome-screen.tsx' (does not exist).
   Fix: align pydantic-ai manifest highlight paths for chat-slots,
   headless-complete, tool-rendering-reasoning-chain, and
   gen-ui-interrupt with LGP-canonical paths that match the mirrored
   file layout (slot-wrappers.tsx, chat/hooks/tools subdirs,
   _components/time-picker-card.tsx; drop nonexistent README.md ref).

Local verification: npm run build in pydantic-ai succeeds;
bundle-demo-content.ts bundles 695 demos including all four previously
broken pydantic-ai entries with no errors.
2026-05-30 16:24:09 -07:00
Jordan Ritter 0c8ae8a4f9 fix(showcase): remove dangling shared-state-write nav cards (CST + pydantic) 2026-05-30 16:10:01 -07:00