Commit c67ac60
authored
fix(chat): empty assistant bubble for plain LLM responses (#290)
@cacheplane/partial-markdown@0.3 does not flush trailing text on
finish() unless the buffer ends with a newline. Plain LLM responses
typically omit the trailing newline, so the parser produced a document
with zero children — the assistant bubble shell rendered but the
message text was missing entirely.
Reproduce on main: send 'Say hello in one sentence.' to gpt-5-mini.
Backend logs show success (1.8s); agent.messages() carries 'Hello — nice
to meet you!'; the DOM shows the bubble structure (checkpoint marker,
action buttons) but no text.
Fix: push a sentinel newline before calling finish() in both branches
of the root() computed (content-changed-then-flush and streaming-flipped-
without-new-content). The newline only ever exists inside the parser
buffer; the original content() signal is unchanged.
Two new regression tests cover plain text without trailing newline in
both branches.
Found while walking the smoke checklist post-#288.1 parent f6a61e6 commit c67ac60
2 files changed
Lines changed: 36 additions & 0 deletions
File tree
- libs/chat/src/lib/streaming
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
76 | 104 | | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
0 commit comments