Files
sales-trainer/backend/app
Macky 8c89b17f64 feat(follow-up): chat ends only on win/loss — try rolls a follow-up drill
`try` (customer will trial first) no longer auto-closes the session.
A random follow-up event is rolled so the trainee practices the follow-up:
  1. customer goes silent (~2 days) — trainee must ทัก first, then rolls:
     gone for good (instant loss + judge debrief) or hesitant (re-engages);
  2. customer comes back on their own with a post-trial message.

Only buy/walk/gone-for-good ever close the session. New notes/returners are
in _NOTES and added to _SAFE_SYSTEM_MESSAGES; the followup phase is stripped
from LLM prompts by the _safe_roleplay_internal allowlist (no latent leak).

Tests: 6 new (try->silent, silent->gone, silent->hesitant, try->returned,
buy closes, walk closes) with deterministic StubRandom + LLM-call counters
asserting follow-up turns skip persona_reply/evaluate_turn.
2026-10-02 08:37:27 +07:00
..
2026-08-21 12:28:22 +07:00