fix(knowledge): surface batch reparse failures - #2453
Merged
lyingbug merged 1 commit intoJul 31, 2026
Conversation
Signed-off-by: Myang_print <1182470296@qq.com>
Myang-print
marked this pull request as ready for review
July 31, 2026 05:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Batch reparse previously hid per-item submission failures:
ReparseKnowledgereset a document topending, then returned success when payload marshaling or task enqueueing failed.ProcessKnowledgeListReparsecounted failed submissions but always returnednil, so the wrapper task was reported as successful.This change persists failed document state, propagates submission errors, attempts every item in a batch, and returns an aggregate non-retryable error. The wrapper uses
asynq.SkipRetrybecause automatically retrying a partially submitted batch would clear and reparse documents that were already submitted successfully. Failed documents remain available for an explicit retry.Regression tests cover the failed state transition, mixed-success aggregation, non-retryable behavior, and the all-success path. The batch-reparse API and its failure semantics are now documented.
There are no API shape, UI, or other breaking changes.
Type of Change
Related Issue
Fixes #1651
Testing
go test ./internal/application/service -count=1— passes.go vet ./internal/application/service— passes.go build ./cmd/server— passes.golangci-lint run --new-from-rev=upstream/main ./...— passes with0 issues.git diff --check origin/main...HEADandgit diff --check upstream/main...HEAD— pass.go test ./... -count=1— all changed packages pass; the full run is blocked only by unrelated DNS-dependent SSRF tests ininternal/datasource,internal/models/chat,internal/models/embedding, andinternal/utils. On this WSL/TUN environment, public test hosts such asexample.com,open.feishu.cn, andexample.openai.azure.comresolve to synthetic198.18.0.0/15addresses, which the existing SSRF guard correctly rejects.Checklist
git diff --check origin/main...HEADpassesgolangci-lint run --new-from-rev=origin/main ./...)docs/, Swagger annotations, etc.)Screenshots / Recordings
Not applicable. This change affects backend failure handling and API documentation only; the existing batch-reparse UI is unchanged.