You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: bound message history queries to prevent memory/token overflow (v0.7.0)
getNewMessages and getMessagesSince were loading unbounded results from
SQLite. Added LIMIT (default 200) via DESC subquery, per-prompt cap
(MAX_MESSAGES_PER_PROMPT=50), and cursor recovery from last bot message
timestamp to prevent full history dump on restart or corrupted state.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,12 @@
1
1
# Changelog
2
2
3
+
## v0.7.0 (2026-03-29) — Message history overflow fix
4
+
5
+
### Fixes
6
+
-**Message history queries now have LIMIT** — `getNewMessages()` and `getMessagesSince()` were loading unbounded results from SQLite. As conversations grew, this caused escalating memory usage and token costs. Both queries now cap at 200 rows (configurable), using a DESC subquery to keep the most recent messages.
7
+
-**Per-prompt message cap** — `MAX_MESSAGES_PER_PROMPT` (default 50, configurable via env var) limits how many messages are bundled into a single agent prompt.
8
+
-**Cursor recovery on restart** — when `lastAgentTimestamp` is missing (new group, corrupted state, or restart), the system now recovers from the last bot message timestamp instead of falling back to empty string (which would send the entire conversation history).
9
+
3
10
## v0.6.9 (2026-03-29) — Structured memory + process watchdog
0 commit comments