Skip to content

fix(chat): add trailing newline to a2ui JSONL for parser compatibility#122

Merged
blove merged 1 commit into
mainfrom
fix/a2ui-trailing-newline
Apr 12, 2026
Merged

fix(chat): add trailing newline to a2ui JSONL for parser compatibility#122
blove merged 1 commit into
mainfrom
fix/a2ui-trailing-newline

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Apr 12, 2026

Summary

The A2UI parser is line-based — it buffers content and processes at \n boundaries. The hardcoded JSONL ended without a trailing newline, leaving the updateComponents message (the last line) permanently stuck in the parser buffer. The surface was created but had zero components, so surfaceToSpec() returned null and the form never rendered.

Root cause: "\n".join([...]) produces no trailing \n after the last element.
Fix: Append + "\n" after the join.

Verified via Chrome DOM inspection: a2ui-surface existed in DOM with <!----> (empty) because render-spec never received a spec — surfaceToSpec returned null due to missing root component.

🤖 Generated with Claude Code

The A2UI message parser is line-based — it processes complete lines at
\n boundaries. The hardcoded CONTACT_FORM_JSONL ended without a
trailing newline, leaving the last line (updateComponents) in the
parser buffer unprocessed. The surface was created with no components,
causing surfaceToSpec() to return null and nothing to render.

Fix: append "\n" after the joined JSONL string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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 9:32pm

Request Review

@blove blove merged commit 8d74b2b into main Apr 12, 2026
14 checks passed
@blove blove deleted the fix/a2ui-trailing-newline branch April 17, 2026 17:25
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