HydraIssues

HydraBrainServer: guest trial chat, 3 free messages before IAMNim signup
done feature Project: Hydra Parent: #659 Reporter: 7 Sep 2026 11:25

Description

Earn the signup instead of demanding it. Today an anonymous visitor to hydrabrain.experiencenet.com is redirected to IAMNim before seeing anything.

New flow:

  • GET / is public. A visitor can chat immediately as a guest.
  • Guest sessions are separate from login sessions: own opaque cookie, own in-memory store with its own cap and a short TTL, and a server-side message counter. The counter is never client-side because each guest message spends real inference on the HydraBrain.
  • After 3 guest messages POST /api/v1/chat returns a guest_limit error. The UI replaces the composer with a sign-in CTA to the existing /login (IAMNim, self-service via Google OAuth or magic link).
  • The browser stashes the conversation in sessionStorage before the login redirect and restores it after the callback, so the visitor keeps the conversation through signup. Conversations stay browser-tab-only per the repo boundary.
  • Guardrails: smaller max request body for guests, per-IP cap on new guest sessions, existing one-chat-per-session slot unchanged.
  • UI shows remaining free messages progressively (no surprise wall).

Verified: IAMNim auto-creates users on first Google OAuth or magic-link login, so the CTA is not a dead end.

Ship: implement in hydrabrainserver, tests+vet, tag v0.2.0, CI to scaleregistry, hydraskin update on pi-node-001, verify at the domain.