Skip to content

feat(showcase/ms-agent-python,ms-agent-dotnet): full LangGraph parity + PR #4271 fixes - #4273

Closed
AlemTuzlak wants to merge 90 commits into
mainfrom
worktree-sunny-floating-barto
Closed

AlemTuzlak wants to merge 90 commits into
mainfrom
worktree-sunny-floating-barto

Conversation

@AlemTuzlak

Copy link
Copy Markdown
Contributor

Summary

Replicates the full LangGraph Python showcase matrix for MS Agent Framework (Python) and MS Agent Framework (.NET) — ports 29 new demos to each framework (58 total) so both rows in the showcase coverage dashboard go green. Also forward-ports PR #4271's six demo runtime fixes to the new MS Agent demos.

Coverage delta

Before: each MS Agent row had 8 demos (agentic-chat, hitl-in-chat, tool-rendering, gen-ui-tool-based, gen-ui-agent, shared-state-read-write, shared-state-streaming, subagents).

After: each row has 38 demos — full feature parity with langgraph-python.

New demos (×2 frameworks):

  • Chat UI — beautiful-chat, prebuilt-sidebar, prebuilt-popup, chat-slots, chat-customization-css, headless-simple, headless-complete, cli-start
  • Agent extensions — frontend-tools, frontend-tools-async, agent-config, readonly-state-agent-context
  • Platform — multimodal, voice, auth
  • Reasoning — agentic-chat-reasoning, reasoning-default-render
  • Tool rendering — tool-rendering-default-catchall, tool-rendering-custom-catchall, tool-rendering-reasoning-chain
  • Generative UI — declarative-gen-ui (A2UI), a2ui-fixed-schema, open-gen-ui, open-gen-ui-advanced
  • BYOC — byoc-hashbrown, byoc-json-render
  • Advanced — mcp-apps, hitl-in-app, gen-ui-interrupt, interrupt-headless

Build & deploy notes

  • Python (showcase/packages/ms-agent-python/): src/agent_server.py now mounts 15 agents at dedicated FastAPI paths (specific paths BEFORE the / catch-all — the AG-UI wildcard shadows later routes otherwise).
  • .NET (showcase/packages/ms-agent-dotnet/): agent/Program.cs maps 14 AG-UI endpoints via app.MapAGUI(...). New factories: AgentConfigAgent, BeautifulChatAgent, ByocHashbrownAgent, ByocJsonRenderAgent, DeclarativeGenUiAgent, HitlInAppAgent, InterruptAgent, McpAppsAgent, MultimodalAgent, OpenGenUiAgent, OpenGenUiAdvancedAgent, ReasoningAgent, A2uiFixedSchemaAgent.
  • Runtime routes: shared /api/copilotkit for frontend-only demos that reuse the default backend; dedicated /api/copilotkit-<slug> for demos needing custom runtime config (OGUI, A2UI, BYOC, MCP apps, voice, auth, agent-config, beautiful-chat, multimodal, reasoning).

Framework-specific adaptations

  • Interrupts (gen-ui-interrupt, interrupt-headless) — MS Agent Framework has no LangGraph-equivalent interrupt() primitive. Ported via useFrontendTool async handlers with approval-mode semantics; visually equivalent, mechanism differs.
  • Reasoning — Python uses a think tool + useRenderTool substitute because the MS-AF AG-UI bridge doesn't emit native REASONING_MESSAGE_* events. .NET emits TextReasoningContent via ReasoningAgent wrapper that splits <reasoning>...</reasoning> system-prompted output.
  • A2UI / OGUI / BYOC — tool-call-based streaming where structured-output forcing wasn't a clean fit (hashbrown emits XML markup, json-render uses a discriminated-union-over-types flat map).
  • Multimodal (.NET) — relies on model-native PDF handling rather than bundling a pypdf equivalent.

PR #4271 fixes ported (both frameworks)

Six demo runtime fixes from #4271 ported to the MS Agent ports:

  1. byoc-json-render — wrap <Renderer /> with <JSONUIProvider>, forward children through MetricCard registry.
  2. byoc-hashbrown — backend system prompt rewrite from <ui>...</ui> XML to hashbrown JSON envelope {ui: [{metric: {props: {...}}}, ...]}.
  3. multimodal — LFS-pointer magic-byte guard client-side, LegacyConverterShim via onRunInitialized to rewrite modern multimodal parts to legacy binary shape, MIME routing on Python backend (image/* → native vision, application/pdf → pypdf).
  4. voice — write transcriptionService directly onto V2 runtime instance (V1 wrapper drops it). GuardedOpenAITranscriptionService throws typed auth error → runtime maps to 401 instead of silent 503.
  5. agent-config — MS Agent Framework reads forwardedProps natively (Python) / AG-UI shared state via ag_ui_state (.NET); the LangGraph bridge repack logic was N/A and not ported. Both paths already work.
  6. auth — useDemoAuth defaults to true so page mounts authenticated; button labels inverted; <CopilotChat /> wrapped in ChatErrorBoundary with auto-reset on auth flip.

Process

Test plan

  • pnpm install && pnpm dev in showcase/packages/ms-agent-python — agent server starts, all / endpoints reachable.
  • dotnet run --project agent && pnpm dev in showcase/packages/ms-agent-dotnet — Program.cs compiles, all MapAGUI endpoints serve AG-UI.
  • Click through each demo in both packages; verify no crashes on mount.
  • Flagship spot-checks: beautiful-chat (A2UI + OGUI + MCP), multimodal (image/PDF), voice (mic button + /info transcriptionEnabled), auth (signed-in default), byoc-hashbrown + byoc-json-render (renderers mount).
  • Dashboard coverage row visual — both MS Agent rows fully green.

Known limitations

  • No runtime verification was run per the blitz protocol (nx targets are not configured for these showcase packages; lefthook hooks wedge on Windows during parallel commits). Compile/build errors are possible and should be caught by Railway CI or local next build / dotnet build.
  • Several demos (mcp-apps, reasoning on .NET, multimodal PDF on .NET) depend on runtime behavior of Microsoft.Agents.AI.Hosting.AGUI.AspNetCore preview packages that may not yet emit/consume the exact AG-UI events LangGraph uses; graceful-degrade fallbacks are in place and flagged in file headers.
  • Sample binary files (public/demo-files/sample.png and sample.pdf) are not bundled in either MS Agent package; multimodal sample buttons will show actionable errors until those files are added (same behavior as langgraph-python pre-PR-fix(showcase/langgraph-python): repair six demo runtime regressions (byoc-json-render, hashbrown, multimodal, voice, agent-config, auth) #4271).

Vision-capable MS Agent Framework demo that accepts image and PDF
attachments. Mounts a dedicated /multimodal endpoint on the agent
server (gpt-4o-mini) and a dedicated /api/copilotkit-multimodal runtime
route so the vision model stays scoped to this cell. PDFs are flattened
to text via pypdf in a pre-run hook so the model can reason about them
even when the chat client does not accept the document content-part
shape. Ports the page and sample-attachment-buttons verbatim from the
LangGraph showcase.
Forward typed config (tone/expertise/responseLength) from the React provider
into the MS Agent Framework agent via AG-UI forwardedProps. A subclass of
AgentFrameworkAgent intercepts run_agent, composes a system prompt from the
props, and prepends it to the messages before delegating to the default
orchestrator chain. Scoped to its own endpoint (/agent-config) and runtime
route so the dynamic-prompt behaviour stays out of the shared agent.
Flagship MS Agent Framework showcase that combines A2UI (fixed + dynamic),
Open Generative UI, MCP Apps, shared-state todos, and HITL in a polished
sales-dashboard demo. Mounts a dedicated /beautiful-chat endpoint on the
agent server with the full tool surface (manage_todos, query_data,
search_flights, generate_a2ui) and wires a dedicated
/api/copilotkit-beautiful-chat runtime route with openGenerativeUI,
a2ui.injectA2UITool=false, and mcpApps (Excalidraw by default). Ports
the entire frontend tree verbatim from the LangGraph showcase so the
A2UI catalog, renderers, generative-ui components, hooks, and CSS stay
in parity across framework ports.
Speech-to-text transcription feeding the CopilotChat composer. A dedicated
runtime route at /api/copilotkit-voice mounts TranscriptionServiceOpenAI so
the mic button renders only for this cell; the underlying agent is the
shared MS Agent Framework backend. Ships a sample-audio button that bypasses
mic permissions by POSTing a bundled WAV to the transcription envelope.
Bearer-token gated CopilotKit runtime using the V2 runtime's onRequest hook.
The frontend toggles an in-memory auth flag and injects the matching
Authorization header via the provider's headers prop; the runtime short-
circuits requests without a valid token with a thrown 401 Response. Uses
createCopilotRuntimeHandler directly from @copilotkit/runtime/v2 so the
onRequest hook is wired (the V1 Next.js adapter does not forward hooks).
Vision-capable ChatClientAgent (gpt-4o-mini) mounted at /multimodal on the .NET backend, paired with a dedicated /api/copilotkit-multimodal Next.js runtime route and a CopilotChat page that wires AttachmentsConfig for image and PDF uploads.
Adds a visible reasoning chain demo for the Microsoft Agent Framework
backend. Because the MS Agent Framework AG-UI bridge does not currently
emit REASONING_MESSAGE_* events, reasoning is surfaced via a required
think tool: the agent calls think(thought=...) before every answer and
the frontend renders the tool call as a tagged amber reasoning block,
matching the LangGraph reference visual.

- src/agents/reasoning_agent.py: new agent with required think tool
- src/agent_server.py: mount reasoning agent at /reasoning (before root)
- src/app/api/copilotkit-reasoning/route.ts: dedicated runtime route
- src/app/demos/agentic-chat-reasoning/: page + ReasoningBlock + README
Adds the default-render counterpart to agentic-chat-reasoning. Reuses
the same /reasoning backend agent but renders the think tool call with
a minimal collapsible Thinking.../Thought-for-a-moment card that
approximates CopilotKit built-in CopilotChatReasoningMessage slot.

The LangGraph reference achieves zero-config rendering because its
backend emits AG-UI REASONING_MESSAGE_* events; MS Agent Framework
AG-UI bridge does not emit those events, so this demo ships the
closest equivalent rendering pattern.
Flagship showcase cell combining A2UI (fixed + dynamic schema), Open Generative UI, and MCP Apps on a single dedicated runtime route. The .NET agent mirrors the LangGraph reference's tool surface (query_data, get_todos, manage_todos, search_flights, generate_a2ui, get_weather) and is mounted at /beautiful-chat on the existing MS Agent Framework AG-UI backend. Frontend is a near-verbatim port of the LangGraph cell: example-layout + example-canvas + generative-ui charts, declarative A2UI catalog (definitions + renderers), and the full suite of suggestion pills spanning Controlled Generative UI, HITL, A2UI, OGUI, MCP, and shared-state todos.
Port the LangGraph Python agentic-chat-reasoning demo to the MS Agent
Framework (.NET) showcase.

- agent/ReasoningAgent.cs — DelegatingAIAgent wrapper whose inner
  ChatClientAgent is prompted to bracket its chain-of-thought in
  <reasoning>...</reasoning> tags. Streams the bracketed segment as
  TextReasoningContent (surfaced by AG-UI as REASONING_MESSAGE_*
  events) and the rest as ordinary text.
- agent/Program.cs — mounts the reasoning agent at /reasoning alongside
  the existing SalesAgent at /.
- src/app/api/copilotkit-reasoning/route.ts — dedicated runtime route
  proxying to /reasoning, shared by both reasoning demos.
- src/app/demos/agentic-chat-reasoning/{page.tsx,reasoning-block.tsx,README.md}
  — custom amber ReasoningBlock wired into the CopilotChat
  messageView.reasoningMessage slot.
Port the LangGraph Python reasoning-default-render demo to the MS Agent
Framework (.NET) showcase. Uses the shared ReasoningAgent backend
mounted at /reasoning; the page passes no custom reasoningMessage slot,
so CopilotKit renders the collapsible default Thought-for-X card.
@vercel

vercel Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment Apr 24, 2026 5:33pm
docs Ready Ready Preview, Comment Apr 24, 2026 5:33pm
form-filling Ready Ready Preview, Comment Apr 24, 2026 5:33pm
research-canvas Ready Ready Preview, Comment Apr 24, 2026 5:33pm
travel Ready Ready Preview, Comment Apr 24, 2026 5:33pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@jpr5

jpr5 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Superseded by #4280 (omnibus parity PR)

@jpr5 jpr5 closed this Apr 25, 2026
jpr5 added a commit that referenced this pull request Apr 25, 2026
…demos (#4280)

## Summary

Consolidates 13 showcase parity PRs into a single omnibus PR. Each
integration framework has been brought to near-parity with the LangGraph
Python reference (~37 demos each).

### Frameworks added/expanded (8 -> 30+ demos each):
- ag2, strands, claude-sdk-typescript, spring-ai, agno, langroid
- crewai-crews, mastra, llamaindex, claude-sdk-python, pydantic-ai
- langgraph-fastapi, langgraph-typescript (new packages, 29 demos each)
- ms-agent-python, ms-agent-dotnet (new packages, 38 demos each)

### Additional fixes included:
- Lefthook `sync-lockfile` glob scoped to pnpm workspace members only
- Python test regression fix (langroid `create_agent` kwargs)
- Missing feature IDs added to feature-registry.json
(hitl-in-chat-booking, hitl)
- Manifest highlight path fixes (langgraph-fastapi, langgraph-python,
langgraph-typescript, ms-agent-dotnet)
- Fixture tool surface validator updated for wildcard renderers
(useDefaultRenderTool)
- Constraints allowlist updated for new feature IDs
- Starters regenerated for all 17 frameworks
- fail-baseline.json ratcheted (112 -> 127) for new framework pin FAILs

### Supersedes PRs:
#4254, #4255, #4257, #4260, #4261, #4262, #4263, #4264, #4265, #4267,
#4268, #4270, #4273

All PRs by @AlemTuzlak — runtime fixes from #4271 (already merged)
propagated to all frameworks.

## Test plan
- [ ] CI green on this PR
- [ ] `pnpm dev` spot-check on 2-3 frameworks (byoc-hashbrown, voice,
auth demos)
- [ ] Dashboard cells tab shows new framework rows populated
- [ ] Feature registry validation passes
- [ ] Starters generate cleanly (`npx tsx
showcase/scripts/generate-starters.ts`)
- [ ] Registry generates cleanly (`npx tsx
showcase/scripts/generate-registry.ts`)
- [ ] Demo content bundles cleanly (`npx tsx
showcase/scripts/bundle-demo-content.ts`)
@jpr5
jpr5 deleted the worktree-sunny-floating-barto branch June 1, 2026 18:50
zeekay pushed a commit to Dream-AI-4444/CopilotKit that referenced this pull request Sep 11, 2026
…demos (CopilotKit#4280)

## Summary

Consolidates 13 showcase parity PRs into a single omnibus PR. Each
integration framework has been brought to near-parity with the LangGraph
Python reference (~37 demos each).

### Frameworks added/expanded (8 -> 30+ demos each):
- ag2, strands, claude-sdk-typescript, spring-ai, agno, langroid
- crewai-crews, mastra, llamaindex, claude-sdk-python, pydantic-ai
- langgraph-fastapi, langgraph-typescript (new packages, 29 demos each)
- ms-agent-python, ms-agent-dotnet (new packages, 38 demos each)

### Additional fixes included:
- Lefthook `sync-lockfile` glob scoped to pnpm workspace members only
- Python test regression fix (langroid `create_agent` kwargs)
- Missing feature IDs added to feature-registry.json
(hitl-in-chat-booking, hitl)
- Manifest highlight path fixes (langgraph-fastapi, langgraph-python,
langgraph-typescript, ms-agent-dotnet)
- Fixture tool surface validator updated for wildcard renderers
(useDefaultRenderTool)
- Constraints allowlist updated for new feature IDs
- Starters regenerated for all 17 frameworks
- fail-baseline.json ratcheted (112 -> 127) for new framework pin FAILs

### Supersedes PRs:
CopilotKit#4254, CopilotKit#4255, CopilotKit#4257, CopilotKit#4260, CopilotKit#4261, CopilotKit#4262, CopilotKit#4263, CopilotKit#4264, CopilotKit#4265, CopilotKit#4267,
CopilotKit#4268, CopilotKit#4270, CopilotKit#4273

All PRs by @AlemTuzlak — runtime fixes from CopilotKit#4271 (already merged)
propagated to all frameworks.

## Test plan
- [ ] CI green on this PR
- [ ] `pnpm dev` spot-check on 2-3 frameworks (byoc-hashbrown, voice,
auth demos)
- [ ] Dashboard cells tab shows new framework rows populated
- [ ] Feature registry validation passes
- [ ] Starters generate cleanly (`npx tsx
showcase/scripts/generate-starters.ts`)
- [ ] Registry generates cleanly (`npx tsx
showcase/scripts/generate-registry.ts`)
- [ ] Demo content bundles cleanly (`npx tsx
showcase/scripts/bundle-demo-content.ts`)

This branch was successfully deployed

5 active deployments
Preview – travel — 39815c63 Deployed Apr 24, 2026 by vercel[bot]
Preview – research-canvas — 39815c63 Deployed Apr 24, 2026 by vercel[bot]
Preview – docs — 39815c63 Deployed Apr 24, 2026 by vercel[bot]
Preview – form-filling — 39815c63 Deployed Apr 24, 2026 by vercel[bot]
Preview – chat-with-your-data — 39815c63 Deployed Apr 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants