Skip to content

feat(showcase/langroid): parity demos (chat chrome, frontend-tools, hitl-in-app, reasoning, readonly-context) - #4254

Closed
AlemTuzlak wants to merge 9 commits into
mainfrom
feat/showcase-langroid-parity
Closed

AlemTuzlak wants to merge 9 commits into
mainfrom
feat/showcase-langroid-parity

Conversation

@AlemTuzlak

Copy link
Copy Markdown
Contributor

Summary

Expands the Langroid showcase package toward parity with the canonical showcase/packages/langgraph-python manifest. Lands alongside parallel PRs for agno, ag2, llamaindex, and spring-ai.

Langroid's agent_server.py exposes a single unified AG-UI-over-SSE endpoint at /; every new demo registers a new agent-name in the Next.js runtime route that forwards to the same HttpAgent. Frontend demos therefore only need page.tsx plus supporting components; no new Python backend modules are introduced in this pass.

Ported (11 new demos)

Chat chrome variants:

  • chat-customization-css — scoped CSS theme
  • prebuilt-sidebar — CopilotSidebar docked chat
  • prebuilt-popup — CopilotPopup floating launcher
  • chat-slots — custom welcomeScreen + disclaimer + assistantMessage slots
  • headless-simple — hand-rolled chat on useAgent + useComponent

Frontend-tools variants:

  • frontend-tools — sync useFrontendTool handler (change_background)
  • frontend-tools-async — async handler + in-browser notes DB + NotesCard

HITL variant:

  • hitl-in-app — async frontend-tool + React portal approval dialog

Reasoning + context:

  • agentic-chat-reasoning — custom reasoningMessage slot
  • reasoning-default-render — zero-config default reasoning render
  • readonly-state-agent-context — useAgentContext for name/timezone/activity

Each demo ships a page + supporting components, a minimal Playwright smoke spec, and a QA checklist. The manifest lists every demo with its highlight files.

Skipped

  • gen-ui-interrupt, interrupt-headless — LangGraph-interrupt-specific primitive; Langroid has no equivalent in ChatAgent / Task.

Deferred

The remaining langgraph-python demos (byoc-json-render, byoc-hashbrown, beautiful-chat, multimodal, auth, voice, open-gen-ui variants, agent-config, declarative-gen-ui, a2ui-fixed-schema, mcp-apps, tool-rendering variants, headless-complete) are portable in principle but each requires a dedicated runtime route and additional backend or BYOC work beyond the unified agent. They are documented in showcase/packages/langroid/PARITY_NOTES.md for follow-up.

Reasoning note

The Langroid AG-UI adapter (src/agents/agui_adapter.py) does not currently emit REASONING_MESSAGE events, so the two reasoning demos exercise the wiring and slot registration path but will only surface a reasoning block once the adapter is extended to forward Langroid's internal thinking channel (if any). The QA docs call this out.

Test plan

  • Run npm run dev in showcase/packages/langroid and boot the Next.js app + Python agent server
  • Visit each new /demos/ID route and confirm the page renders with no console errors
  • chat-customization-css: themed user/assistant bubbles render
  • prebuilt-sidebar and prebuilt-popup: chat opens by default
  • chat-slots: custom welcome screen + disclaimer visible; assistant message wrapped in slot
  • headless-simple: asking for a card renders the ShowCard component
  • frontend-tools: background-change request mutates the background style
  • frontend-tools-async: NotesCard renders after the simulated async query
  • hitl-in-app: approval dialog opens outside chat; Approve returns to agent
  • readonly-state-agent-context: agent references name/timezone/activity in replies
  • Playwright specs pass: npm run test:e2e

Ports the chat chrome variants from langgraph-python: chat-customization-css
(scoped theme), prebuilt-sidebar, prebuilt-popup, chat-slots (welcome screen
+ disclaimer + assistant message slots), and headless-simple. All five reuse
the unified Langroid agent via agent-name dispatch in the Next.js route.
Ports the useFrontendTool variants: the sync change_background handler
plus the async query_notes handler with an in-browser notes DB and the
NotesCard render component. Both reuse the unified Langroid agent; only
frontend wiring differs.
Ports the In-App HITL variant: useFrontendTool with an async handler
that returns a Promise resolved by the operator clicking Approve or
Reject in a React portal dialog rendered outside the chat surface.
Includes tickets panel and approval dialog component.
Ports three demos: agentic-chat-reasoning (custom reasoningMessage slot),
reasoning-default-render (zero-config default render), and
readonly-state-agent-context (useAgentContext with name/timezone/activity).
Reasoning demos include a note that the Langroid AG-UI adapter does not
yet emit REASONING_MESSAGE events, so the reasoning block only renders
once the adapter is extended.
Adds the 11 newly ported demos to the manifest (chat-customization-css,
prebuilt-sidebar, prebuilt-popup, chat-slots, headless-simple,
frontend-tools, frontend-tools-async, hitl-in-app, agentic-chat-reasoning,
reasoning-default-render, readonly-state-agent-context) and their
features. Documents skipped demos (gen-ui-interrupt, interrupt-headless)
and deferred demos in PARITY_NOTES.md. Adds a typecheck script.
@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 4:52pm
docs Ready Ready Preview, Comment Apr 24, 2026 4:52pm
form-filling Ready Ready Preview, Comment Apr 24, 2026 4:52pm
research-canvas Ready Ready Preview, Comment Apr 24, 2026 4:52pm
travel Ready Ready Preview, Comment Apr 24, 2026 4:52pm

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

AlemTuzlak and others added 2 commits April 24, 2026 17:25
Ports six additional canonical demos onto the unified Langroid runtime:

- tool-rendering-default-catchall / tool-rendering-custom-catchall —
  both exercise the existing agent's tool surface with different
  wildcard renderer configurations.
- declarative-gen-ui — A2UI dynamic-schema rendering backed by the
  agent's existing generate_a2ui tool; dedicated route sets
  a2ui.injectA2UITool: false so the agent-owned tool is authoritative.
- auth — framework-native Bearer-token gate via the V2 runtime's
  onRequest hook on a dedicated /api/copilotkit-auth route.
- headless-complete — full hand-rolled chat surface built on useAgent,
  no CopilotChat.
- agent-config — typed provider properties forwarded through a
  dedicated route. Backend wiring for forwarded_props is tracked in
  PARITY_NOTES as a known limitation.

Updates manifest.yaml with feature slugs + full demo entries, adds qa
stubs and Playwright specs for every new demo, and expands
PARITY_NOTES.md with explicit deferred/skipped reasoning for the
remaining demos that require dedicated Langroid agent modules.
… from #4271

Port two runtime regressions fixed in showcase/langgraph-python's PR #4271
to the Langroid showcase.

Auth demo (frontend-only fix — matches canonical langgraph-python):
- useDemoAuth defaults to authenticated so the initial /info handshake
  succeeds; previously the unauth-first default caused /info 401 before
  onError handlers attached, producing a React tree teardown.
- Rename "Authenticate" button to "Sign in"; when authed, show "Sign out"
  (button labels match the authed/unauthed semantics instead of always
  reading "Authenticate").
- Wrap <CopilotChat /> in a ChatErrorBoundary that auto-resets on auth
  transitions so signing back in re-mounts the live chat without a full
  reload.
- Update qa/auth.md + tests/e2e/auth.spec.ts to the new authed-first
  flow with Sign out exercising the 401 path.

Agent-config demo (frontend contract + backend wiring):
- The <CopilotKitProvider properties={tone, expertise, responseLength}>
  arrives as flat top-level keys on AG-UI forwardedProps. In the
  langgraph-python showcase, the TS LangGraphAgent drops non-config
  keys from the stream payload, so upstream added a per-demo subclass
  that repacks flat keys into forwardedProps.config.configurable.properties.
- Langroid uses HttpAgent (which does preserve the full payload), but
  we mirror the same repack shape for two reasons:
    1. Identical frontend contract across every showcase package.
    2. Deterministic backend read location: the Python adapter reads
       forwarded_props.config.configurable.properties, not a flat key
       that could collide with future AG-UI protocol additions.
- api/copilotkit-agent-config/route.ts: subclass HttpAgent and override
  requestInit to repack, with the same RESERVED_FORWARDED_PROPS_KEYS
  set as upstream so structural stream keys (config/command/streamMode/...)
  pass through unchanged.
- src/agents/agent.py: add build_agent_config_system_prompt +
  extract_agent_config_properties helpers and make create_agent accept
  an optional system_message override. Unknown tone/expertise/length
  values are silently ignored rather than 500ing a turn.
- src/agents/agui_adapter.py: in handle_run, when forwarded_props
  carries agent-config properties, build the dynamic prompt and pass
  it to create_agent for that request only. Other demos send no such
  properties and get the canonical SYSTEM_PROMPT unchanged.
- qa/agent-config.md: update to document the end-to-end wiring and
  add a DevTools assertion for the repacked request shape.
- PARITY_NOTES.md: move agent-config out of "Known limitations"; the
  backend now consumes forwarded properties.

Upstream reference: #4271
@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 feat/showcase-langroid-parity branch June 1, 2026 18:49
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 — 607a0416 Deployed Apr 24, 2026 by vercel[bot]
Preview – research-canvas — 607a0416 Deployed Apr 24, 2026 by vercel[bot]
Preview – chat-with-your-data — 607a0416 Deployed Apr 24, 2026 by vercel[bot]
Preview – docs — 607a0416 Deployed Apr 24, 2026 by vercel[bot]
Preview – form-filling — 607a0416 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