feat: chat turn store rename, stop route, attached-doc context; local transport compaction

↗ view on GitHub · Eli Ziff · 2026-07-27 · 2b62ebf7

anonymousChatTurns becomes chatTurns with abortChatTurn powering the
new POST /chat/:chatId/stop route; PATCH accepts project_id to move a
chat between projects; user-attached documents get an explicit context
preamble in both transports. routes/chat.ts also lands its compaction:
persistTurnEvents() replaces the four copies of the three-way turn
persistence fan-out, beginSseTurn()/sseFinishTurn()/fail()/conflict()
collapse the repeated SSE and error plumbing, and writes after the
socket is gone are uniformly skipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUsMXzBsEJ27DjJVPSfW5o
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 1e62c26e
Stats 9 files changed , +867 , -778
Part of Chat backend features and prompt/context-budget management

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-2b62ebf7.md from inside the repo you want the change in.

⬇ Download capture-commit-2b62ebf7.md