Skip to content

fix(knowledge): reconcile wiki state when moving documents across KBs - #2335

Merged
lyingbug merged 1 commit into
Tencent:mainfrom
lyingbug:fix/knowledge-move-wiki-cleanup
Jul 27, 2026
Merged

fix(knowledge): reconcile wiki state when moving documents across KBs#2335
lyingbug merged 1 commit into
Tencent:mainfrom
lyingbug:fix/knowledge-move-wiki-cleanup

Conversation

@lyingbug

Copy link
Copy Markdown
Collaborator

Summary

  • Run the same wiki cleanup as document delete on the source KB when moving knowledge across knowledge bases, so stale wiki_pages source refs no longer keep moved documents visible in the folder tree and wiki graph.
  • Enqueue wiki ingest on the target KB for reuse_vectors moves, since that path keeps existing chunks and does not re-enter the post-process pipeline that normally triggers wiki ingestion.
  • Add regression tests covering source retract, target ingest, and non-wiki KB no-op behavior.

Test plan

  • go test ./internal/application/service/ -run TestMoveOneKnowledge -count=1
  • go test ./internal/application/service/ -count=1
  • Move a document from wiki KB A to wiki KB B with reuse_vectors and verify A's folder tree/wiki graph no longer show the document
  • Verify B eventually ingests the moved document into its wiki tree
  • Move with reparse and verify source wiki cleanup still happens without duplicate target ingest

Cross-KB moves updated knowledges/chunks but left wiki_pages source_refs
behind in the source wiki KB, so the folder tree and wiki graph still showed
moved documents. Run the same wiki cleanup as delete on the source KB and
enqueue wiki ingest on the target for reuse_vectors moves.
@lyingbug
lyingbug merged commit 1d64fc6 into Tencent:main Jul 27, 2026
1 check passed
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.

1 participant