Files
copilotkit__copilotkit/showcase/integrations/langgraph-python/qa/byoc-json-render.md
Tyler Slaton ebad989855 chore(showcase/langgraph-python): manifest, runtime, e2e, cleanup
Cross-cutting changes that don't belong with any one demo: manifest +
landing-page tags, runtime route adjustments, e2e + QA notes that
follow the demo renames, and a few small cleanups.

Manifest (manifest.yaml + src/app/page.tsx tag labels):
- Naming convention: every demo uses `Thing: Subthing` (Generative UI:
  Tool Rendering - Default / Custom Default / Specific; Open Generative
  UI: Default / Advanced; Shared State: Streaming / Read + Write;
  Reasoning: Default / Custom; Frontend Tools: In-App Actions / Async;
  Human in the Loop: In-chat / In-App / Interrupt based; Chat
  Customization: CSS / Slots; Headless UI: Simple / Complete).
- Retags: Auth → `platform`; HITL Step Selection + Interrupt-based →
  `interactivity`; Reasoning Default + Custom → `chat-ui`; Generative
  UI: Tools → `generative-ui`.
- Renames: Readonly State (Agent Context) → Frontend Context Sharing.
- HITL slot points at /demos/hitl-in-chat (working
  useHumanInTheLoop+interrupt path) instead of the previous
  /demos/hitl that had no backend `interrupt()` calls.
- Highlight paths corrected for the rebuilt headless demos (root-level
  paths replaced with hooks/, chat/, tools/, attachments/ subdirs).
- Descriptions rewritten where they had drifted from the implementation
  (gen-ui-agent: dropped useCoAgentStateRender claim;
  headless-simple: shadcn primitives, not raw Tailwind;
  headless-complete: enumerates the actual hooks wired).

Runtime / route:
- src/app/api/copilotkit/route.ts — 30 agents registered (incl. the
  reasoning-custom rename from agentic-chat-reasoning).
- copilotkit-mcp-apps/route.ts replaced with [[...slug]]/route.ts so v2
  subpath POSTs (/v2/agent/run) resolve.
- src/app/api/copilotkit-voice/[[...slug]]/route.ts — env var standardized
  (was `AGENT_URL || LANGGRAPH_DEPLOYMENT_URL`, now matches the rest
  of the showcase with just LANGGRAPH_DEPLOYMENT_URL); trailing `/`
  removed from deploymentUrl.

Tests / QA:
- e2e specs renamed and paths updated for the demo renames.
- qa notes for a2ui-fixed-schema (booked-state checklist removed) and
  byoc-json-render (Wave 4a residue removed).
- docs-links.json key renamed for reasoning-custom.

Cleanup:
- Removed remaining stub agent.py files in demo dirs (real graphs in
  src/agents/); removed dead beautiful-chat/components/headless-chat.tsx
  (zero importers); removed [A2UI-DEBUG] / [A2UI-RESPONSE] print
  statements from beautiful_chat.py; gpt-5.4-mini → gpt-5-mini typo
  fix in beautiful_chat.py:249 (would have 4xx'd every model call);
  stripped iframe-restriction LLM-prompt copy bleed from
  open-gen-ui-advanced suggestion titles.

The convention pass that ran across ~28 demos earlier in this branch is
already reflected in their per-demo commits — every page.tsx reads as
imports + provider + suggestions hook + JSX, with `useConfigureSuggestions`
extracted to a sibling suggestions.ts.
2026-05-06 23:19:57 -07:00

57 lines
2.4 KiB
Markdown

# QA: BYOC json-render — LangGraph (Python)
## Prerequisites
- Demo deployed at `/demos/byoc-json-render`.
- Railway backend healthy (`showcase-langgraph-python-production.up.railway.app`).
- `OPENAI_API_KEY` and `LANGGRAPH_DEPLOYMENT_URL` configured on the Next.js app.
- `@json-render/core` + `@json-render/react` present in `package.json` (pinned to `0.18.0`).
- `byoc_json_render` graph registered in `langgraph.json`.
## Test Steps
### 1. Page load
- [ ] Navigate to `/demos/byoc-json-render`.
- [ ] Chat composer is visible.
- [ ] Three suggestion pills appear with titles: "Sales dashboard", "Revenue by category", "Expense trend".
- [ ] No console errors.
### 2. Sales dashboard suggestion
- [ ] Click the "Sales dashboard" suggestion.
- [ ] Within 60 seconds, a `data-testid="json-render-root"` wrapper appears in the assistant bubble.
- [ ] A `data-testid="metric-card"` renders inside the wrapper.
- [ ] A chart (`data-testid="bar-chart"` or `data-testid="pie-chart"`) renders inside the wrapper.
- [ ] No raw JSON text is shown once rendering finishes — the streaming JSON is replaced by components.
### 3. Revenue by category
- [ ] Click the "Revenue by category" suggestion.
- [ ] Within 60 seconds, a `data-testid="pie-chart"` renders with multiple category slices + legend.
### 4. Expense trend
- [ ] Click the "Expense trend" suggestion.
- [ ] Within 60 seconds, a `data-testid="bar-chart"` renders with month labels.
### 5. Free-form prompt
- [ ] Type "Show me a metric for quarterly revenue" and send.
- [ ] Verify at least one `metric-card` renders; no console errors.
### 6. Multi-turn
- [ ] After a previous render is visible, send a follow-up prompt ("Now break that down by region").
- [ ] A new assistant message appears with a new json-render rendering — prior renders stay in the transcript.
### 7. Malformed output handling
- [ ] If the agent ever replies with non-JSON text (force it by asking "tell me a joke"), the chat falls back to rendering that raw text via the default assistant bubble. No crash, no stuck spinner.
## Expected Results
- Suggestion renders land within 60 seconds. Budget is slightly higher than the hashbrown demo because a JSON `{ root, elements }` spec is more verbose than hashbrown's token stream.
- No uncaught errors in the console.
- Streaming falls back to plain text until the JSON parses, then swaps to rendered components.