#124 — [Bug]: Automatic reconnect attempts on 401 responses

Repo: Twill-AI/twill-ai-ui State: closed | Status: done Assignee: raymondehizoba

Created: 2024-12-02 · Updated: 2025-09-15

Description

Steps to reproduce

Caused by https://twill-network.slack.com/archives/C078KS0R05B/p1733134683242609

To reproduce:

Main

  1. Open main page and leave for 1 hour+.
  2. After this try to prompt something in LLM chat. Monitor requests from UI.

Alternative

  1. Make back-end return 401 request in GET /api/v1/ws response.
  2. Prompt something in LLM chat. Monitor requests from UI.

What was the expected behavior?

I expected UI to use “refresh” token to update “access” token and sent request with valid. If 401 received from back-end then show toast for user with request to relogin. See https://twill-network.slack.com/archives/C078KS0R05B/p1733135692977969?thread_ts=1733135193.456989&cid=C078KS0R05B

Screenshots

https://twill-network.slack.com/archives/C078KS0R05B/p1733134683242609

FYI: after fix ping @AlexanderMakarov to re-enable alerts in staging for this.

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets