feat(service): use Neon Realtime only where LUKE_REALTIME=on
Merged
CH
6h ago+45+45+01234567890123456789-12-12-01234567890123456789
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:
liveSealingFromEnvironmentuses Realtime only whenLUKE_REALTIME=onand bothNEON_REALTIME_URLandNEON_REALTIME_SECRETare set. OtherwiseLiveSealingstands 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'ssealedParts). 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