fix-chatbot-restarts

#3
by djcotto - opened
No description provided.

Users were getting an unspecific error, having to reload, then re-enter
credentials with their chat history wiped. Cause: HF replaces the Space's
container several times a day, and Gradio ties three things to process
memory β€” so every swap logged everyone out.

Confirmed from a user HAR: x-proxied-replica changed (tk6qj -> 84g8c)
and every request after it returned 401 Not authenticated.

  • Pin the BrowserState secret and storage key, so saved conversations
    survive a restart instead of being silently wiped. Derived from the
    existing credentials β€” no new Space secret needed.
  • Replace Gradio's auth with a signed HMAC session cookie. No server-side
    session store, so any replica accepts a cookie any other replica issued.
    Adds a German login page; the Blocks app is now mounted under FastAPI.
  • Bound the worst case: concurrency 50, queue 50, uploads 3 MB. The upload
    cap also fixes a real bug β€” Bedrock refuses images >3.75 MB and documents

    4.5 MB, so larger files were failing as the generic German error.

No configuration change required to merge. The deploy itself restarts the
Space, so this is the last forced logout.

djcotto changed pull request status to open
evaluator42 changed pull request status to merged

Sign up or log in to comment