Skip to content

fix(knowledge): use current parser rules for batch reparse - #2763

Open
Jonesxq wants to merge 1 commit into
Tencent:mainfrom
Jonesxq:fix/batch-reparse-parser-rules
Open

fix(knowledge): use current parser rules for batch reparse#2763
Jonesxq wants to merge 1 commit into
Tencent:mainfrom
Jonesxq:fix/batch-reparse-parser-rules

Conversation

@Jonesxq

@Jonesxq Jonesxq commented Aug 21, 2026

Copy link
Copy Markdown

Description

Batch reparse tasks without an explicit process_config reload each document's stored process overrides. Upload-time parser-engine snapshots then take precedence over the knowledge base's current parser rules, so changing the parser engine does not affect failed documents selected for batch reparse.

This change clears only the stored parser-engine rule snapshots before a nil-config batch reparse:

  • both top-level and nested chunking_config parser rules are removed;
  • document-specific chunking, multimodal, and parser options are preserved;
  • explicit batch process_config and single-document reparse behavior are unchanged;
  • metadata is updated only when a parser snapshot exists, and update errors flow through the existing batch outcome aggregation.

This is a focused implementation against the current main. It follows the backend direction discussed in the closed, unmerged #1901 and accounts for the nested snapshot identified there; #2094 explored a broader frontend-driven alternative.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • 🎨 Refactor
  • ⚡ Performance improvement
  • 🧪 Test
  • 🔧 Configuration / Build / CI

Related Issue

Fixes #1892

Testing

go test ./internal/application/service -run 'TestClearStoredParserEngineRules|TestRunKnowledgeListReparseSubmissions|TestReparseKnowledgeManualEnqueueFailureIsVisible' -count=1
go vet ./internal/application/service
golangci-lint run --new-from-rev=origin/main ./internal/application/service

All focused commands pass; golangci-lint reports 0 issues.

go test ./internal/application/service -count=1 was also run. On Windows it fails only while removing SQLite temporary files in these existing tests:

  • TestDataSourceServiceDeleteSQLiteCleansUpAfterSoftDelete
  • TestDataSourceServiceDeleteKeepsCleanupStateWhenSoftDeleteFails
  • TestDeleteKnowledgeBaseCleansUpSQLiteDataSources

The same weknora.db file-lock cleanup failures reproduce on an unchanged main worktree.

Checklist

  • git diff --check origin/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed package pass
  • Diff-scoped lint passes for the changed package
  • Unrelated full-package Windows failures are documented above and reproduced on main
  • Self-reviewed the code
  • Added tests covering top-level and nested snapshots, no-op behavior, preserved overrides, and update failures
  • Documentation is not affected; no public API or configuration changed
  • No breaking changes

Screenshots / Recordings

Not applicable; this is a backend batch-processing fix.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

sakitam-fdd added a commit to sakitam-fdd/WeKnora that referenced this pull request Aug 21, 2026
Port upstream Tencent#2763 onto the fork's current main.

This clears upload-time parser engine rule snapshots only for nil-config batch reparses, so reparsing uses the knowledge base's current parser rules while preserving document-specific chunking, multimodal, and parser options.
sakitam-fdd added a commit to sakitam-fdd/WeKnora that referenced this pull request Aug 21, 2026
Port Tencent#2763 and Tencent#2711 after current-main review and fork-side validation.
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.

[Bug]: 批量重建解析失败的知识条目时,依然使用最初配置的解析引擎,而非更新后的解析引擎

1 participant