fix(tabular): TR-02 to TR-05 bugs + SSE keepalive heartbeat

🟢 open · #20 · Edu-Carone-SA/mike ← Edu-Carone-SA/mike · opened 1mo ago by EduardoCarone · self · +3,274-93 across 28 files · ↗ on GitHub

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-review and /single-documents
  • Browser navigation (Accept: text/html) → Frontend; API calls → Backend

BUG-TR-02: missingModelApiKey ignores env key fallback

  • Added hasEnvApiKey() check in missingModelApiKey() 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/generate now uses review.document_ids as primary source of truth
  • Falls back to cell-derived doc IDs only if document_ids is not set

BUG-TR-04: Silent failure on documents without storage_path

  • If extracted markdown is empty, cells are now marked as error with 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

  • processLine now 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.ts and projectChat.ts now send : keepalive SSE 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.

⬇ Download capture-pull-20.md