feat(service): use Neon Realtime only where LUKE_REALTIME=on

Merged
CH
6h ago
+45-12

Production's Neon Realtime engine keeps failing to start, so the live layer stops depending on it for now. This is the first of two PRs.

What changes

  • The switch: liveSealingFromEnvironment uses Realtime only when LUKE_REALTIME=on and both NEON_REALTIME_URL and NEON_REALTIME_SECRET are set. Otherwise LiveSealing stands as none.
  • When it's off: every live endpoint (inbox, task board, agent transcript) answers on the poll path, as when Realtime isn't configured. That path already exists on main (#4172's sealedParts). The board and transcripts keep working through the host's poll fallback.
  • Logging: nothing is logged when Realtime is off on purpose.
  • Turning it back on: production keeps its Neon variables, so turning Realtime back on is just setting LUKE_REALTIME=on.

The next PR, stacked on this one, turns the poll path into a held read so it answers within about a second.

Tests

realtime.test.ts covers the switch: with Neon's variables set, sealing is on when LUKE_REALTIME=on and off when the switch is unset or anything else. The existing sealing tests now switch Realtime on explicitly.

Made with Luke


Devin Review