mirror of
https://github.com/severian-dev/sucker.severian.dev.git
synced 2026-10-18 01:20:29 +00:00
e7c9adbcc5
The first pass read the name from the last user turn and the token from the last assistant turn. Both are wrong once a conversation continues. Only sucker's *first* reply carries a conversation token — later ones say "Character updated" or "unchanged" with no token in them — so reading the last assistant turn lost the link three turns in and would have created a duplicate card on every message. tokenCandidates() now searches the whole conversation, still preferring whatever the user just typed, since pasting a token is deliberate. The name is the first user turn after the greeting, not the last one. That is what the old code read at messages[3], and unlike the last turn it stays put as messages are appended. Tests cover a three-turn conversation for both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NX2SsmUqQftWTZAY4BDuFa