Repository navigation
feat(showcase/claude-sdk-python): bring closer to parity with langgraph-python (frontend-only demos) - #4268
feat(showcase/claude-sdk-python): bring closer to parity with langgraph-python (frontend-only demos)#4268AlemTuzlak wants to merge 18 commits into
Conversation
|
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.
|
Follow-up pass (B2') — closing the parity gapAdding 9 more demos on top of the initial B2 set, bringing this package from 6 ported demos to 15: New demos
Skipped — documented honestly in
Verification
Each demo got a |
…om catchall demos
…NUIProvider fix) Ports the BYOC json-render demo from langgraph-python. The agent emits a flat JSON element map that @json-render/react renders against a Zod catalog (MetricCard, BarChart, PieChart). Bakes in the post-#4271 fixes: <Renderer /> is wrapped in <JSONUIProvider> so the VisibilityProvider / ActionProvider / ValidationProvider contexts are set up, and the MetricCard registry entry forwards children through so multi-component dashboards render as one wrapped block. Also introduces the shared plumbing the next five demos reuse: - agents/agent.py run_agent() accepts system_prompt_override, disable_tools, and preprocess_user_parts kwargs. - agent_server.py mounts dedicated /byoc-json-render (and will mount /byoc-hashbrown, /multimodal, /agent-config in follow-up commits). - package.json gains @json-render/core, @json-render/react, @copilotkit/voice, openai; zod bumped to ^4 to satisfy @json-render/core's peer. - requirements.txt adds pypdf for the multimodal demo.
…ope prompt)
Ports byoc-hashbrown from langgraph-python. The Python agent emits the
hashbrown JSON envelope `{ui: [{tagName: {props: {...}}}, ...]}` — NOT
the XML-style <ui>...</ui> syntax which is only hashbrown's prompt DSL.
This is the core #4271 fix baked into the Claude Agent SDK port.
Dedicated endpoint /byoc-hashbrown on the agent server swaps in the
hashbrown system prompt and disables tools (model must reply as pure
JSON).
Frontend uses @hashbrownai/react's useJsonParser + useUiKit with the
same MetricCard / PieChart / BarChart / DealCard / Markdown kit as the
langgraph-python reference.
…chments) Ports the multimodal attachments demo. Claude's Messages API supports image content parts natively, so images become Claude image blocks (base64 inline) and PDFs are flattened to text via pypdf for a provider-agnostic, self-contained demo. Dedicated endpoint /multimodal on the agent server swaps in the vision-oriented system prompt and runs a preprocess_user_parts function that translates AG-UI image/document parts into Claude's shape. Importantly, the Claude port does NOT need the legacy-binary onRunInitialized shim the langgraph-python reference installs. That shim exists solely to work around the @ag-ui/[email protected] converter silently dropping modern multimodal parts. HttpAgent forwards the modern parts to the Claude Agent SDK backend unchanged, so the backend can consume them directly. Frontend preserves the LFS-pointer guard and sample injection pipeline from the reference so the bundled sample.png / sample.pdf behaviour is identical across packages.
…on service) Ports the voice input demo. No Python changes — voice is an input- modality concern handled entirely by the Next.js runtime, and the underlying agent is the same neutral shared Claude backend used by other chat demos. The dedicated /api/copilotkit-voice route mounts a GuardedOpenAITranscriptionService onto the V2 runtime instance directly (writing through .instance to bypass the V1 wrapper's silent drop of transcriptionService) and, when OPENAI_API_KEY is missing, throws an error containing "api key" so the runtime's error categorizer maps it to AUTH_FAILED → HTTP 401 instead of a silent 503. Also exports GET = POST so the V2 runtime client's /info probe fails cleanly (falling back to single-route POST) instead of logging a 405 as a server error.
…ps routing) Ports the Agent Config Object demo. Dedicated /agent-config endpoint on the agent server reads tone / expertise / responseLength off forwarded_props.config.configurable.properties (with a fallback to top-level keys for resilience) and composes the system prompt per turn before invoking Claude. The Next.js route subclasses HttpAgent to repack provider `properties` (which arrive as top-level keys on forwardedProps) into the nested `forwardedProps.config.configurable.properties` shape — matching the langgraph-python reference's wire format exactly, so the Playwright specs and debugging lore stay framework-agnostic. Frontend copies the ConfigCard / useAgentConfig hook verbatim from the reference; only the runtime URL and agent id change.
… boundary) Ports the authentication demo. The dedicated /api/copilotkit-auth route uses createCopilotRuntimeHandler from @copilotkit/runtime/v2 directly (not the V1 Next.js adapter, which does NOT forward hooks) so the onRequest hook actually fires. Mismatched bearer tokens throw a Response that short-circuits the pipeline at 401. Backend is the neutral shared Claude agent — the point of this demo is the gate mechanism, not per-user agent branching. Frontend mirrors the post-#4271 UX: useDemoAuth defaults to signed in (so the initial /info handshake succeeds and the chat is immediately usable), a ChatErrorBoundary guards against render-time crashes from chat internals during auth transitions, and the Sign in / Sign out button labels are correct.
… demos Documents the six new demos ported in this batch (byoc-json-render, byoc-hashbrown, multimodal, voice, agent-config, auth) and registers them in manifest.yaml with full highlight paths so the showcase dashboard surfaces them alongside the existing rows.
B2'' — post-#4271 demos ported to claude-sdk-pythonPorts the six new reference demos introduced by #4271 onto the Claude Agent SDK (Python) showcase package. The rebase pulled the post-#4271 langgraph-python versions into this branch, and those fixed versions were used as the template so PR #4271 fixes are baked in. Demos ported
Shared plumbing introduced
Verification
PARITY_NOTES updatedNew Deferred demos from B2'The four previously-deferred demos ( |
|
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
showcase/packages/claude-sdk-python/closer to feature parity withshowcase/packages/langgraph-python/by porting the frontend-only demos that run against the shared default Claude agent. Additional demos that require new agent-side plumbing (extended thinking streams, langgraph interrupt primitive, MCP client, A2UI catalogs, reasoning chains, etc.) are deferred and documented inPARITY_NOTES.md.Lands alongside parallel PRs for
pydantic-aiandclaude-sdk-typescript.Ported
cli-start— manifest-only entry with the framework-slug init command.prebuilt-sidebar— default<CopilotSidebar />over the shared agent.prebuilt-popup— default<CopilotPopup />over the shared agent.chat-slots—welcomeScreen/input.disclaimer/messageView.assistantMessageslot overrides.chat-customization-css— scoped CSS variable + class overrides.headless-simple—useAgent+useComponentminimal custom chat surface.Each port ships:
src/app/demos/<id>/(page + any supporting components)manifest.yamlentry in bothfeatures:anddemos:(withhighlight:paths matching the langgraph-python shape).qa/<id>.md— QA checklist pattern-matched to existing claude-sdk-python QA files.tests/e2e/<id>.spec.ts— minimal Playwright specs that navigate to the route and assert the page renders.src/app/api/copilotkit/route.tsregisters the five new agent ids against the sharedHttpAgent.Skipped (documented in
PARITY_NOTES.md)gen-ui-interrupt,interrupt-headless— require LangGraph'sinterrupt()primitive; Claude Agent SDK has no equivalent graph-interrupt primitive.agentic-chat-reasoning,reasoning-default-render,tool-rendering-reasoning-chain— require streaming Claude extended-thinking content blocks as separate AG-UI parts; the existingagents/agent.pyAG-UI bridge does not translatethinkingblocks.mcp-apps— MCP client + dedicated runtime route; agent-side MCP glue out of scope for this pass.declarative-gen-ui,a2ui-fixed-schema— A2UI catalog plus agent-siderender_a2uiwiring. Deferred to an A2UI follow-up.beautiful-chat— 28 supporting files (layout, canvas, chart gen UI, hooks, theme CSS). Skeleton to be added in a follow-up.frontend-tools,frontend-tools-async,hitl-in-app,readonly-state-agent-context,open-gen-ui,open-gen-ui-advanced,tool-rendering-default-catchall,tool-rendering-custom-catchall,headless-complete— deferred per PARITY_NOTES.md (each needs a dedicated demo agent and/or multi-file frontend surface).Test plan
pnpm typecheck/next buildpasses atshowcase/packages/claude-sdk-python(local environment produced broken node_modules symlinks on Windows during this pass — see CONCERNS).