Repository navigation
12.9.1
Bugfix release. POST /ai/stream delivers every Server-Sent Event as it is produced, also behind compression.
Update
pnpm add @lenne.tech/nest-server@12.9.1
pnpm run update # nest-server-starter based projectsVendor mode: run /lt-dev:backend:update-nest-server-core.
What was wrong
The AI stream sent Cache-Control: no-cache only. nest-server-starter and the reference main.ts register compression, and its default filter compresses text/event-stream. gzip then held every event of a prompt run until the run ended. In a measurement, events written at 0, 300 and 600 ms all arrived together at about 900 ms, so a chat client showed nothing until the answer was complete. /sync/hints was not affected.
What 12.9.1 does
- The stream sends
Cache-Control: no-cache, no-transform, which makescompressionleave the response alone. - It flushes after every event, every error and every heartbeat, for a compressor that ignores
no-transform.
Do I need to do anything?
No. A project that overrides CoreAiController.stream() should send the same Cache-Control header and call res.flush?.() after each write.