mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
ccc2eabfc2
Three classes of regression are now pinned: 1. Secondary-LLM tool name doesn't collide with the A2UI middleware's default intercept list (`render_a2ui`). New `src/agents/test_a2ui_internal_tools.py` parametrises over `beautiful_chat._design_a2ui_surface`, `a2ui_dynamic._design_a2ui_surface`, and `a2ui_fixed.display_flight` and asserts none match the middleware's `a2uiToolNames` default. Catches accidental rename reverts that would re-enable the bypass. 2. `generate_a2ui` force-pins the canonical `catalog_id` even when the secondary LLM hallucinates a wrong one. The new test stubs `ChatOpenAI` with a fake response carrying a bogus catalogId and asserts the surface op carries the module's `CUSTOM_CATALOG_ID`. 3. `generate_a2ui` short-circuits with a clean error string when the LLM emits a root component without a `component` field — never feeds the renderer the partial tree that surfaced as the "Cannot create component root without a type" infinite-loop. 7 unit tests, all green locally (`pytest src/agents/test_a2ui_internal_tools.py`). E2E tests on the same fixes now also assert: - No `A2UI render error: Catalog not found` banner on the page after Beautiful Chat → Sales Dashboard, Declarative Gen UI → BarChart, and A2UI Fixed Schema → Find SFO → JFK round-trips. - No `Cannot create component … without a type` banner on the same three pills. - Exactly ONE flight card on A2UI Fixed Schema (was 6+ on deploy pre-fix from the `display_flight` loop) — `Flight Details` count pinned to 1, `Book flight` count pinned to 1. - At most one ResponsiveContainer on the BarChart pill (loops would stack multiple). - At most two ResponsiveContainers on Beautiful Chat → Sales Dashboard (one pie + one bar = single dashboard render).
4.6 KiB
4.6 KiB