Repository navigation
Queue unembedded embedding roots when the embedding model becomes ready - #4258
Merged
Merged
Conversation
A root of an embeddable type with no embedding row and no stale marker was never embedded until it was edited. When a database's embedding service is wired, one paged query now finds such tree roots and queues them with stale markers in batches, so a second start queues nothing again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ur lookups The unembedded-root query now selects the same three kinds of embedding root that embedding_root_id resolves to (tree roots, filed descendants, children of a chat), built from the same predicates. The page size is a parameter, behaviour lookups are cached per node type for a run, and the per-start cost of non-embeddable roots is documented. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4252-embed-sweep
branch
from
November 6, 2026 08:01
ead0bab to
64a1479
Compare
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.
Fixes #4252
When a database's embedding service is wired (model ready),
NodeEmbeddingService::queue_unembedded_rootsqueues every embedding root of an embeddable type that has no embedding row and no stale marker, then the processor is woken as before. A general sweep: no version check, no upgrade step.embedding_root_idresolves to: tree roots, filed descendants, children of a chat. The query builds them from the same two predicates (filed_descendant_sql,unembedded_subtree_child_sql) inembedding_roots.rs.SqliteStore::get_unembedded_root_ids: id-ordered keyset pages of participating (non-archived) embedding roots with noembeddingrows. Page size is a parameter (queue_unembedded_roots_paged, default 500).Tests (no model): service-level once/second-run, embedded root skipped, multi-page, archived; crate-level test that tree root, filed descendant and chat child are swept, and filed person, ordinary child and archived are not, agreeing with
embedding_root_id. Each of seven mutations fails at least one test.🤖 Generated with Claude Code