Matrix chat history persistence — localStorage per-agent, 100-msg cap, Clear button #43

Closed
opened 2026-03-19 18:52:16 +00:00 by replit · 1 comment
Owner

Why

Chat messages are lost on every page reload. Operators and users need conversation continuity across sessions.

Acceptance criteria

  • loadChatHistory(agentId) and saveChatHistory(agentId, messages) helpers in ui.js; localStorage key matrix:chat:<agentId>
  • Cap at 100 messages per agent — oldest dropped first on overflow
  • Each message includes a timestamp field; displayed with existing time formatter
  • saveChatHistory called whenever a message is added (user send + assistant response)
  • On agent panel open, history is loaded and rendered before any new messages
  • "Clear History" button in Chat tab header wipes that agent's stored history and re-renders empty
  • No WebSocket or mock data layer changes; no backend changes

Out of scope

  • Multi-device sync
  • Memory or task data persistence (chat messages only)

Relevant files

  • the-matrix/js/ui.js
  • the-matrix/js/agents.js (message rendering)
  • the-matrix/index.html (Clear button)

Delegate

@kimi

## Why Chat messages are lost on every page reload. Operators and users need conversation continuity across sessions. ## Acceptance criteria - [ ] `loadChatHistory(agentId)` and `saveChatHistory(agentId, messages)` helpers in `ui.js`; localStorage key `matrix:chat:<agentId>` - [ ] Cap at 100 messages per agent — oldest dropped first on overflow - [ ] Each message includes a `timestamp` field; displayed with existing time formatter - [ ] `saveChatHistory` called whenever a message is added (user send + assistant response) - [ ] On agent panel open, history is loaded and rendered before any new messages - [ ] "Clear History" button in Chat tab header wipes that agent's stored history and re-renders empty - [ ] No WebSocket or mock data layer changes; no backend changes ## Out of scope - Multi-device sync - Memory or task data persistence (chat messages only) ## Relevant files - `the-matrix/js/ui.js` - `the-matrix/js/agents.js` (message rendering) - `the-matrix/index.html` (Clear button) ## Delegate `@kimi`
replit added the frontendkimiworld labels 2026-03-19 18:52:16 +00:00
claude was assigned by Rockachopa 2026-03-22 23:38:10 +00:00
Collaborator

PR created: http://143.198.27.163:3000/replit/token-gated-economy/pulls/63

All acceptance criteria met:

  • loadChatHistory / saveChatHistory helpers with matrix:chat:<agentId> key
  • 100-message cap (oldest dropped on overflow)
  • Timestamps on each message, displayed as [HH:MM] prefix
  • Persistence on every appendChatMessage call
  • History restored on page load via renderChatHistory
  • CLEAR HISTORY button wipes storage and re-renders empty
  • No backend changes
PR created: http://143.198.27.163:3000/replit/token-gated-economy/pulls/63 All acceptance criteria met: - `loadChatHistory` / `saveChatHistory` helpers with `matrix:chat:<agentId>` key - 100-message cap (oldest dropped on overflow) - Timestamps on each message, displayed as `[HH:MM]` prefix - Persistence on every `appendChatMessage` call - History restored on page load via `renderChatHistory` - CLEAR HISTORY button wipes storage and re-renders empty - No backend changes
This repo is archived. You cannot comment on issues.