Skip to content

Agent conversation history stored in-memory — lost on server restart, breaks multi-instance deploys #2

@CodewMilan

Description

@CodewMilan

Bug Report

Description

ui/app/api/agent/route.ts stores conversation history in a module-level Map.
This means:

  • All history is wiped on every server restart or hot reload
  • The app cannot scale to more than one process (Vercel serverless, multiple dynos, etc.)
  • Two users on the same session ID will share history if both hit different instances

Affected file

ui/app/api/agent/route.ts

Acceptance criteria

  • Conversation history survives a next dev restart
  • Two separate Node processes serve the same history for the same session_id
  • History is cleaned up after a configurable TTL (e.g. 24 h)

Metadata

Metadata

Labels

backendbugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions