Files
arcadia-admin/app
jules 20494d1620 ai: persist agent-history + per-message attribution to localStorage
Reloading the page mid-conversation used to keep the messages (via
LIVE_KEY) but lose the two agent-tracking maps, so:
  - row signatures snapped back to whoever was currently active
  - the next turn after reload didn't include the PRIOR HAND-OFF
    block, even though the transcript clearly had multiple personas

Both maps are now stored alongside the live snapshot:
  AGENTS_KEY        crema.ai.agent-history   set of Agent
  MSG_AGENTS_KEY    crema.ai.message-agents  index -> Agent

Stored as JSON arrays since Maps don't serialize. Hydrated on mount
via useState lazy initializer, persisted on every change via two
useEffects, cleared in lockstep with LIVE_KEY when the operator
hits Clear conversation.

Reload mid-thread now reads identically to the pre-reload state:
- atlas» turns 1-3 stay attributed to atlas
- pythia» turn 4 stays attributed to pythia
- next turn after reload still carries the hand-off note

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 20:04:55 +10:00
..