Context
Part of the ORB maintainer chat platform epic; do not start before the epic's spec sub-issue closes (it confirms SSE and the deployment-target split). #6303 already audited streaming/SSE support in the API layer for the contributor chat; this issue applies those findings to the maintainer surface, which must work on both deployment shapes: the hosted Worker path and the self-host container path.
Requirements
- An SSE response path on the protected API for chat completions: event framing for token deltas, tool-call boundaries, and terminal status (done/error/budget-exhausted), with a heartbeat interval that survives the intermediaries in both deployment shapes.
- Reuse the miner client pattern (
apps/loopover-miner-ui/src/lib/chat-stream.ts and src/lib/use-streaming-text.ts — the latter moving to @loopover/ui-kit under this epic) rather than a new client protocol.
- Budget cutoffs mid-stream terminate cleanly with an explicit terminal event — a truncated stream must be distinguishable from a completed one on the client (the truncation-misread failure class is a known, live bug pattern elsewhere in the system; do not reproduce it here).
- Non-streaming fallback: the same endpoint contract supports a buffered complete response (reduced-motion clients, tests, and any intermediary that breaks SSE).
- Load behavior documented: concurrent-stream ceiling per instance and what the client sees at the ceiling.
Deliverables
- The SSE endpoint + client wiring, feature-flagged off by default.
- Tests: frame-sequence assertions, clean-termination on budget cut, fallback-path equivalence (streamed concatenation === buffered body for identical input).
- A short deployment note covering both target shapes.
Expected outcome
Streaming chat that behaves identically for a hosted tenant and a self-host operator, with truncation always explicit.
Context
Part of the ORB maintainer chat platform epic; do not start before the epic's spec sub-issue closes (it confirms SSE and the deployment-target split). #6303 already audited streaming/SSE support in the API layer for the contributor chat; this issue applies those findings to the maintainer surface, which must work on both deployment shapes: the hosted Worker path and the self-host container path.
Requirements
apps/loopover-miner-ui/src/lib/chat-stream.tsandsrc/lib/use-streaming-text.ts— the latter moving to@loopover/ui-kitunder this epic) rather than a new client protocol.Deliverables
Expected outcome
Streaming chat that behaves identically for a hosted tenant and a self-host operator, with truncation always explicit.