Commit f53195b
committed
Keep malformed provider objects out of chat bubbles
The AI response normalizer handled valid fenced JSON but still displayed malformed object-shaped provider output such as {content:"..."}. Treat malformed brace-prefixed machine output as invalid while preserving human bracket-prefixed chat text.
Constraint: Chat bubbles render generated content directly after server normalization.
Rejected: Try to recover text from malformed object syntax | that risks inventing parser behavior for invalid machine output; safe fallback is preferable.
Confidence: high
Scope-risk: narrow
Directive: Provider output that looks like a machine container must normalize to plain text or be rejected before generated=true.
Tested: python3 -m py_compile scripts/check_repository.py; python3 scripts/check_repository.py; npm run verify; npm audit --omit=dev; git diff --check
Not-tested: Live DeepSeek malformed object output frequency.1 parent d227376 commit f53195b
3 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
205 | 213 | | |
206 | 214 | | |
207 | 215 | | |
| |||
371 | 379 | | |
372 | 380 | | |
373 | 381 | | |
| 382 | + | |
374 | 383 | | |
375 | 384 | | |
376 | 385 | | |
| |||
0 commit comments