Problem. HomePage.connectSSE opens an EventSource on /api/sessions/{id}/stream (page.tsx:325), and useNotebookSSE independently opens a second EventSource on the identical endpoint (src/lib/notebook/useNotebookSSE.ts:50) whenever a notebook is mounted.
Why it matters. That doubles server fan-out and parses every event twice; the two also use different base URLs (see the hardcoded-URL issue), so they don't even fail the same way.
Suggested fix. Expose the single page-level stream via context and have the notebook subscribe to it rather than opening its own connection.
Problem.
HomePage.connectSSEopens an EventSource on/api/sessions/{id}/stream(page.tsx:325), anduseNotebookSSEindependently opens a second EventSource on the identical endpoint (src/lib/notebook/useNotebookSSE.ts:50) whenever a notebook is mounted.Why it matters. That doubles server fan-out and parses every event twice; the two also use different base URLs (see the hardcoded-URL issue), so they don't even fail the same way.
Suggested fix. Expose the single page-level stream via context and have the notebook subscribe to it rather than opening its own connection.