puter icon indicating copy to clipboard operation
puter copied to clipboard

[Tests] Add unit tests for OpenAIUtil shape normalization

Open Salazareo opened this issue 6 months ago • 0 comments

The chat provider stack funnels everything through src/backend/drivers/ai-chat/utils/OpenAIUtil.js, which normalizes Puter messages to OpenAI shape (image_url/video_url inference, tool_use coercion from Anthropic format, multi-part content). It has zero unit tests despite being on the hot path for every chat provider. Add tests covering text-only, image, video, tool_use, multi-turn, and edge cases (empty content, missing roles).

Salazareo avatar May 08 '26 00:05 Salazareo