Skip to content

fix: clear skill search index when the catalog becomes empty - #975

Open
AWUQAQ wants to merge 1 commit into
modelscope:mainfrom
AWUQAQ:fix/clear-empty-skill-search-index
Open

AWUQAQ wants to merge 1 commit into
modelscope:mainfrom
AWUQAQ:fix/clear-empty-skill-search-index

Conversation

@AWUQAQ

@AWUQAQ AWUQAQ commented Sep 13, 2026

Copy link
Copy Markdown

Change Summary

After a search populates the skill index, disabling or removing all
skills leaves stale search results. _ensure_indexed() skips indexing
when there are no documents but still updates the cache version.

Reset the retriever when there are no enabled skill documents.

Add regression tests covering:

  • Disabling or removing all skills and repeating the search.
  • Restoring search after enabling or adding a skill.
  • Clearing the child indexes of a hybrid retriever.

Validation

  • The three new regression tests fail before the fix.
  • All 37 tests in tests/skills/test_skill_features.py pass with the fix.
  • All applicable pre-commit hooks pass for both changed files.
  • git diff --check passes.

Full-repository checks and remote CI have not been run.
Implementation and regression tests were prepared with AI assistance.

Related issue number

Fixes #974

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Run pre-commit install and pre-commit run --all-files before git commit, and passed lint check.
  • Documentation reflects the changes where applicable

Pre-commit was run on the two changed files; the full-repository
checklist item remains unchecked. No documentation changes are needed
for this internal bug fix.

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.

Skill search returns stale results after all skills are disabled or removed

1 participant