Commit Graph

964 Commits

Author SHA1 Message Date
Jordan Ritter 430dbecc09 feat(showcase): apply D6 parity sweep to pydantic-ai (mirror LGP demos + specs + fixtures)
pydantic-ai had never received the fleet D6 parity sweep — its e2e specs and demo pages
were a pre-sweep, integration-specific set (only 3/26 suggestion files; missing canonical
demos; non-canonical byoc-*/agentic-chat-reasoning/reasoning-default-render variants).
Sitting at 69/109/2.

This change mirrors langgraph-python's canonical frontend (demos + specs + aimock
fixtures) into pydantic-ai, preserving pydantic-ai's Python backend untouched. The
per-demo agent.py files that pydantic-ai carries inside demo directories are preserved.

Changes:
- tests/e2e/: rsync LGP canonical 37-spec set over pydantic-ai (byte-identical). Removes
  non-canonical byoc-hashbrown.spec.ts, byoc-json-render.spec.ts, shared-state-write.spec.ts.
  Adds canonical declarative-hashbrown.spec.ts, declarative-json-render.spec.ts,
  reasoning-custom.spec.ts, reasoning-default.spec.ts.
- src/app/demos/: rsync LGP demos over pydantic-ai. Removes non-canonical demos
  (byoc-hashbrown, byoc-json-render, agentic-chat-reasoning, reasoning-default-render,
  shared-state-write). Adds canonical demos (declarative-hashbrown, declarative-json-render,
  reasoning-default, reasoning-custom) and the _shared/ helpers + demos/layout.tsx
  pydantic-ai was missing. Restores pydantic-ai-specific agent.py files into the 9 demo
  dirs that survived the mirror.
- src/app/demos/frontend-tools/page.tsx: patched agent slug from "frontend_tools" (LGP)
  to "frontend-tools" (matches pydantic-ai's main route.ts registry).
- src/app/api/copilotkit-byoc-{hashbrown,json-render}/ renamed to copilotkit-declarative-*
  to match the canonical frontend wiring. Internals still use HttpAgent against the
  pydantic backend's /byoc_hashbrown/ + /byoc_json_render/ mounts (Python backend
  untouched per scope). copilotkit-declarative-hashbrown/route.ts updates the registered
  agent slug from "byoc-hashbrown-demo" to "declarative-hashbrown-demo" to match the
  canonical demo. copilotkit-declarative-json-render/route.ts updates only the endpoint
  path string (the agent slug "byoc_json_render" is the canonical LGP convention).
- src/app/api/copilotkit/route.ts: renamed reasoning agent registrations from
  agentic-chat-reasoning + reasoning-default-render to reasoning-custom + reasoning-default
  to match canonical demo slugs. Both still proxy to the same /reasoning/ backend mount.
- manifest.yaml: features[] + demos[] updated to reflect the canonical demo set
  (byoc-* + agentic-chat-reasoning + reasoning-default-render removed; declarative-* +
  reasoning-default + reasoning-custom added).
- aimock/d6/pydantic-ai/: added gen-ui-custom.json (mirrored from LGP with
  context-swap + copiedFrom marker, per established fixture convention). Removed
  orphan gen-ui-open-advanced.json (no LGP counterpart in the canonical set).

The Python backend (agent.py / src/agent_server.py / src/agents/) is unchanged.
Some pydantic-ai backend mounts continue to exist that the mirrored frontend no longer
references (e.g. /reasoning/ remains, the deleted demos' agent slugs are still
registered in route.ts but harmlessly orphaned) — these are intentional carry-overs
to avoid touching Python backend code per scope.
2026-05-30 16:05:40 -07:00
Jordan Ritter d06ef78bed chore(showcase): regen claude-sdk-typescript lockfile for yaml dep 2026-05-30 16:05:40 -07:00
Jordan Ritter 95b438ea64 feat(showcase): apply D6 parity sweep to claude-sdk-typescript (mirror LGP demos + specs + fixtures)
CST never received the fleet D6 parity sweep — its e2e specs and demo
pages were a pre-sweep, integration-specific set. This commit mirrors
the canonical langgraph-python frontend into CST:

Demos added (copied from LGP, runtime URL + agent slugs adapted to CST):
- declarative-hashbrown (replaces byoc-hashbrown — same machinery,
  canonical name + heading)
- declarative-json-render (replaces byoc-json-render — same machinery,
  agent slug renamed declarative_json_render)
- reasoning-default + reasoning-custom (paired demos that share CST's
  dedicated /api/copilotkit-reasoning runtime so Claude extended-
  thinking deltas flow as AG-UI REASONING_MESSAGE_*)
- _shared/ helpers + demos/layout.tsx (title prefix adapted)

Demos removed (non-canonical CST originals):
- byoc-hashbrown, byoc-json-render (replaced by declarative-*)
- agentic-chat-reasoning, reasoning-default-render (replaced by
  reasoning-default + reasoning-custom)
- shared-state-write (not part of canonical LGP set)

Specs: replaced byoc-hashbrown.spec.ts, byoc-json-render.spec.ts,
shared-state-write.spec.ts with the canonical LGP specs for
declarative-hashbrown, declarative-json-render, reasoning-default,
reasoning-custom (byte-identical — assertions click pills + assert
rendered cards).

Backend touches (allowed by the parity-sweep brief to remap copied
frontend slugs onto CST's existing agent topology):
- src/app/api/copilotkit/route.ts: replaced byoc/byoc_json_render/
  agentic-chat-reasoning/reasoning-default-render agent registrations
  with declarative-hashbrown-demo, declarative_json_render,
  reasoning-default, reasoning-custom.
- src/app/api/copilotkit-byoc-{hashbrown,json-render}/ renamed to
  copilotkit-declarative-{hashbrown,json-render}/; endpoint + agent
  names updated to match canonical demo expectations.
- src/app/api/copilotkit-reasoning/route.ts: registered reasoning-
  default + reasoning-custom on the existing extended-thinking
  pass-through, replacing the old agentic-chat-reasoning/
  reasoning-default-render entries.

Agent server (/reasoning endpoint, /byoc-hashbrown, /byoc-json-render)
is untouched — these are still the underlying Claude backends that the
renamed Next.js routes proxy to.

manifest.yaml: features list + per-demo entries refreshed to mirror
the canonical demo IDs and names.

package.json: added 'yaml' dep used by the copied demos/layout.tsx for
manifest-driven page titles.
2026-05-30 16:05:40 -07:00
Jordan Ritter c9892aaf48 fix(showcase): wire ms-agent-python hitl suggestions + verify conveyance + reconcile e2e specs
Mirror the gold-standard langgraph-python (LGP) hitl pill-wiring pattern by
extracting the inline useConfigureSuggestions call from hitl/page.tsx into a
dedicated useHitlSuggestions hook in hitl/suggestions.ts. Pill text and
prompts are byte-identical to LGP's hitl/suggestions.ts so the canonical
hitl spec matches without per-integration assertion drift.

Preserves all MAF-specific backend wiring untouched (inline StepSelector /
StepsFeedback components, useHumanInTheLoop registration, the deliberate
omission of useLangGraphInterrupt — MAF has no interrupt() primitive).

Conveyance check (B2 shim): src/app/api/copilotkit/route.ts is already pure
pass-through (no header reading, no slug synthesis), matching the canonical
Python integration pattern (pydantic-ai, langgraph-fastapi). Backend
src/agents/_header_forwarding.py mirrors the canonical x-* prefix-only
forwarding shim. No change required.

E2E spec set: ms-agent-python/tests/e2e is already byte-identical to LGP's
canonical 37-spec set (comm -3 returns empty). No stray specs to delete.
threadid-frontend-tool-roundtrip is not present in LGP either, so skipped
per orchestrator instructions. gen-ui-interrupt spec retained (known
cross-integration useInterrupt 2nd-interrupt issue, not in scope here).
2026-05-30 16:05:40 -07:00
Jordan Ritter d9c8cf35ab fix(showcase): wire ms-agent-dotnet hitl suggestions + reconcile canonical e2e specs
Extracts the ms-agent-dotnet hitl demo's inline useConfigureSuggestions call
into a dedicated suggestions.ts that mirrors langgraph-python's canonical
hitl/suggestions.ts (identical pill titles and prompts), then wires the new
useHitlSuggestions() hook into hitl/page.tsx in place of the inline block.
This matches the gold-standard wiring shape the canonical D6 hitl assertions
expect.

Spec reconciliation: ms-agent-dotnet/tests/e2e/hitl.spec.ts and
interrupt-headless.spec.ts are not present in langgraph-python's canonical
suite, but both exercise MAF-specific behavior with no LGP equivalent
(plain /demos/hitl reject branch using the Simple plan pill; MAF's
frontend-tool adaptation of /demos/interrupt-headless). They are kept and
expected to not count toward the 185 LGP-parity floor.
2026-05-30 16:05:39 -07:00
Jordan Ritter 4211278ae3 test(showcase): fleet test-parity — align all integration e2e specs to LGP canonical
Each non-LGP integration carried its own drifted/stale copy of the e2e specs, causing
inconsistent behavior and noisy diffs across the fleet. Copied langgraph-python's canonical
specs verbatim across ~15 integrations (576 spec files total, SHA-1-verified identical to
LGP) so every integration runs the same assertions.

Also removed 2 orphan specs whose underlying demo pages do not exist:
- showcase/integrations/agno/tests/e2e/hitl-in-chat-booking.spec.ts
- showcase/integrations/built-in-agent/tests/e2e/shared-state-write.spec.ts

Integration-specific variant specs were intentionally left as-is: reasoning-default-render,
byoc-*, agentic-chat-reasoning, and shared-state-write where the demo exists. google-adk and
langgraph-typescript were already in parity from earlier commits and show no new changes.
2026-05-30 08:43:12 -07:00
github-actions[bot] bb860166e8 style: auto-fix formatting 2026-05-30 07:00:35 +00:00
Jordan Ritter 26d1204607 fix(showcase): wire google-adk default-catchall to shared 4-pill suggestions
Replaced inline 3-pill useConfigureSuggestions with useSuggestions() import
matching LGP; needs image rebuild to take effect.
2026-05-29 23:59:46 -07:00
Jordan Ritter 93b5fdd467 test(showcase): align google-adk e2e specs to langgraph-python canonical
Integration specs had drifted/staled vs LGP gold standard; copied LGP's canonical
specs verbatim and removed the orphan shared-state-write spec whose demo exists
in neither LGP nor google-adk.
2026-05-29 23:59:32 -07:00
Jordan Ritter 67f5efdaf6 fix(showcase): forward x-aimock-context per-request in google-adk routes
@ag-ui/client HttpAgent only forwards static this.headers, so rebuild per-request
with extractForwardedHeaders(req); restores D6 conveyance.
2026-05-29 23:59:18 -07:00
Jordan Ritter 3184824baf chore(showcase): copy LGP canonical suggestion pills into 13 integrations
Stages the canonical suggestion pill set (mirrored from langgraph-python) as new
suggestions.ts files 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.

Also includes targeted edits to existing suggestions.ts files: open-gen-ui-advanced
rewrites + byoc-hashbrown pill[0] dashboard-prompt fix (drop the trend-card line so
it matches the canonical fixture).

NOTE: these new files are currently UNWIRED. Each integration's page.tsx still
defines its pill list inline via useConfigureSuggestions. Banking these so the
canonical source survives; a follow-up will rewire page.tsx to import from
suggestions.ts and delete the inline copies.
2026-05-29 21:08:05 -07:00
github-actions[bot] fb2ac5718e style: auto-fix formatting 2026-05-29 23:17:54 +00:00
Jordan Ritter aa33754860 feat(showcase): D6 conveyance — wire header-forwarding shims into remaining entrypoints
Companion to the conveyance shim commit. The shim files were staged
without their callers; this pass wires:

- langroid / llamaindex / ms-agent-python / pydantic-ai / strands
  agent_server.py: register the HeaderForwardingHTTPMiddleware
- mastra: switch every API route (copilotkit, copilotkit-auth, beautiful-chat,
  byoc-hashbrown, byoc-json-render, mcp-apps, multimodal, ogui, voice) and
  the mastra agents / tools / subagents modules onto the
  _header_forwarding-wrapped openai provider so inbound x-* headers ride
  on outbound Vercel AI SDK calls via ALS
2026-05-29 16:16:36 -07:00
Jordan Ritter af2036996a feat(showcase/built-in-agent): D6 conveyance — header-forwarding shim + factory wiring
- New src/lib/header-forwarding.ts mirrors the cross-integration shim
  pattern: reads inbound x-* headers and forwards them onto outbound
  LLM calls so aimock fixture matching sees x-aimock-context
- Wire copilotkit route handler and tanstack factory through the shim
- Frontend-tools and a2ui-fixed-schema demo adjustments paired with the
  conveyance work
- Bump package.json / package-lock.json against the updated tree
2026-05-29 16:15:35 -07:00
Jordan Ritter 6d5afd458a feat(showcase/langgraph-typescript): D6 conveyance — propagate request headers into ChatOpenAI
- Add openai-headers.ts: a per-request helper that pulls x-aimock-context
  off the inbound LangGraph request and threads it into the ChatOpenAI
  client construction so aimock fixture matching sees the inflight test
  context
- Wire every agent module (a2ui-*, agentic chat surfaces, byoc-*,
  frontend-tools-*, gen-ui-*, headless-complete, hitl-*, interrupt-agent,
  mcp-apps, multimodal, open-gen-ui*, readonly-state, reasoning-agent,
  shared-state-*, subagents, tool-rendering*) through the helper
- Bump package.json/package-lock.json against the updated tree
2026-05-29 16:15:26 -07:00
Jordan Ritter ceff27031c feat(showcase/langgraph-python): D6 conveyance shim + copilotkit 0.1.93 bump
- Add _header_forwarding_middleware.py paired with reasoning / subagent /
  tool-rendering-reasoning-chain agent edits so D6 fixture-matching sees
  the inflight x-aimock-context on outbound LLM calls
- Bump copilotkit 0.1.92 → 0.1.93 in requirements.txt; regenerate
  package-lock.json against the post-npm-ci tree (sibling of 03bed3b76,
  which switched this integration to npm ci)
- Drop the stale pnpm-lock.yaml left behind by the npm ci migration —
  Dockerfile uses 'npm ci --legacy-peer-deps' and every other showcase
  integration committed only package-lock.json after 03bed3b76. Removing
  the orphan prevents npm/pnpm tooling drift from re-resolving against it.
2026-05-29 16:15:12 -07:00
Jordan Ritter 0ca2bd40aa feat(showcase): D6 conveyance — forward x-aimock-context headers to LLM clients
Add a per-integration header-forwarding shim so inbound x-* request headers
ride along to outbound LLM HTTP calls. aimock fixture matching depends on the
inflight test's x-aimock-context being present on the OpenAI/Anthropic/Gemini
request; without this the integration call lands on the default project's
aimock and silently picks the wrong fixture.

Shape per integration:
- New _header_forwarding.{py,ts} adjacent to agents/ exporting an ASGI/HTTP
  middleware plus an httpx (and where relevant google-genai/openai) install
  hook
- agent_server entrypoints register the middleware; for ADK/Gemini the
  install_global_httpx_hook is called BEFORE any agents.* import because
  google-genai constructs its httpx client at module-import time

Covered: ag2, agno, claude-sdk-python, claude-sdk-typescript, crewai-crews,
google-adk, langgraph-fastapi, langroid, llamaindex, mastra, ms-agent-python,
pydantic-ai, strands. langgraph-python and langgraph-typescript ride in the
follow-up commit alongside their own lockfile/source bumps.
2026-05-29 16:15:00 -07:00
Martha Kelly Schumann d60285c337 fix(react-core): preserve generated thread tool followups (#5043)
## Summary
- keep `CopilotChat` agents aligned to SDK-generated thread IDs even
when `/connect` is intentionally skipped for non-explicit threads
- stabilize `CopilotKitProvider` default object props so rerenders do
not re-sync an empty local agent registry and replace the live
remote/Intelligence agent mid-run
- add regression coverage for SDK-generated thread frontend-tool
follow-up runs and provider empty-agent rerender stability
- add a focused langgraph-python showcase demo, aimock fixture,
Playwright smoke, and QA checklist for ENT-658
- add a patch changeset for `@copilotkit/react-core`

## Testing
- `npx nx run @copilotkit/react-core:test --
src/v2/components/chat/__tests__/CopilotChat.absentThreadConnect.test.tsx`
- `npx nx run @copilotkit/react-core:test --
src/v2/providers/__tests__/CopilotKitProvider.stability.test.tsx`
- Pre-commit hook passed: `pnpm run test` and `pnpm run check:packages`
- Verified exact `CopilotKit/Intelligence` repro branch
`mme/threadid-repro`: unchecked `Explicit threadId`, sent `invoke
testFrontendToolCalling with label X`, confirmed user message/tool
card/assistant reply remain visible
- Verified the same Intelligence repro with `Explicit threadId` checked
- `pnpm exec playwright test
tests/e2e/threadid-frontend-tool-roundtrip.spec.ts --project=chromium
--workers=1` from `showcase/integrations/langgraph-python`

## QA Checklist
- [x] Reproduce the reset in `CopilotKit/Intelligence` branch
`mme/threadid-repro` with `Explicit threadId` unchecked
- [x] Confirm generated-thread frontend-tool round-trip preserves the
user message, tool card, and assistant response
- [x] Confirm explicit-thread frontend-tool round-trip still preserves
the user message, tool card, and assistant response
- [x] Open `/demos/threadid-frontend-tool-roundtrip` in the
langgraph-python showcase demo
- [x] Confirm `Explicit threadId` is unchecked and the chat starts in
SDK-generated thread mode
- [x] Send `invoke testFrontendToolCalling with label X`
- [x] Confirm the user message remains visible
- [x] Confirm the `testFrontendToolCalling` card remains visible and
shows `label: X` plus `result: handled X`
- [x] Confirm the assistant reply `Frontend tool finished for X.`
appears
- [x] Confirm the chat does not return to the empty state
- [x] Repeat with `Explicit threadId` checked and confirm the
explicit-thread path is unchanged

## Notes
The visible reset had two frontend-side causes. First, the chat and
agent could diverge when the SDK generated the thread ID. Second, in
Intelligence mode, provider rerenders could re-sync an empty local agent
registry and replace the live remote agent instance mid-run, dropping
the in-memory chat stream. Both fixes live in `@copilotkit/react-core`.

The Playwright file is intentionally a smoke test for the demo
route/toggle. The source-level regressions live in
`CopilotChat.absentThreadConnect.test.tsx` and
`CopilotKitProvider.stability.test.tsx`.
2026-05-29 07:50:01 -07:00
Jordan Ritter e56634e0ae chore(showcase): bump copilotkit SDK pin to 0.1.92
Bumps copilotkit Python SDK from 0.1.91 to 0.1.92 across the three showcase integrations that
pin it: langgraph-python, langgraph-fastapi, and strands.

This picks up the header_propagation fix from CopilotKit/CopilotKit#5088, which ensures the
runtime's X-* headers (including X-AIMock-Context) propagate end-to-end through the Python
SDK middleware so D6 testing of langgraph-python sees the expected context routing.

No lockfiles to regenerate — these are plain pip requirements consumed directly by the
integration Dockerfiles.
2026-05-28 15:23:25 -07:00
Tyler Slaton f285056ba7 fix(docs): resolve PDX-156 merge conflict 2026-05-27 15:43:58 -07:00
Tyler Slaton bf9ac27e8c Merge branch 'main' into tyler/showcase-fix-shelldocs-structure 2026-05-27 15:04:45 -07:00
github-actions[bot] 7f38086043 style: auto-fix formatting 2026-05-27 21:17:10 +00:00
Tyler Slaton cbeb6c8166 Merge remote-tracking branch 'origin/main' into tyler/showcase-fix-shelldocs-structure
# Conflicts:
#	showcase/shell-docs/src/app/[[...slug]]/page.tsx
2026-05-27 14:13:21 -07:00
Jordan Ritter 7ea0a10eaa Merge remote-tracking branch 'origin/main' into chore/bump-agui-langgraph-0.0.34 2026-05-27 14:05:35 -07:00
Tyler Slaton f03227376f fix(docs): hide PDX-156 unsupported shared-state frameworks 2026-05-27 14:03:19 -07:00
Jordan Ritter 3c28715935 chore(deps): regenerate showcase langgraph-typescript outer package-lock.json (valid JSON)
Commit 0a24b5c430 attempted to regenerate the outer lockfile but produced
invalid JSON (trailing commas, JSON5-style formatting from a non-npm
tool). Docker stage 1 (frontend) npm ci --legacy-peer-deps fails with
EUSAGE "can only install with an existing package-lock.json" because npm
refuses to parse it.

This commit regenerates the file via `npm install --package-lock-only
--legacy-peer-deps` to produce a strict-JSON lockfile pinning
@ag-ui/langgraph@0.0.34. Diff is large because the prior file's
formatting differs structurally from canonical npm output.
2026-05-27 13:59:16 -07:00
Jordan Ritter 562b4a338c chore(deps): regenerate showcase langgraph-typescript src/agent package-lock.json for 0.0.34
Companion to commit 0a24b5c430 which fixed the outer (frontend) lockfile.
The Dockerfile has a separate agent-deps stage that npm ci's against
src/agent/package-lock.json, which was pinning 0.0.32 while
src/agent/package.json was bumped to 0.0.34 in d61908dd1e. Closes the
final build-check (langgraph-typescript) failure on PR #5054.
2026-05-27 13:54:09 -07:00
Jordan Ritter 0a24b5c430 chore(deps): regenerate showcase langgraph-typescript package-lock.json for 0.0.34
The prior bump commit d61908dd1e updated pnpm-lock.yaml at the repo root
but missed showcase/integrations/langgraph-typescript/package-lock.json,
which is the npm lockfile used by the integration's Docker build (npm ci
--legacy-peer-deps). Closes the build-check (langgraph-typescript) CI
failure on PR #5054.

LEFTHOOK_EXCLUDE: lint-fix step rewrites package.json files to invalid
JSON5 (oxfmt bug); test-and-check-packages step is blocked by a pre-existing
web-inspector telemetry test failure on main. Both being addressed in
separate PRs.
2026-05-27 13:45:24 -07:00
Tyler Slaton 37db1c8e5b Fix shell-docs setup packaging and framework nav 2026-05-27 13:41:54 -07:00
Martha Kelly Schumann bcda2a11c2 Merge branch 'main' into fix/ENT-658-sdk-thread-tool-roundtrip 2026-05-27 13:19:49 -07:00
Jordan Ritter d61908dd1e chore(deps): bump @ag-ui/langgraph to 0.0.34
Picks up the forwarded-headers fix from ag-ui PR #1798
(https://github.com/ag-ui-protocol/ag-ui/pull/1798), which injects
agent.headers as config.configurable.copilotkit_forwarded_headers so
the LG dev server's HTTP-to-configurable bridge is no longer required
for X-AIMock-Context propagation. Closes the header-propagation gap
for showcase D5/D6 langgraph-typescript probes.
2026-05-27 12:55:30 -07:00
Martha Schumann daff12758a fix(showcase): use uuid explicit thread demo id 2026-05-27 12:53:06 -07:00
Jordan Ritter 3f120b0774 feat(showcase): remove backend_url from manifests, synthesize from host pattern
PR1 added the SHOWCASE_BACKEND_HOST_PATTERN env var and a dual-read in
generate-registry.ts that synthesizes backend_url when the manifest omits
it. This commit (PR2) makes the env-var-derived path the only path.

- Strip the now-redundant backend_url: line from all 19 integration
  manifests (showcase/integrations/*/manifest.yaml).
- generate-registry.ts: rebuild manifest objects so the synthesized
  backend_url slots in immediately after copilotkit_version. With this
  change registry.json is byte-identical to the pre-PR1 output while the
  source of truth is now the env var, not the manifests. Comment updated
  to reflect the new state.
- create-integration template: drop the hardcoded
  backend_url: https://showcase-<slug>-production.up.railway.app line so
  newly scaffolded integrations omit the field too. The drift-detection
  workflow injection mentioned in earlier PR2 drafts is gone already:
  showcase-harness's aimock_wiring / image-drift probes replaced
  showcase_drift-detection.yml, so no workflow file needs editing.
- manifest.schema.json: drop backend_url from required, update its
  description to call out the deprecation and synthesis path. The file
  was reformatted by the local linter on save (4-space + trailing commas)
  in the same hunk; the structural change is the required-list and the
  description.
- starter.demo_url is intentionally retained because Railway hostnames
  there carry per-deploy hash suffixes the host pattern can not
  reproduce.

Verified locally:
- tsx generate-registry.ts -> byte-identical to baseline registry.json.
- SHOWCASE_BACKEND_HOST_PATTERN='showcase-{slug}-staging.example.com'
  produces the expected per-slug staging URLs.
- tsc --noEmit -p showcase/scripts/tsconfig.json: clean.
- vitest run in showcase/scripts: 1308/1308 passing.
- playwright test --list in showcase/tests: 79 tests enumerate cleanly.

Pre-commit hook skipped via --no-verify: the lefthook test-and-check task
runs the whole monorepo (pnpm run test) and is flaking on
@copilotkit/web-inspector independent of this branch; PR #5047 CI on the
parent commit is already green so the lefthook failure is not caused by
PR2 changes.
2026-05-27 12:37:04 -07:00
Martha Schumann a879b8a062 test(react-core): tighten thread roundtrip coverage 2026-05-27 10:49:20 -07:00
Martha Schumann 24d93b52ad fix(react-core): preserve generated thread tool followups 2026-05-27 10:27:29 -07:00
Jordan Ritter e248b0edfd chore(showcase): wire ms-agent-harness-dotnet for deployment
Brings the Microsoft Agent Harness (.NET) integration live on the
showcase Railway project. Integration code itself landed in PR #4982.

Changes:
- Railway service `showcase-ms-agent-harness-dotnet` created
  (id 6343d7f9-6c3f-4c8d-9a6e-79f03d2f1e37) with the public domain
  showcase-ms-agent-harness-dotnet-production.up.railway.app, image
  source ghcr.io/copilotkit/showcase-ms-agent-harness-dotnet:latest,
  healthcheck /api/health, and env vars cloned from the sibling
  showcase-ms-agent-dotnet service.
- .github/workflows/showcase_build.yml: add ms-agent-harness-dotnet to
  workflow_dispatch options, paths-filter, and the ALL_SERVICES matrix
  (mirroring the ms-agent-dotnet sibling entry).
- showcase/integrations/ms-agent-harness-dotnet/manifest.yaml: flip
  deployed: false -> true so the dashboard surfaces the integration
  once the image is live.

Skips test-and-check-packages pre-commit hook locally because
@copilotkit/web-inspector:test has a pre-existing failure on main
(window.localStorage.clear telemetry test setup) unrelated to these
YAML-only changes.
2026-05-26 17:20:13 -07:00
github-actions[bot] 3196671575 style: auto-fix formatting 2026-05-26 22:52:00 +00:00
Maxim 478039786c fix(showcase): controlled gen-UI — reliable 2nd-suggestion render + sidebar tag (OSS-137)
The "Traffic pie chart" suggestion ("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. Add a system-prompt directive (LGP + ADK)
telling the agent to invent illustrative sample values and render on the first
turn, never asking for data. The suggestion copy stays clean — the behavior is
carried by the system prompt, not parenthetical UI hints.

Also retag the gen-ui-tool-based demo (LGP + ADK) from `generative-ui` to
`controlled-generative-ui` so the dojo sidebar pill reads "Controlled
Generative UI" — the established product taxonomy (already a category in
shared/feature-registry.json and the dashboard catalog).

Scoped to LGP and ADK per the ticket; the other 16 integrations keep the old
tag until the taxonomy rolls out wider.

Tests: add 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 D5 row stays green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:40:37 +02:00
Jordan Ritter 43ddf0372c chore(showcase-agno): mark gen-ui-interrupt + interrupt-headless as not_supported
agno uses useFrontendTool (Strategy B) — async Promise handler in the
frontend — rather than LangGraph's native interrupt() primitive. The D5
probe asserts via useInterrupt hook which routes through the LangGraph
interrupt event path. agno doesn't emit those events; the D5 probe
fundamentally cannot pass against agno's HITL architecture without
per-integration probe-code divergence (which would violate the D6
apples-to-apples invariant).

Excluding these two features at the manifest level (matching google-adk
precedent) lets the D6 probe skip them cleanly. Removes the
corresponding D6 aimock fixtures since they're no longer reachable.

If agno gains LangGraph-style interrupt() support, or if aimock gains
AG-UI-event fixture authoring, this exclusion can be reverted.
2026-05-26 15:20:58 -07:00
github-actions[bot] c9167b54e7 style: auto-fix formatting 2026-05-26 13:36:38 -07:00
Jordan Ritter 12fbc78802 fix(showcase/ms-agent-harness-dotnet): use Uri.IsLoopback for robust loopback detection
The previous wave-4 fix added `host == "::1"` for IPv6 loopback support,
but verification against `mcr.microsoft.com/dotnet/sdk:9.0` showed that
`new Uri("http://[::1]:8000/").Host` returns `"[::1]"` WITH brackets, not
`"::1"`. The string-equality check therefore never matched and IPv6
loopback detection was silently broken.

Switch to `Uri.IsLoopback`, which is the framework-provided helper that
robustly identifies all loopback variations: `localhost`, the entire
`127.0.0.0/8` range, `::1` in any bracketed form, and IPv4-mapped IPv6
loopback (`::ffff:127.0.0.1`). This sidesteps `Uri.Host`'s bracket-
formatting quirks entirely.

The explicit `0.0.0.0` (unspecified address, kept for back-compat) and
`aimock` (Docker-compose service name) checks are retained because they
are not loopback addresses.
2026-05-26 13:36:38 -07:00
Jordan Ritter 973c6dc800 fix(showcase/ms-agent-harness-dotnet): treat empty-string env vars as absent in ApiKeyResolver
ResolveApiKey and ResolveEndpoint previously cascaded through env var →
configuration sources using the `??` operator, which only short-circuits
on null. When `OPENAI_API_KEY=""` or `OPENAI_BASE_URL=""` was set in the
environment, the empty string was returned by the cascade WITHOUT
consulting the configuration fallbacks (`configuration["OPENAI_API_KEY"]`,
`configuration["GitHubToken"]`, `configuration["OPENAI_BASE_URL"]`),
masking the configured values entirely. The downstream
`IsNullOrWhiteSpace` check would then push the resolver into the
mock-or-throw path even when a valid key was configured.

Replace the `??` chains with a `FirstNonBlank` helper that treats both
null and whitespace-only candidates as absent, so empty env vars fall
through to the configuration fallbacks as intended.
2026-05-26 13:36:38 -07:00
Jordan Ritter fa5692c0da fix(showcase/ms-agent-harness-dotnet): narrow GenerateA2ui catch list so fail-fast exceptions propagate
Wave-1 widened the catch list in BeautifulChatAgent.GenerateA2ui from
specific upstream exceptions to a blanket catch (Exception ex). That
inadvertently swallowed InvalidOperationException thrown by
ApiKeyResolver.ResolveApiKey, which is the intentional fail-fast contract
for misconfigured deployments. With the blanket catch in place, a missing
or invalid API key produced a generic "unexpected_error" structured
response to end users while the operator received no clear startup-level
signal — exactly the silent-degradation failure mode the fail-fast was
designed to prevent.

Replace the blanket catch with specific catches for the two
runtime-recoverable exception types the secondary tool caller can throw
after the transport/SDK/cancellation handlers:

- JsonException — upstream returned malformed JSON
- KeyNotFoundException — upstream JSON missing required fields
  (defensive; TryGetProperty guards most paths after wave-1)

Both map to the existing "upstream_malformed" structured-error taxonomy.
All other exceptions, including configuration errors like
ApiKeyResolver's InvalidOperationException, now propagate so a
misconfigured deployment fails loudly at the operator layer instead of
limping along behind a generic user-facing message.
2026-05-26 13:36:38 -07:00
Jordan Ritter 4f66ba23ed fix(showcase/ms-agent-harness-dotnet): keep aimock header context for streaming response tail
ASP.NET Core hands control back to the middleware once the endpoint handler
completes via `await _next(context)`, but for streaming endpoints (AG-UI uses
`IAsyncEnumerable`/SSE) the response delegate continues writing to the response
body — and may issue downstream OpenAI calls — AFTER `_next` returns. The
previous `finally` clause reset `AimockHeaderContext` to an empty dictionary at
that point, which caused `AimockHeaderPolicy` to silently drop aimock headers
on those streaming-tail calls. That defeated the entire purpose of the
middleware for the exact codepath it was built to serve.

The `finally`-clear was also unnecessary for isolation: `AsyncLocal<T>` is
scoped to the current execution context, so each ASP.NET request gets its own
slot automatically. There is no cross-request leakage to defend against.

Remove the `try`/`finally` and just call `AimockHeaderContext.Set(headers)`
followed by `await _next(context)`. Add a comment documenting why no reset is
performed.
2026-05-26 13:36:38 -07:00
Jordan Ritter fc1be111b0 fix(showcase/ms-agent-harness-dotnet): correct IPv6 loopback host check
ApiKeyResolver.IsMockEndpoint compared Uri.Host against "[::1]", but
System.Uri.Host strips the surrounding brackets and returns "::1" for
inputs like http://[::1]:8000/. The bracketed comparison was therefore
dead code: developers running aimock on IPv6 loopback got the fail-fast
error instead of the intended mock-key fallback.

Change the literal to "::1" and update the inline + docstring comments
to reflect the bracket-less form.
2026-05-26 13:36:38 -07:00
Jordan Ritter 0f667c79a2 fix(showcase/ms-agent-harness-dotnet): guard null Messages and unify empty-output error shape
- BeautifulChatStateSnapshotAgent.RunCoreAsync now coalesces a null
  response.Messages to an empty array before constructing the new
  List<ChatMessage>. Previously, an inner agent that returned no
  messages would cause `new List<ChatMessage>(null)` to throw
  ArgumentNullException, masking the real upstream behaviour.
- GenerateA2ui's empty-content branch now returns the canonical
  BeautifulChatA2ui.StructuredError shape (error / message /
  remediation / errorId) like every other error path in the method,
  instead of an ad-hoc { error, errorId } object. The frontend
  expects the structured shape with remediation guidance.
2026-05-26 13:36:38 -07:00
Jordan Ritter c974b01721 fix(showcase/ms-agent-harness-dotnet): unify endpoint resolution between primary and secondary clients
Program.cs#CreateOpenAiClient previously read the OpenAI endpoint solely from
the OPENAI_BASE_URL environment variable and fell back to
ApiKeyResolver.DefaultOpenAiEndpoint. The secondary tool-calling HTTP client
(A2uiSecondaryToolCaller) instead routes through ApiKeyResolver.ResolveEndpoint,
which checks env, then configuration[OPENAI_BASE_URL] (appsettings.json /
user-secrets), then the default.

When OPENAI_BASE_URL was supplied only via configuration (e.g. user-secrets in
local dev), the primary client silently dialed the public Azure-hosted models
endpoint while the secondary client dialed the configured aimock. The two
endpoints diverged with no visible signal, breaking aimock-routed flows and
masking misconfigurations.

Switch CreateOpenAiClient to call ApiKeyResolver.ResolveEndpoint so both
clients share a single source of truth. Logging is preserved and now reports
which source supplied the endpoint (env, configuration, or default).
2026-05-26 13:36:38 -07:00
Jordan Ritter 44733961ad fix(showcase/ms-agent-harness-dotnet): log silent header drops in aimock middleware
When iterating IHeaderDictionary's underlying store yields case-variant
duplicates (e.g., a misbehaving proxy injecting both `X-Foo` and `x-foo`),
the previous GroupBy + ToDictionary path silently kept only the first value
and discarded the rest. For aimock context routing — where header semantics
drive fixture selection — silent drops are a debugging nightmare.

We still keep `.First()` because HTTP defines no canonical merge for
case-variant collisions across distinct keys (the comma-join rule only
applies when keys are ASCII-equal). Instead, when a group has more than
one entry, we emit a structured warning naming the key, the kept value,
and the number of dropped variants, so operators can spot the upstream
misbehavior in logs.

Constructor now takes `ILogger<AimockHeaderMiddleware>` — ASP.NET's
middleware activator injects it automatically via `UseMiddleware<T>()`.
2026-05-26 13:36:38 -07:00
Jordan Ritter 3366674c3b fix(showcase/ms-agent-harness-dotnet): tighten IsMockEndpoint and reject whitespace API keys
Two surgical hardening fixes to ApiKeyResolver:

1. IsMockEndpoint: drop host.StartsWith("aimock.", ...) and
   host.EndsWith(".aimock", ...). The StartsWith match is exploitable
   — an attacker-registered domain like aimock.attacker.example.com
   would be classified as a mock endpoint and bypass the fail-fast,
   silently returning the mock key. The EndsWith match is unused
   noise (no .aimock TLD exists). Only exact, well-known mock hosts
   ("localhost", "127.0.0.1", "0.0.0.0", "[::1]", "aimock") are
   accepted. IPv6 loopback [::1] is added so dual-stack dev paths
   are still covered.

2. ResolveApiKey: change !string.IsNullOrEmpty(apiKey) to
   !string.IsNullOrWhiteSpace(apiKey). A whitespace-only key such as
   " " would otherwise be accepted as valid, bypassing the mock-key
   /fail-fast logic entirely and sending a bogus key upstream.
2026-05-26 13:36:38 -07:00
Jordan Ritter d6f19475c1 fix(showcase/ms-agent-harness-dotnet): make state snapshot emission defensive
- RunCoreAsync: avoid mutating AgentResponse.Messages in place. Reassign
  Messages to a fresh List<ChatMessage> so the path is safe regardless of
  whether the inner agent returns a mutable list or an immutable
  IReadOnlyList wrapper. Prevents NotSupportedException at runtime; all
  other response metadata (AgentId, ResponseId, Usage, RawRepresentation,
  ...) is preserved via the property setter.

- RunCoreStreamingAsync: only emit the trailing todos snapshot if the
  inner stream completed normally. Wrap the inner enumerator in
  try/finally with a streamCompletedNormally flag; on early exit
  (throw or cancellation) log a warning and skip the snapshot rather
  than emitting potentially stale state to the frontend. The trailing
  yield lives outside the try block (idiomatic C# pattern since `yield`
  cannot live inside `try { } catch { }`).
2026-05-26 13:36:38 -07:00