Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae3d20c71a | |||
| 54ef9662c1 | |||
| 9aec461e14 |
@@ -10,7 +10,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "7.3.5",
|
"version": "7.3.6",
|
||||||
"source": "./plugin",
|
"source": "./plugin",
|
||||||
"description": "Persistent memory system for Claude Code - context compression across sessions"
|
"description": "Persistent memory system for Claude Code - context compression across sessions"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "7.3.5",
|
"version": "7.3.6",
|
||||||
"description": "Memory compression system for Claude Code - persist context across sessions",
|
"description": "Memory compression system for Claude Code - persist context across sessions",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"claude",
|
"claude",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "7.3.5",
|
"version": "7.3.6",
|
||||||
"description": "Persistent memory system for Claude Code - seamlessly preserve context across sessions",
|
"description": "Persistent memory system for Claude Code - seamlessly preserve context across sessions",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Alex Newman"
|
"name": "Alex Newman"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+189
-252
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -113,7 +113,7 @@ export class SDKAgent {
|
|||||||
// Calculate discovery tokens (delta for this response only)
|
// Calculate discovery tokens (delta for this response only)
|
||||||
const discoveryTokens = (session.cumulativeInputTokens + session.cumulativeOutputTokens) - tokensBeforeResponse;
|
const discoveryTokens = (session.cumulativeInputTokens + session.cumulativeOutputTokens) - tokensBeforeResponse;
|
||||||
|
|
||||||
// Only log non-empty responses (filter out noise)
|
// Process response (empty or not) and mark messages as processed
|
||||||
if (responseSize > 0) {
|
if (responseSize > 0) {
|
||||||
const truncatedResponse = responseSize > 100
|
const truncatedResponse = responseSize > 100
|
||||||
? textContent.substring(0, 100) + '...'
|
? textContent.substring(0, 100) + '...'
|
||||||
@@ -125,6 +125,9 @@ export class SDKAgent {
|
|||||||
|
|
||||||
// Parse and process response with discovery token delta
|
// Parse and process response with discovery token delta
|
||||||
await this.processSDKResponse(session, textContent, worker, discoveryTokens);
|
await this.processSDKResponse(session, textContent, worker, discoveryTokens);
|
||||||
|
} else {
|
||||||
|
// Empty response - still need to mark pending messages as processed
|
||||||
|
await this.markMessagesProcessed(session, worker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,8 +399,15 @@ export class SDKAgent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CRITICAL: Mark ALL pending messages as successfully processed
|
// Mark messages as processed after successful observation/summary storage
|
||||||
// This prevents message loss if worker crashes before SDK finishes
|
await this.markMessagesProcessed(session, worker);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark all pending messages as successfully processed
|
||||||
|
* CRITICAL: Prevents message loss and duplicate processing
|
||||||
|
*/
|
||||||
|
private async markMessagesProcessed(session: ActiveSession, worker: any | undefined): Promise<void> {
|
||||||
const pendingMessageStore = this.sessionManager.getPendingMessageStore();
|
const pendingMessageStore = this.sessionManager.getPendingMessageStore();
|
||||||
if (session.pendingProcessingIds.size > 0) {
|
if (session.pendingProcessingIds.size > 0) {
|
||||||
for (const messageId of session.pendingProcessingIds) {
|
for (const messageId of session.pendingProcessingIds) {
|
||||||
|
|||||||
Reference in New Issue
Block a user