iachat/enterprise/app
Rodribm10 c960dc7e1e feat(captain/hermes): handoff por loop + label-guard em outgoing
Substitui o interceptor agressivo de "Um momento — vou verificar"
(que bloqueava silenciosamente) por handoff explícito + loop detection:

- HANDOFF_PATTERNS: detecta a frase-âncora ("Um momento — vou
  verificar", "Aguarde um instante") e ENTREGA pro cliente,
  marcando conv com label triagem_humana.
- looped_response?: detecta 2 outgoing similares (Jaccard >= 0.50)
  OU pergunta reformulada sobre mesmo tópico (>= 3 keywords em comum
  + ambas inquisitivas via "?" / "me confirma" / "qual prefere"
  etc). 1ª resposta passa, 2ª escala. Cobre o caso "endereço ou
  link?" → "apenas link ou link + endereço?".
- OutgoingJob: guard que pula dispatch se conv tem label
  triagem_humana ou hermes_placeholder. Hermes não responde mais →
  não gasta token + não gera loop.

Cobre 2 casos do Rodrigo:
1. Bot da Claro insistindo em menu → 2ª resposta similar escala.
2. Hermes pedindo confirmação 2x sem entregar → escala.

Tokenize normaliza acentos (transliterate) pra stopwords baterem
"voce/você", "endereco/endereço", etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:30:58 -03:00
..
builders Merge branch main into chore/merge-upstream 2025-12-20 12:44:31 -03:00
controllers feat(captain/hermes-builder): aba Verificação com 22+ checks + reparo automático 2026-05-02 15:27:40 -03:00
dispatchers/enterprise feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
errors/captain/errors fix: Resolve erros de linting e conclui as correções de prompt customizado 2026-02-27 13:02:44 -03:00
fields fix: Render all account limit fields (#13435) 2026-02-04 20:21:07 +05:30
finders/enterprise feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
helpers feat: langfuse logging improvements (#13534) 2026-02-17 13:30:04 +05:30
jobs feat(captain/hermes): handoff por loop + label-guard em outgoing 2026-05-02 17:30:58 -03:00
listeners feat(retention): foundation for customer retention metrics 2026-04-22 09:50:23 -03:00
mailers/enterprise/agent_notifications chore: fix sla email notifications (#9192) 2024-04-04 21:16:49 +05:30
models fix(captain): captain_unit_id em captain_assistants — fim do lookup quebrado 2026-05-02 12:45:53 -03:00
policies fix(retention): cohort endpoint 500 — Pundit policy + SQL binding 2026-04-26 12:46:20 -03:00
presenters/enterprise/conversations feat: UI to show the SLA threshold in chat screen (#9146) 2024-04-04 15:46:46 +05:30
services feat(captain/hermes): auto-react ambiente — 20% de chance em msgs neutras 2026-05-02 17:20:36 -03:00
views feat(captain): engine column + DB-driven Hermes routing + Express pricing 2026-05-02 07:54:01 -03:00