Skip to content

fix(chat): correct generative-ui prompt — use root not rootKey#116

Merged
blove merged 1 commit into
mainfrom
claude/condescending-sanderson
Apr 12, 2026
Merged

fix(chat): correct generative-ui prompt — use root not rootKey#116
blove merged 1 commit into
mainfrom
claude/condescending-sanderson

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Apr 12, 2026

Summary

The generative-ui system prompt instructed the LLM to produce JSON specs with "rootKey", but @json-render/core's Spec type expects "root". RenderSpecComponent checks spec()?.root (line 50), so all LLM-generated specs silently failed to render — the <render-spec> component existed in the DOM with height 0px.

Root cause: Prompt schema mismatch. The prompt said rootKey, the renderer expects root.
Fix: Replace rootKeyroot in both the source prompt and the streaming deployment copy.

Verified by

  • Inspected production DOM: <render-spec> contained <!----> (empty) because spec()?.root was undefined
  • Network showed 200 responses with valid JSON — the backend is working correctly
  • The Spec type in render-spec.component.ts and all test fixtures use root, not rootKey

Test plan

  • After deploy: send "Show me weather for London" → should render weather_card component
  • After deploy: send "Show me stats" → should render stat_card components

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment Apr 12, 2026 3:34am

Request Review

The generative-ui system prompt instructed the LLM to produce JSON
specs with a "rootKey" field, but the @json-render/core Spec type
expects "root". RenderSpecComponent checks `spec()?.root` (line 50),
so all LLM-generated specs silently failed to render.

Fix: replace all occurrences of "rootKey" with "root" in the prompt.
Updated both the source and the streaming deployment copy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@blove blove force-pushed the claude/condescending-sanderson branch from 8e41469 to 65ba508 Compare April 12, 2026 03:32
@blove blove merged commit 237ddc3 into main Apr 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant