Files
hermes-agent/apps
Teknium 21e9d4532f fix(bot-mode): canonical-chat adoption survives busy profiles via exact-title lookup
The #90732 adoption scan used session.list's 200-row recency window. A busy
bot profile (group-chat traffic, routines, or accumulated fork spam) pushes
an older forever-chat past row 200, the scan misses it, and the mint path
re-enters the unique-title-conflict fork loop — same pathology, higher
trigger threshold.

Profile → Named Session is an exact registry (UNIQUE title index), so
consult it exactly:

- session.list gains a `title` param: indexed WHERE title = ? lookup,
  window-free, hidden rows resolve, archived/deny-listed do not,
  compression lineages resolve to the live tip (resolved_id), mirroring
  profiles.list's preferred_session resolver.
- findExistingCanonicalChat sends title: 'Bot Chat'. Older gateways ignore
  the unknown param and return the windowed listing — the local scan stays
  as the compatibility rung.
- Adoption opens the lineage tip (resolved_id) while pinning the durable id,
  same split as the preferred_session path.
2026-08-20 03:49:15 -07:00
..