Repository navigation
feat(showcase/crewai-crews): bring CrewAI Crews to full parity with LangGraph Python showcase - #4262
AlemTuzlak wants to merge 10 commits into
Conversation
…th LangGraph Python Ports 18 demos covering chrome (prebuilt-sidebar/popup, chat-slots, chat-customization-css, headless-simple/complete), reasoning (agentic-chat-reasoning, reasoning-default-render), tool rendering (default/custom catchall, reasoning-chain), frontend-tools and frontend-tools-async, hitl-in-chat and hitl-in-app, readonly-state-agent-context, agent-config, open-gen-ui and open-gen-ui-advanced. Adds dedicated runtime routes for agent-config properties forwarding and ogui sandbox generative UI. Updates manifest, home page, QA stubs, Playwright smoke specs. PARITY_NOTES.md documents skipped and deferred demos.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
…+ agent-config backend wiring Ports three runtime-layer LangGraph-Python demos to CrewAI Crews and fixes the wave-1 agent-config cell to actually read forwarded properties. Ported demos (Wave 2): - auth: framework-native bearer-token gate via the V2 runtime's onRequest hook, wired through createCopilotRuntimeHandler (the V1 Next.js adapter does not forward hooks to V2). The page mounts authenticated by default so the initial /info handshake succeeds; clicking Sign out exercises the 401 path. A local ChatErrorBoundary guards the chat so the page never white-screens after sign-out. - voice: TranscriptionServiceOpenAI mounted on a per-demo runtime so only this cell advertises audioFileTranscriptionEnabled:true and renders the composer mic button. The runtime + OpenAI client are constructed lazily on first request so the Docker build succeeds without OPENAI_API_KEY. A GuardedOpenAITranscriptionService wraps the OpenAI service and returns a deterministic auth-error path (mapped to HTTP 401 AUTH_FAILED by the runtime categorizer) when the key is missing, instead of an opaque 503. The transcription service is written onto the V2 runtime instance directly because the V1 CopilotRuntime wrapper drops transcriptionService on the floor. - multimodal: image + PDF uploads via AttachmentsConfig on a dedicated runtime route. The sample-attachment buttons reject Git LFS pointer stubs and validate PNG/PDF magic bytes before feeding files into the queue, surfacing an actionable error (run git lfs pull) instead of silently producing a broken thumbnail. A LegacyConverterShim installs an onRunInitialized subscriber that rewrites outgoing user-message image/document/audio/video parts from the modern source-based AG-UI shape to the legacy binary shape some downstream converters still require. The rewrite is idempotent on already-legacy parts. Wave-1 fix: agent-config backend wiring. Wave 1 shipped agent-config forwarding tone/expertise/responseLength via CopilotKitProvider properties, but the shared CrewAI crew ignored them: the upstream ag_ui_crewai.endpoint.crewai_prepare_inputs helper threads only state/messages/tools into ChatWithCrewFlow and drops forwardedProps. This commit adds a FastAPI middleware (ForwardedPropsMiddleware in src/agent_server.py) that intercepts POSTs carrying forwardedProps with tone/expertise/responseLength, composes a plain-English style guide matching the three-axis rulebook from the LangGraph-Python reference, splices it into state.inputs, and replays the rewritten body into the ASGI receive queue. The crew chat flow already appends state inputs to its system prompt verbatim, so the agent now sees the style rules on every turn and the response style actually changes as the user flips the selectors. Non-agent-config requests pass through byte-identical. Deferred (per-demo backend work, not cosmetic facades): - beautiful-chat, byoc-hashbrown, byoc-json-render, declarative-gen-ui, a2ui-fixed-schema -- each needs a dedicated CrewAI crew with catalog-aware system prompts (hashbrown JSON envelope, json-render spec, A2UI dynamic/fixed schemas). Tracked in PARITY_NOTES.md. Verification: - Python: ast.parse on agent_server.py succeeds. - TypeScript: pre-existing module-resolution errors on this branch (next, @ag-ui/client, @playwright/test -- deps not installed in the local worktree yet) are untouched; no new errors introduced by the ported routes, pages, or the V2 transcription wiring. Wave 2 brings CrewAI Crews coverage to ~84% of the LangGraph-Python feature matrix.
Wave 2 + PR #4271 fixes — CrewAI CrewsSTATUS: wave 2 partially shipped, all in-scope PR #4271 fixes applied, Task B backend wiring verified end-to-end. DEMOS_PORTEDThree runtime-layer demos ported with PR #4271 fixes baked in:
DEMOS_DEFERRED (5)
TASK B: agent-config backend wiring (verified end-to-end, not cosmetic)Wave 1 forwarded This commit adds Non-agent-config requests pass through byte-identical (middleware only mutates bodies carrying those keys). This is the CrewAI equivalent of the LangGraph fix that repacks FIXES_APPLIED (PR #4271)
TESTS
CONCERNS
PR #4262 comment URL(to be appended after posting) |
…ed crew Ships the A2UI Dynamic-Schema (Declarative Generative UI) demo against a dedicated CrewAI crew mounted at /declarative-gen-ui on the FastAPI agent server. The shared crew stays on / and is untouched. Architecture: - New DeclarativeGenUI crew (src/agents/declarative_gen_ui.py) binds the existing GenerateA2uiTool with an A2UI-tuned backstory so the chat LLM calls generate_a2ui whenever a visual would help. - Shared _chat_flow_helpers.preseed_system_prompt avoids the secondary AI description calls in ag_ui_crewai at construction time and installs our crew description into the cache so build_system_message embeds it verbatim. - Dedicated route /api/copilotkit-declarative-gen-ui with injectA2UITool: false so the backend crew owns the tool slot. - Frontend catalog (Card / StatusBadge / Metric / InfoRow / PrimaryButton / PieChart / BarChart) ported verbatim from langgraph-python.
…d crew Ships the A2UI fixed-schema (Declarative Generative UI) demo against a dedicated CrewAI crew mounted at /a2ui-fixed-schema on the FastAPI agent server. Architecture: - New A2UIFixedSchema crew (src/agents/a2ui_fixed.py) binds a DisplayFlightTool that loads a2ui_schemas/flight_schema.json at import time and returns an a2ui_operations container referencing it plus the per-trip data the LLM supplies. - Flight + booked schemas ported verbatim from langgraph-python. - Dedicated route /api/copilotkit-a2ui-fixed-schema with injectA2UITool: false. - Frontend catalog (Title / Airport / Arrow / AirlineBadge / PriceTag / ActionButton) ported verbatim from langgraph-python.
Ships the BYOC (Hashbrown) demo against a dedicated CrewAI crew mounted at /byoc-hashbrown on the FastAPI agent server. Architecture: - New ByocHashbrown crew (src/agents/byoc_hashbrown_agent.py) carries a hashbrown-JSON-envelope system prompt (matches PR #4271 fix #2 wire format: schema shape { ui: [{ componentName: { props: ... } }] } NOT the XML <ui> DSL that hashbrown uses internally for hashbrown-driven LLMs). - Uses install_custom_system_message to bypass ChatWithCrewFlow's platform boilerplate - without the override the stock prompt tells the LLM to introduce itself and ask for clarifying inputs, which actively fights JSON-only output. - Frontend (page + HashBrownDashboard + MetricCard + PieChart + BarChart + DealCard + suggestions) ported verbatim from langgraph-python. The @hashbrownai/react useJsonParser + useUiKit path works identically regardless of which backend produces the JSON.
… crew
Ships the BYOC (json-render) demo against a dedicated CrewAI crew mounted
at /byoc-json-render on the FastAPI agent server.
Architecture:
- New ByocJsonRender crew (src/agents/byoc_json_render_agent.py) carries
a flat {root, elements} JSON schema system prompt with worked examples.
- Uses install_custom_system_message to bypass ChatWithCrewFlow platform
boilerplate so the chat LLM emits pure JSON.
- Frontend ported from langgraph-python with the PR #4271 fixes applied:
* registry.tsx forwards children through the MetricCard wrapper so
multi-component dashboards (metric + nested chart) render together.
* json-render-renderer.tsx wraps Renderer in JSONUIProvider so the
StateProvider / VisibilityProvider / ActionProvider / ValidationProvider
contexts are available - without this wrap, clicking a suggestion
crashes with 'useVisibility must be used within a VisibilityProvider'.
Ships the flagship Beautiful Chat showcase against a dedicated CrewAI crew mounted at /beautiful-chat on the FastAPI agent server, and rewrites PARITY_NOTES.md to reflect that all five Wave-3 demos are now ported end-to-end. Architecture: - New BeautifulChat crew (src/agents/beautiful_chat.py) binds the shared GenerateA2uiTool / QueryDataTool / SearchFlightsTool / ScheduleMeetingTool / GetWeatherTool plus a new ManageTodosTool for the shared-state todo surface. - Dedicated runtime /api/copilotkit-beautiful-chat with openGenerativeUI + a2ui.injectA2UITool: false. - Frontend (ExampleLayout + ExampleCanvas + brand charts + A2UI catalog + todos) ported verbatim from langgraph-python. Deviations from the LangGraph reference, documented in PARITY_NOTES.md: - Excalidraw MCP suggestion pill removed: ag-ui-crewai has no MCP multiplexer and CrewAI uses Pydantic BaseTool lists. - Shared-state todos simplified: CrewAI has no LangGraph Command state-patch equivalent, so manage_todos returns the new list as a tool result the frontend reads via existing useCoAgent wiring. PARITY_NOTES: all 5 deferred demos are now in the Wave 3 ports table. Only the three architectural skips (gen-ui-interrupt, interrupt-headless, mcp-apps) remain outside the ported set.
Wave 3: 5 dedicated-crew demos shippedFive demos that previously required dedicated per-demo backend work are now
Each demo ships with a page, dedicated System-prompt control helpers
PR #4271 fixes appliedThe
The
|
|
Superseded by #4280 (omnibus parity PR) |
…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`)
…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`)
Summary
Brings the CrewAI (Crews) showcase package to near-full parity with the LangGraph-Python reference, porting 18 new demos on top of the existing 9. Total CrewAI Crews demos are now 26/37 (~70% of the LangGraph-Python feature matrix).
Ported demos
Chrome / headless:
prebuilt-sidebar— docked<CopilotSidebar />prebuilt-popup— floating<CopilotPopup />chat-slots—welcomeScreen/input.disclaimer/messageView.assistantMessageoverrideschat-customization-css— scoped CSS variable themingheadless-simple—useAgent+useComponentheadless-complete— fully custom message view, bubbles, input bar, composed from low-level rendering hooksReasoning:
agentic-chat-reasoning— customreasoningMessageslotreasoning-default-render— built-inCopilotChatReasoningMessageTool rendering:
tool-rendering-default-catchall— built-in default tool cardtool-rendering-custom-catchall— branded wildcard renderertool-rendering-reasoning-chain— per-tool weather / flight cards + reasoningFrontend tools & HITL:
frontend-tools— syncuseFrontendToolfrontend-tools-async— asyncuseFrontendToolhitl-in-chat—useHumanInTheLooptime pickerhitl-in-app—useFrontendTool+ portal modal outside the chatContext / config:
readonly-state-agent-context—useAgentContextagent-config— typed config object forwarded throughCopilotKitProvider propertiesOpen generative UI:
open-gen-ui— sandboxed-iframe visualization promptsopen-gen-ui-advanced— sandbox ↔ host function bridge viaWebsandbox.connection.remoteInfrastructure
/api/copilotkitroute (single CrewAI crew serves every registered name viaHttpAgent, matching the existing pattern)/api/copilotkit-agent-configforCopilotKitProvider propertiesforwarding/api/copilotkit-oguiwithopenGenerativeUImiddleware enabled for the open-gen-ui pairmanifest.yamlwith 26 demo entriesqa/for every new demotests/e2e/for every new demoSkipped / deferred
See
showcase/packages/crewai-crews/PARITY_NOTES.mdfor the full list. Short version:Skipped — architectural:
gen-ui-interrupt,interrupt-headless(LangGraph-interrupt-specific),mcp-apps(LangGraph MCP middleware)Deferred to follow-up PRs:
beautiful-chat,voice,multimodal,auth,byoc-hashbrown,byoc-json-render,declarative-gen-ui,a2ui-fixed-schema. Each requires a dedicated tuned crew + runtime endpoint pair; deferring until the base parity lands so the review surface stays manageable.Related parallel PRs
This is part of a blitz dispatch to bring Mastra, AWS Strands, and CrewAI Crews to parity with LangGraph-Python. Parallel PRs are open for the other two.
Test plan
pnpm --filter @copilotkit/showcase-crewai-crews devboots both the Next.js frontend and the CrewAI agent serverPARITY_NOTES.mdaccurately reflects what is shipped, skipped, and deferred