fix(chat): correct generative-ui prompt — use root not rootKey#116
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
8e41469 to
65ba508
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The generative-ui system prompt instructed the LLM to produce JSON specs with
"rootKey", but@json-render/core'sSpectype expects"root".RenderSpecComponentchecksspec()?.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 expectsroot.Fix: Replace
rootKey→rootin both the source prompt and the streaming deployment copy.Verified by
<render-spec>contained<!---->(empty) becausespec()?.rootwas undefinedSpectype in render-spec.component.ts and all test fixtures useroot, notrootKeyTest plan
🤖 Generated with Claude Code