mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
3486944356
## What & why [OSS-137](https://linear.app/copilotkit/issue/OSS-137/controlled-gen-ui-demo-optimize-2nd-suggestion-prompt-rename-sidebar) — the **Controlled Generative UI** demo (`gen-ui-tool-based`) had two issues, scoped here to **LangGraph-Python** and **Google ADK** (per the ticket; other 16 integrations roll out later). ### 1. 2nd suggestion didn't reliably render UI The "Traffic pie chart" chip (`"Show me a pie chart of website traffic by source."`) names a subject but supplies no numbers, so the agent **asked the user for data** instead of rendering a chart. **Fix:** a system-prompt directive (both LGP + ADK agents) instructing the agent to invent plausible illustrative sample values, call `render_*` immediately, and **never** reply with a clarifying question. The suggestion copy stays clean — behavior is carried by the system prompt, not by leaking "(use sample data)" hints into the UI. ### 2. Sidebar tag → product language Retagged the demo from `generative-ui` → `controlled-generative-ui` (LGP + ADK), so the dojo sidebar pill reads **"Controlled Generative UI"** — the established taxonomy already used in `shared/feature-registry.json` and the dashboard catalog. ## Tests Added D5 aimock fixture entries mirroring all three suggestion chips (bar / traffic-pie / market-share) so the suggestion-click path has deterministic coverage. The existing `"revenue by category"` probe message is **preserved**, so the [dashboard](https://dashboard.showcase.copilotkit.ai/#matrix:links,health) D5 row for the edited row stays green. ## Acceptance check - [x] 2nd suggestion renders UI without asking for data (system-prompt directive; verified locally against the live agent) - [x] Sidebar entry tagged "Controlled Generative UI" - [x] Sample/hallucinated data supplied via system prompt - [x] Scoped to LGP + ADK - [x] Tests augmented (D5 fixtures for every chip) - [x] D5 still shown for the edited row (probe message unchanged) ## Out of scope (left out deliberately) `package-lock.json` churn from a local reinstall (un-pins `latest`) was **not** committed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)