When a session is created for a conversation that already has messages in
the DB, prior messages are loaded via ConversationsRepo.findMessages() and
injected into the agent session as a system prompt addition so the agent
has full context of the prior exchange.
Context window management (M1-005): if the full history would exceed 80%
of the model's context window (estimated at ~4 chars/token), older messages
are summarized as a simple extractive summary and only the most recent
messages are kept verbatim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>