ReMe/reme/components/file_store
北沐城歌 037cd06e8b
fix(file_store): keep tag rebuild failures from aborting the whole reindex (#780)
The tag index is an optional derived index. Incremental updates already
handle a failure that way: _upsert_tag_nodes and _delete_tag_paths swallow
it, log it, and mark the index unhealthy, deliberately "without allowing
optional-index failures to block other indexes".

The explicit rebuild path did the opposite: it turned the same False into a
RuntimeError, which failed every reindex(scope="all") call and discarded the
keyword and embedding rebuilds that had already completed.

The rebuild is now wrapped rather than inspected only through its return
value. require_tag_index() runs before _rebuild_tag_index reaches its own
try, so an unavailable tag-index dependency raises from there and a bare
return check would let it escape; the wrapper keeps that case inside the
optional index as well.

On failure the store returns a "failed" marker instead, and the step
summary surfaces it, so a degraded tag index stays visible without hiding
the indexes that succeeded.

That marker has to be rendered for flat single-index reports too. A
scope="tag" rebuild returns {"indexed": 0, "scope": "tag", "failed": true}
with no nested entries, so a summary built only from nested dictionaries
drops it and answers "Reindexed scope=tag: 0 indexed" -- indistinguishable
from a successful empty rebuild. MCP callers read only the answer and the
CLI hides metadata, so they had no way to tell a failed repair from an
empty one.

The embedding rebuild keeps raising: it is not an optional index, and an
incomplete vector index must not be reported as success.

Refs agentscope-ai/QwenPaw#8863
Refs agentscope-ai/QwenPaw#8580
2026-11-26 11:13:12 +08:00
..
__init__.py feat(file_store): add ZvecLocalFileStore backend (#410) 2026-08-05 22:08:30 +08:00
base_file_store.py refactor(core): reorganize the ReMe runtime and shared helpers (#769) 2026-11-20 22:06:46 +08:00
faiss_local_file_store.py refactor(core): reorganize the ReMe runtime and shared helpers (#769) 2026-11-20 22:06:46 +08:00
local_file_store.py fix(file_store): keep tag rebuild failures from aborting the whole reindex (#780) 2026-11-26 11:13:12 +08:00
zvec_local_file_store.py refactor(core): reorganize the ReMe runtime and shared helpers (#769) 2026-11-20 22:06:46 +08:00