claude-threads 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/index.js +5 -0
- package/dist/mcp/permission-server.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.4] - 2026-04-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Memory leak across session lifecycles.** `PostTracker` registered every post created during a session but its `clearSession(sessionId)` was only invoked on full bot shutdown. Across many sessions the in-memory map grew without bound and contributed to V8 mark-compact becoming ineffective and an eventual OOM abort (observed at ~14 h uptime). `MessageManager.dispose()` now clears its session's `PostTracker` bucket, and dispose is wired into all five session-removal paths in `src/session/lifecycle.ts`: normal exit, kill, idle timeout, pause, shutdown, early exit, resume-fail, plus the start-failure and resume-failure error branches that bypass the shared cleanup helpers. (#356, fixes #351)
|
|
12
|
+
|
|
8
13
|
## [1.9.3] - 2026-04-24
|
|
9
14
|
|
|
10
15
|
### Internals
|
package/dist/index.js
CHANGED
|
@@ -60991,6 +60991,7 @@ class MessageManager {
|
|
|
60991
60991
|
}
|
|
60992
60992
|
dispose() {
|
|
60993
60993
|
this.cancelScheduledFlush();
|
|
60994
|
+
this.postTracker.clearSession(this.sessionId);
|
|
60994
60995
|
this.reset();
|
|
60995
60996
|
}
|
|
60996
60997
|
}
|
|
@@ -67485,6 +67486,7 @@ async function cleanupSession(session, ctx, options2 = {}) {
|
|
|
67485
67486
|
if (doCloseLogger) {
|
|
67486
67487
|
await closeThreadLogger(session, action, details);
|
|
67487
67488
|
}
|
|
67489
|
+
session.messageManager?.dispose();
|
|
67488
67490
|
ctx.ops.emitSessionRemove(session.sessionId);
|
|
67489
67491
|
mutableSessions(ctx).delete(session.sessionId);
|
|
67490
67492
|
if (doCleanupPostIndex) {
|
|
@@ -67500,6 +67502,7 @@ function releaseAccountIfHeld(session, ctx) {
|
|
|
67500
67502
|
}
|
|
67501
67503
|
}
|
|
67502
67504
|
function removeFromRegistry(session, ctx) {
|
|
67505
|
+
session.messageManager?.dispose();
|
|
67503
67506
|
ctx.ops.emitSessionRemove(session.sessionId);
|
|
67504
67507
|
mutableSessions(ctx).delete(session.sessionId);
|
|
67505
67508
|
cleanupPostIndex(ctx, session.threadId);
|
|
@@ -67911,6 +67914,7 @@ ${CHAT_PLATFORM_PROMPT}`;
|
|
|
67911
67914
|
} catch (err) {
|
|
67912
67915
|
await logAndNotify(err, { action: "Start Claude", session });
|
|
67913
67916
|
ctx.ops.stopTyping(session);
|
|
67917
|
+
session.messageManager?.dispose();
|
|
67914
67918
|
ctx.ops.emitSessionRemove(session.sessionId);
|
|
67915
67919
|
mutableSessions(ctx).delete(session.sessionId);
|
|
67916
67920
|
releaseAccountIfHeld(session, ctx);
|
|
@@ -68114,6 +68118,7 @@ ${sessionFormatter.formatItalic("Reconnected to Claude session. You can continue
|
|
|
68114
68118
|
ctx.ops.persistSession(session);
|
|
68115
68119
|
} catch (err) {
|
|
68116
68120
|
log26.error(`Failed to resume session ${shortId}`, err instanceof Error ? err : undefined);
|
|
68121
|
+
session.messageManager?.dispose();
|
|
68117
68122
|
ctx.ops.emitSessionRemove(sessionId);
|
|
68118
68123
|
mutableSessions(ctx).delete(sessionId);
|
|
68119
68124
|
ctx.state.sessionStore.remove(sessionId);
|
|
@@ -52899,6 +52899,7 @@ class MessageManager {
|
|
|
52899
52899
|
}
|
|
52900
52900
|
dispose() {
|
|
52901
52901
|
this.cancelScheduledFlush();
|
|
52902
|
+
this.postTracker.clearSession(this.sessionId);
|
|
52902
52903
|
this.reset();
|
|
52903
52904
|
}
|
|
52904
52905
|
}
|