Skip to content

12.9.1

Choose a tag to compare

@kaihaase kaihaase released this 11 Nov 16:24
· 39 commits to main since this release
7dfdb12

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 projects

Vendor 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 makes compression leave 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.