Skip to content

Add durable EvalOps memory sync queue#50

Merged
haasonsaas merged 1 commit intomainfrom
codex/evalops-memory-sync-queue
Apr 21, 2026
Merged

Add durable EvalOps memory sync queue#50
haasonsaas merged 1 commit intomainfrom
codex/evalops-memory-sync-queue

Conversation

@haasonsaas
Copy link
Copy Markdown
Collaborator

Summary

  • Add a local SQLite queue for failed EvalOps Memory sync writes.
  • Retry queued chat, meeting-summary, and journal syncs with bounded backoff from a background drain loop.
  • Force-flush queued syncs after successful EvalOps login and from the Settings retry button.
  • Surface pending/failed queue status in EvalOps Settings.

Refs #15.

Validation

  • npm ci --ignore-scripts
  • npm run build
  • git diff --check

Validation caveat

  • npm test initially failed because the fresh clone did not have the native ContextKit binary.
  • After npm run contextkit:build, npm test got through ContextKit and meeting detection, then failed in audio-data-size.test.mjs because the local WAV duration reported 0.0s despite receiving mic buffers and writing a 158 KB mic file. That appears unrelated to this memory-sync queue change.

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 21, 2026

PR Summary

Medium Risk
Introduces new persistent DB state and a background retry loop that can affect app lifecycle and network call patterns. Failures/backoff and forced flush on login could surface edge cases (duplicate attempts, contention, or unexpected load) if the queue logic misbehaves.

Overview
Adds a durable local queue (evalops_memory_sync_queue) for failed EvalOps Memory sync writes, including an index for efficient scheduling and a bounded exponential backoff retry policy.

Memory sync background jobs now enqueue on failure and are drained periodically from the main process (plus force-flushed after successful EvalOps login), with new IPC endpoints (evalops:memorySync:status/flush) and settings UI surfacing pending/last-error state and a manual Retry action.

Reviewed by Cursor Bugbot for commit 55de74d. Bugbot is set up for automated code reviews on this repo. Configure here.

@haasonsaas haasonsaas merged commit 44406ed into main Apr 21, 2026
5 checks passed
@haasonsaas haasonsaas deleted the codex/evalops-memory-sync-queue branch April 21, 2026 10:46
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 55de74d. Configure here.

queueFlushPromise = null
})
return queueFlushPromise
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force flush flag silently dropped during concurrent execution

Medium Severity

flushEvalOpsMemorySyncQueue returns the existing queueFlushPromise when a flush is already in progress, completely ignoring the force flag. If the periodic (non-force) drain is running when the user logs in or clicks Retry, the force: true call silently joins the non-force drain — which only processes items past their nextAttemptAt. Items backing off (e.g., with a 30-minute delay) won't be retried as expected.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 55de74d. Configure here.

queueMemorySyncFailure(category, itemId, audioPath, errorMessage(err))
throw err
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queued jobs silently deleted when sync category disabled

Medium Severity

runMemorySyncJob delegates to syncChatThreadMemory/syncMeetingSummaryMemory/syncJournalEntryMemory, each of which returns early (no error) when isMemorySyncEnabled is false. On success, removeQueuedMemorySync deletes the job from the durable queue. So if a sync category is disabled between initial failure and retry, the drain loop silently discards queued items without actually syncing them.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 55de74d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant