feat(gateway): load conversation history on session resume (M1-004, M1-005) #301

Merged
jason.woltje merged 1 commits from feat/m1-context-loading into main 2026-03-21 21:00:14 +00:00

1 Commits

Author SHA1 Message Date
c6d66d2d58 feat(gateway): load conversation history on session resume (M1-004, M1-005)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
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>
2026-03-21 15:46:44 -05:00