[BUG] - Chat shows "connection to your chat app dropped" during long replies despite keepalive and auto-reconnect

Aperta
#123 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@dcmcand ci sta già lavorando.

Dal 4/12/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

needs: investigation 🔍 type: bug 🐛
Description

On the deployed cluster, chat still shows "The connection to your chat app dropped." with a Reconnect button partway through long replies. #113 added a 15s SSE keepalive (80dffc75) and one automatic reconnect per message (e173aff0). If the cluster runs that build, the banner means the reply stream dropped twice: once on the original stream and again on the stream the automatic reconnect followed. The keepalive only stops proxies from closing quiet connections, so something else is closing them. The person loses the live view of the reply and has to click Reconnect.

The connection to your chat app dropped.
[Reconnect]
Steps to reproduce
  1. On the deployed cluster, start a chat and ask for something that takes several minutes and writes large files (seen with "Build me a review checklist app...", while the agent was writing index.html).
  2. Wait while the agent runs tools.
  3. The reply stops partway and the banner "The connection to your chat app dropped." shows with a Reconnect button.
Expected behavior

A long reply streams to its end. If a single drop happens, the automatic reconnect follows the reply again without the banner showing.

Environment
  • Tapas version: <fill in: Commit from GET /api/info on the deployed cluster> (the fix is in 75a0b907 and later)
  • Cluster ingress / load balancer: <fill in>
  • Browser: <fill in>
  • Model: anthropic/claude-opus-5.5
Additional context
  • The banner comes from failureOf in ui/src/features/chat/ChatSession.tsx:121. It shows only when fetch itself fails (TypeError), so the browser lost the connection. The gateway did not send an error chunk, which would show "Try again".
  • With e173aff0 the UI reconnects once per message sent (triedReconnect). If the followed stream drops again, the banner shows.
  • Possible causes, none confirmed yet:
    • A proxy in front of the gateway with a total time limit per request (for example an Envoy Gateway route timeout or a load balancer limit). The keepalive does not stop that, and the reconnected stream hits the same limit.
    • A proxy that buffers SSE. The gateway sets X-Accel-Buffering: no, which only nginx honors, so the : keepalive comments may never reach the browser.
    • A gateway pod restarting during the reply.
  • To narrow it down:
    • Confirm the deployed Commit from /api/info includes #113.
    • Time several drops from send to banner. A constant duration points to a per-request time limit.
    • In DevTools, Network, open the chat stream's EventStream and check that : keepalive comments arrive every 15s during quiet stretches.
    • Check gateway pod restarts around the drop: kubectl get pods -n <ns> -l app.kubernetes.io/component=gateway.
  • Proposed changes in Tapas, whatever the cause:
    • Retry the automatic reconnect two or three times with a short pause, instead of once per message.
    • Log in the gateway when a reply stream ends because the browser left (relay in internal/gateway/chat/chat.go), with how long it was open, so a fixed time limit shows in the logs.
  • If the cause is a proxy time limit, the fix is in the cluster's routing (for example a BackendTrafficPolicy raising or turning off the request timeout on the chat route), and the Tapas docs should say so.
  • Related: #113.
Lingua principale
Go
Stelle
5
Fork
0
Merge medio
21h 13m
PR unite (30g)
53

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nebari-dev/tapas

Tutte le issue di nebari-dev/tapas

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.