test: drive the non-text message-part rejection 400 path (#63) #103

Closed
opened 2026-06-21 05:05:38 +03:00 by Ghost · 0 comments

PR #101 (commit 2b4ec0bf, closes #63) made the anonymous share-chat funnel reject any message containing a non-text part: apps/server/src/core/ai-chat/public-share-chat.controller.ts:295 throw new HttpException('Unsupported message content', 400) — a size-cap-bypass guard.

Gap: the 400 path is never driven. The string appears in no spec, though the funnel is already fully test-harnessed.

Needed: in the controller funnel spec, add a case with messages:[{ role:'user', parts:[{type:'tool-call'}] }] asserting status 400; plus a message mixing a text and a non-text part still 400s (rejected before the 413 size check).

Found in code review of PR #101.

PR #101 (commit 2b4ec0bf, closes #63) made the anonymous share-chat funnel reject any message containing a non-text part: apps/server/src/core/ai-chat/public-share-chat.controller.ts:295 `throw new HttpException('Unsupported message content', 400)` — a size-cap-bypass guard. **Gap:** the 400 path is never driven. The string appears in no spec, though the funnel is already fully test-harnessed. **Needed:** in the controller funnel spec, add a case with `messages:[{ role:'user', parts:[{type:'tool-call'}] }]` asserting status 400; plus a message mixing a text and a non-text part still 400s (rejected before the 413 size check). _Found in code review of PR #101._
Ghost added the testsecurity labels 2026-06-21 05:05:38 +03:00
Ghost closed this issue 2026-06-21 14:10:35 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#103