fix(tabular): TR-02 to TR-05 bugs + SSE keepalive heartbeat
From the PR description
Fix: Tabular Review bugs + SSE keepalive
Bugs fixed
BUG-TR-01: ALB routing intercepts frontend routes (infra, not in this diff)
- Added header-based ALB listener rules (P5-P8) for
/tabular-reviewand/single-documents - Browser navigation (
Accept: text/html) → Frontend; API calls → Backend
BUG-TR-02: missingModelApiKey ignores env key fallback
- Added
hasEnvApiKey()check inmissingModelApiKey()as defensive fallback - Note:
getUserApiKeys()already includes env keys, but this guards against future refactors
BUG-TR-03: Generation ignores document_ids from review
POST /:reviewId/generatenow usesreview.document_idsas primary source of truth- Falls back to cell-derived doc IDs only if
document_idsis not set
BUG-TR-04: Silent failure on documents without storage_path
- If extracted markdown is empty, cells are now marked as
errorwith descriptive message - Prevents LLM from receiving empty text and returning "Not Found" as if analyzed
BUG-TR-05: JSON parsing breaks on markdown code fences
processLinenow strips```json ... ```fences before parsing- Falls back to regex extraction of first JSON object if line doesn't start with
{
Also included: SSE keepalive heartbeat
chat.tsandprojectChat.tsnow send: keepaliveSSE comments every 15s- Prevents ALB idle timeout (60s, now 300s) from dropping connections during long tool executions
Our analysis
Stabilize tabular review generation and live chat — read the full analysis →
Think the analysis missed something the PR description covers?
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-20.md from
inside the repo you want the changes in.