fix(supermemory): gate indexing readiness on dreamingStatus#45
Open
sreedharsreeram wants to merge 1 commit into
Open
fix(supermemory): gate indexing readiness on dreamingStatus#45sreedharsreeram wants to merge 1 commit into
sreedharsreeram wants to merge 1 commit into
Conversation
The indexing poll previously treated status === "done" as fully ready. In the deferred dreaming path the backend atomically writes status:"done" + dreamingStatus:"dreaming", so a doc reads "done" the entire time dreaming inference runs — searching then returns nothing. A doc is now considered ready only when status === "done" AND dreamingStatus !== "dreaming" (still also requiring memory.status === "done"). dreamingStatus alone is unsafe since its column default is "done", so a doc still at status:"indexing" would read prematurely ready. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Supermemory indexing poll (
awaitIndexing) previously treateddoc.status === "done"as fully indexed. That's unsafe with the deferred dreaming path: the backend atomically writesstatus:"done"+dreamingStatus:"dreaming", so a doc reads"done"the entire time dreaming inference runs. Searching during that window returns nothing.Change
A doc is now considered ready only when:
(still also gated on
memory.status === "done"downstream).Why not
dreamingStatusalone? Its column default is"done", so a doc still atstatus:"indexing"would readdreamingStatus:"done"and be declared ready before ingest even finishes. Both fields together is the only race-free condition.dreamingStatusis read via a cast since the installedsupermemorySDK type (DocumentGetResponse) doesn't expose the field yet.Testing
Not yet validated end-to-end — the local worker on :8787 was flapping (503 / 500 / connection refused) during attempts, so ingest never reached the indexing phase. Logic type-checks clean. Worth a run against a stable backend before merge.
🤖 Generated with Claude Code