Feat/2358 clear reembed skipped
Summary
Adds clear_chunk_reembed_skipped, clear_summary_reembed_skipped, and clear_reembed_skipped_for_signature (https://github.com/tinyhumansai/openhuman/issues/2358). Input validation on mark/clear paths; library-only (no new RPC). Depends on https://github.com/tinyhumansai/openhuman/pull/2349. Closes #2358
Local verification (2026-05-21)
cargo test reembed_skip reembed_backfill_tombstones --lib β 5 passed bash scripts/test-rust-with-mock.sh --lib reembed_skip β passed Lifetime fix for Rust 1.93 (validate_reembed_skip_key<'a>) Upstream
Open against tinyhumansai/openhuman:main:
https://github.com/tinyhumansai/openhuman/compare/main...MrMrVlad:feat/2358-clear-reembed-skipped
Summary by CodeRabbit
-
Bug Fixes
- Fixed infinite reprocessing loops for failed embeddings by implementing terminal failure tracking.
- Improved database locking behavior to prevent contention during document ingestion.
-
Chores
- Enhanced Windows development environment setup for improved PATH handling.
- Updated data storage schema to support failure tracking and recovery management.
This PR adds a persistent tombstone system to prevent infinite re-embed backfill retries on rows with terminal failures, migrates RPC pending/processed accounting to the sidecar embedding table, fixes SQLite ingest transaction locking, and improves Windows dev-server pnpm discovery. Re-embed backfill runaway-loop fix with terminal failure tombstones Supporting infrastructure fixes and migrations π― 4 (Complex) | β±οΈ ~60 minutes π° With tombstones now marking the failures so true, βοΈ Tip: You can configure your own custom pre-merge checks in the settings.π Walkthrough
Walkthrough
Changes
Layer / File(s)
Summary
Tombstone schema and store APIs
src/openhuman/memory/tree/store.rs, src/openhuman/memory/tree/tree_source/store.rsTwo SQLite schema tables
mem_tree_chunk_reembed_skipped and mem_tree_summary_reembed_skipped record terminal failures keyed by (id, model_signature) with reason and skipped_at_ms. Public APIs mark_chunk_reembed_skipped, clear_chunk_reembed_skipped, clear_reembed_skipped_for_signature, mark_summary_reembed_skipped, and clear_summary_reembed_skipped manage tombstone lifecycle. Input validator validate_reembed_skip_key enforces non-empty, max-length, and NUL-byte rejection. Migration probe excludes tombstoned rows from uncovered-work computation.
Job handler terminal failure marking and worklist exclusion
src/openhuman/memory/tree/jobs/handlers/mod.rshandle_reembed_backfill marks chunks/summaries as terminally skipped (missing body, embed dimension mismatch, embed errors) and calls mark_*_reembed_skipped with failure reason. Chunk and summary worklist SQL adds NOT EXISTS clauses against respective tombstone tables to exclude already-failed rows from future selection.
Coverage probe exclusion of tombstoned rows
src/openhuman/memory/tree/jobs/mod.rsensure_reembed_backfill coverage-check SQL treats *_reembed_skipped sentinels as already-processed, excluding them from uncovered computation for both chunks and summaries to prevent repeated backfill re-enqueueing.
Tombstone lifecycle tests
src/openhuman/memory/tree/store_tests.rs, src/openhuman/memory/tree/jobs/handlers/mod.rsUnit tests verify idempotent clear operations, bulk clear-by-signature with correct deletion counts, key validation, orphaned chunk tombstoning flow, and tombstone clearing that re-includes rows in uncovered-work probe.
Layer / File(s)
Summary
SQLite ingest transaction locking fix
src/openhuman/memory/tree/ingest.rsSwitches
persist transaction from default unchecked_transaction() to explicit TransactionBehavior::Immediate to acquire write lock immediately at BEGIN, preventing fast-fail SQLITE_BUSY during contention and ensuring document-level ingest gates occur within serialized writer semantics.
RPC migration to sidecar embedding queries
src/openhuman/memory/sync_status/rpc.rsRefactors
openhuman.memory_sync_status_list RPC to compute embedded/processed/pending using mem_tree_chunk_embeddings sidecar table via EXISTS instead of legacy mem_tree_chunks.embedding inline column. Extracts query_sync_statuses(conn, now_ms) helper for testability and updates module docs with sidecar semantics.
Windows dev-server PATH discovery and de-duplication
scripts/run-dev-win.shPrecomputes
PNPM_DIR from resolved PNPM_EXE, conditionally prepends to PATH (avoiding degenerate .), then de-duplicates colon-separated entries keeping only first occurrence to prevent environment-block truncation in cmd /S /C child processes.Estimated code review effort
Possibly related PRs
#1574 Β§6).ReembedBackfill job and memory_backfill_status frontend wiring; this PR extends the job handler to persistently mark terminal failures and updates the coverage probe to avoid infinite retries.mem_tree_chunk_embeddings sidecar tables and signature-scoped helpers; this PR queries those tables in RPC logic and adds schema dependencies for tombstone management.Suggested labels
feature, memory, workingSuggested reviewers
Poem
The backfill won't loop on the stuck work anew.
Each sidecar embedding now tells the right tale,
And when Windows pnpm is lost on the trail,
Our PATH finds the way, deduped and set free! ππ₯ Pre-merge checks | β
5
β
Passed checks (5 passed)
Check name
Status
Explanation
Description Check
β
Passed
Check skipped - CodeRabbitβs high-level summary is enabled.
Title check
β
Passed
The title 'Feat/2358 clear reembed skipped' directly references issue
#2358 and accurately summarizes the main feature addition: clearing reembed-skipped tombstones.
Linked Issues check
β
Passed
The PR implements all core requirements from
#2358: clear_chunk_reembed_skipped and clear_summary_reembed_skipped helpers [#2358], bulk clear_reembed_skipped_for_signature function [#2358], input validation [#2358], and comprehensive unit tests [#2358].
Out of Scope Changes check
β
Passed
All changes are directly aligned with
#2358 scope: helper functions, validation, tests, and schema updates for tombstone management. Admin RPC exposure is explicitly noted as optional/out-of-scope in the issue, which is not included in this PR.
Docstring Coverage
β
Passed
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
[!WARNING]
Review ran into problems
π₯ Problems
Git: Failed to clone repository. Please run the
@coderabbitai full reviewcommand to re-trigger a full review. If the issue persists, setpath_filtersto include or exclude specific files.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@YellowSnnowmann this PR has merge conflicts with main β please rebase/resolve before review.
@MrMrVlad this PR has merge conflicts with main β please rebase/resolve before review.
Rebased onto latest main and pushed review follow-ups: shared has_uncovered_reembed_work, warn on tombstone write failures, debug logging, summary tombstones in bulk-clear test. Local: cargo test reembed_skip --lib (4 passed). sync_status/rpc.rs unchanged β window-scoped pending already on main.
@MrMrVlad this PR has merge conflicts with main β please rebase/resolve before review.